How q1anyii/mitta works
Mitta is a knowledge-base AI assistant. Its main user workflow is authenticated chat: the API streams a request through ChatService into a LangGraph that routes persona and retrieval intent, optionally runs hybrid RAG, then answers with memory and MCP tools. Separate product branches handle account security, user profiles, file uploads and knowledge-base ingestion. The README documents the retrieval stages and major capabilities; sampled source confirms selected orchestration and service links, so unsampled internal wiring is not expanded.
Main entry points: main_graph.py Main conversation graph · query_nodes.py Rewrite and recall · auth_router.py Authentication API · retrieve_graph.py Retrieval subgraph
Components 26
API and identity
- FastAPI application
src/main.py - Chat API
src/routers/chat_router.py - Authentication API
src/routers/auth_router.py - Login service
src/service/login_service.py
Agent workflow
- ChatService
src/service/chat_service.py - Main conversation graph
src/graphs/main_graph.py - Persona and intent router
src/graphs/nodes/router_node.py
Knowledge retrieval
- Retrieval subgraph
src/graphs/retrieve_graph.py - Rewrite and recall
src/graphs/nodes/retrieve/query_nodes.py - Fusion and reranking
src/graphs/nodes/retrieve/fusion_nodes.py - Retrieval output
src/graphs/nodes/retrieve/output_node.py - Vector store
src/vector/vector_store.py
Memory and tools
- Cache and sparse index
src/service/cache_service.py - Conversation and profile memory
src/graphs/nodes/memory_node.py - User profile service
src/service/user_profile_service.py - PostgreSQL
- Tool selection
src/graphs/tool_filter.py - MCP client
src/mcp_client/client.py
Knowledge management
- Knowledge API
src/routers/knowledge_router.py - Knowledge service
src/service/knowledge_service.py - File upload and parsing
src/service/file_upload_service.py - Incremental ingestion
resources/knowledge-base/ingest_knowledge.py - Document embedding
src/vector/embedding.py
Other components
- Assistant user
- LLM provider
- MCP tool servers
Connections 30
- Assistant user → FastAPI application: sends requests
- FastAPI application → Chat API: routes chat
- Chat API → ChatService: starts stream
- ChatService → Main conversation graph: runs graph
- Main conversation graph → Persona and intent router: classifies
- Persona and intent router → LLM provider: classifies with
- Main conversation graph → Retrieval subgraph: retrieves when needed
- Retrieval subgraph → Rewrite and recall: runs recall
- Rewrite and recall → LLM provider: rewrites with
- Rewrite and recall → Vector store: queries vectors
- Rewrite and recall → Cache and sparse index: searches BM25
- Retrieval subgraph → Fusion and reranking: fuses and reranks
- Fusion and reranking → Retrieval output: produces results
- Main conversation graph → LLM provider: generates answer
- Main conversation graph → Conversation and profile memory: updates memory
- Conversation and profile memory → User profile service: stores profile
- User profile service → PostgreSQL: persists profile
- Main conversation graph → Tool selection: filters tools
- Main conversation graph → MCP client: invokes tools
- MCP client → MCP tool servers: connects tools
- Assistant user → Authentication API: authenticates
- Authentication API → Login service: handles account actions
- Authentication API → Cache and sparse index: stores token state
- Login service → PostgreSQL: checks users
- Assistant user → Knowledge API: manages knowledge
- Knowledge API → Knowledge service: delegates knowledge work
- Knowledge service → File upload and parsing: processes files
- Incremental ingestion → Document embedding: embeds documents
- Document embedding → Vector store: writes vectors
- Incremental ingestion → Cache and sparse index: writes sparse index