How phani-stack/sovereignai works
SOVAI is a self-hosted AI workbench for private document, knowledge, chat, coding, calculation, and vision tasks. Its principal workflow runs from the browser through FastAPI into chat and agent orchestration, which routes work to local models, retrieval, and tools before returning results. Separate branches handle document upload/indexing, vision, authentication, and sandbox access. README capabilities include verification, reports, and security/audit views; where implementation links were not shown, those links are omitted or marked unverified.
Main entry points: main.py FastAPI Application · nodes.py Plan and Execute · retrive.py Knowledge Retrieval · registry.py Python Tool Registry
Components 25
Workspace and API
- Browser Workspace
frontend/app.js - FastAPI Application
backend/main.py - Chat Routes
backend/api/routes/chat.py - Document Routes
backend/api/routes/document.py - Vision Routes
backend/api/routes/vision.py - Sandbox Routes
backend/api/routes/sandbox.py - Auth Routes
backend/api/routes/auth.py
Product Services
- Chat Service
backend/core/services/chat_service.py - Document Service
backend/core/services/document_service.py - Vision Service
backend/core/services/vision_service.py - Access and Sessions
backend/core/services/auth_service.py
Agent and Tools
- Agent Graph
backend/core/agent/graph.py - Plan and Execute
backend/core/agent/nodes.py - Python Tool Registry
backend/core/tools/registry.py - Document Tools
backend/core/tools/document_tools.py
Local AI and Knowledge
- Local Model Router
backend/infrastructure/models/model_manager.py - Document Embeddings
backend/core/rag/embedding.py - Document Loaders
backend/infrastructure/loaders/loader_router.py - Knowledge Retrieval
backend/core/rag/retrive.py - RAG Indexing
backend/core/rag/vectordb.py - Qdrant Search
backend/infrastructure/qdrant/search.py - Qdrant Store
backend/infrastructure/qdrant/client.py
Other components
- Workbench User
- Local Ollama
- Isolated Runtime
Connections 27
- Workbench User → Browser Workspace: uses
- Browser Workspace → FastAPI Application: sends requests
- FastAPI Application → Chat Routes: registers
backend/main.py - FastAPI Application → Document Routes: registers
backend/main.py - FastAPI Application → Vision Routes: registers
backend/main.py - FastAPI Application → Sandbox Routes: registers
backend/main.py - FastAPI Application → Auth Routes: registers
backend/main.py - Chat Routes → Chat Service: calls
backend/api/routes/chat.py - Document Routes → Document Service: calls
backend/api/routes/document.py - Vision Routes → Vision Service: calls
backend/api/routes/vision.py - Auth Routes → Access and Sessions: authenticates
backend/api/routes/auth.py - Chat Service → Agent Graph: invokes
backend/core/services/chat_service.py - Agent Graph → Plan and Execute: dispatches
backend/core/agent/graph.py - Plan and Execute → Local Model Router: selects model
backend/core/agent/nodes.py - Plan and Execute → Knowledge Retrieval: retrieves context
backend/core/agent/nodes.py - Plan and Execute → Python Tool Registry: gets tools
backend/core/agent/nodes.py - Python Tool Registry → Document Tools: registers
backend/core/tools/registry.py - Local Model Router → Local Ollama: runs inference
- Knowledge Retrieval → Document Embeddings: embeds query
backend/core/rag/retrive.py - Knowledge Retrieval → Qdrant Search: searches
backend/core/rag/retrive.py - Document Service → RAG Indexing: indexes upload
backend/core/services/document_service.py - RAG Indexing → Document Embeddings: embeds documents
backend/core/rag/vectordb.py - Document Embeddings → Document Loaders: loads documents
backend/core/rag/embedding.py - Qdrant Search → Qdrant Store: queries
backend/infrastructure/qdrant/search.py - Sandbox Routes → Isolated Runtime: executes code
- Plan and Execute → Isolated Runtime: may execute code
- Plan and Execute → Python Tool Registry: generates reports
backend/core/agent/nodes.py