How riyakandwal/veyra works
Purpose and Entry Points
This repository is a small AI/vision application with a browser frontend and Python backend. The deployable serverless entry point is api/index.py; backend application startup is likely centralized in backend/main.py. The browser starts from frontend/index.html and loads client behavior from frontend/script.js.
Frontend Experience
The frontend is a static HTML/CSS/JavaScript application:
• frontend/index.html
• frontend/script.js
• frontend/style.css
It also has vision-specific browser logic in frontend/vision.js, indicating client-side capture, rendering, or interaction around visual input. A 3D skull asset at frontend/models/human_skull.glb is a material UI/domain artifact and likely supports anatomical visualization.
API and Deployment Boundary
api/index.py is the boundary between the hosting platform and backend code. vercel.json indicates Vercel deployment, likely exposing the Python API as a serverless function. This boundary should remain thin: request adaptation and backend invocation belong here, while application behavior belongs under backend/.
Backend Application Layer
backend/main.py is the probable backend composition point, coordinating API-facing operations with AI, memory, and vision subsystems:
• backend/main.py
• backend/__init__.py
• backend/requirements.txt
The backend is Python-based, with dependencies scoped in backend/requirements.txt; a root requirements.txt may support platform-level installation or local execution.
AI and Memory Subsystems
The core AI module is backend/core/ai.py, organized under backend/core/. Persistent or conversational/context state is isolated under backend/memory/, especially backend/memory/memory.py.
Primary control flow is expected to be: incoming API request → backend/main.py orchestration → AI processing and optional memory retrieval/update → response returned through api/index.py. The separation makes memory an explicit boundary rather than embedding state directly in request handlers.
Vision Processing
Vision responsibilities are isolated in:
• backend/vision/vision.py
• backend/yolo11n.pt
The included YOLO model weights establish an on-server object-detection inference capability. Backend vision results can feed the AI layer, API response, or frontend visualization, while browser-side vision behavior remains separately located in frontend/vision.js.
Key Runtime Boundaries
The system spans two runtimes:
1. Browser runtime: static frontend, visual interaction, and 3D asset usage.
2. Python/serverless runtime: API handling, AI orchestration, memory, and YOLO inference.
Material external infrastructure is Vercel (vercel.json). No README-defined database, model API provider, authentication service, or messaging service is present, so such integrations should not be assumed without inspecting implementation files.
Main entry points: main.py Backend orchestration · index.py Serverless API adapter · index.html Frontend shell · vision.js Browser vision
Components 13
Browser runtime
- Frontend shell
frontend/index.html - Client behavior
frontend/script.js - Browser vision · Handles visual input or rendering interactions.
frontend/vision.js - UI styles
frontend/style.css - Skull model · Anatomical visualization asset.
frontend/models/human_skull.glb
Python serverless runtime
- Serverless API adapter · Adapts hosting requests to backend application behavior.
api/index.py - Backend orchestration · Coordinates API-facing AI, memory, and vision operations.
backend/main.py - AI processing
backend/core/ai.py - Context memory · Retrieves and updates conversational or contextual state.
backend/memory/memory.py - Vision inference · Runs server-side visual processing.
backend/vision/vision.py - YOLO model weights · Object-detection inference model.
backend/yolo11n.pt - Backend dependencies
backend/requirements.txt
Other components
- Vercel deployment · Deploys the static frontend and serverless API.
vercel.json
Connections 15
- Vercel deployment → Frontend shell: serves
- Vercel deployment → Serverless API adapter: invokes
- Frontend shell → Client behavior: loads
- Frontend shell → Browser vision: loads
- Frontend shell → UI styles: applies
- Browser vision → Skull model: uses
- Client behavior → Serverless API adapter: API requests
- Browser vision → Serverless API adapter: visual input/results
- Serverless API adapter → Backend orchestration: delegates
- Backend orchestration → AI processing: orchestrates
- Backend orchestration → Context memory: reads and updates
- Backend orchestration → Vision inference: invokes
- Vision inference → YOLO model weights: loads
- Backend orchestration → Serverless API adapter: response
- Backend dependencies → Backend orchestration: provides runtime packages