How aryansaxena136/opencanvas works
OpenCanvas is a FastAPI backend for authenticated, persistent AI conversations, with chat, streaming and file-upload workflows plus image classification and shuttle detection/tracking. Users authenticate through JWT endpoints, create or retrieve conversations, and send messages; chat routes load history, invoke the configured agent and persist replies. The agent is configured with Groq-first/Gemini-fallback LLMs and ML tools. The README documents these capabilities; omitted main.py sections limit certainty about some route wiring, so the graph focuses on evidenced integrations.
Main entry points: main.py LangChain agent · model.py User and messages · auth.py JWT authentication · shuttle_tool.py Shuttle detection
Components 17
API workflows
- FastAPI routes
main.py - Chat workflows
main.py - File chat
main.py - Streaming chat
main.py - Uploaded and result files
main.py
Identity
- JWT authentication
auth.py
Conversation state
- DB sessions
database/db.py - User and messages
database/model.py - SQLite database
database/db.py
AI inference
- LangChain agent
main.py - Shuttle detection
tools/shuttle_tool.py - CIFAR classifier
tools/cifar_tool.py - YOLO weights
shuttle.pt - CIFAR weights
cifar-10.keras
Other components
- Client
- Groq LLM
- Gemini fallback
Connections 21
- Client → FastAPI routes: calls endpoints
- FastAPI routes → JWT authentication: delegates auth
- JWT authentication → DB sessions: gets sessions
- DB sessions → SQLite database: opens
- JWT authentication → User and messages: queries users
- FastAPI routes → DB sessions: gets sessions
- Chat workflows → LangChain agent: invokes
- File chat → LangChain agent: invokes
- Streaming chat → LangChain agent: streams
- Chat workflows → User and messages: reads and saves
- File chat → User and messages: reads and saves
- Streaming chat → User and messages: reads and saves
- LangChain agent → Groq LLM: calls primary
- LangChain agent → Gemini fallback: fallback calls
- LangChain agent → Shuttle detection: dispatches tool
- LangChain agent → CIFAR classifier: dispatches tool
- Shuttle detection → YOLO weights: loads weights
- CIFAR classifier → CIFAR weights: loads weights
- File chat → Uploaded and result files: writes uploads
- Shuttle detection → Uploaded and result files: writes results
- FastAPI routes → Uploaded and result files: serves files