How rajshekharbind/enterprise-multi-agent-rag-platform works
This is an enterprise multi-agent RAG chat platform. Users create a session, upload PDFs, and ask questions; the chat API loads session memory, routes the query to a general, RAG, or analysis agent, and stores the answer. The document path loads and chunks PDFs, embeds them, and persists a session-specific FAISS index for retrieval. The README also documents document management, memory/session clearing, health/status, and the web UI. Some agent and upload internals were not excerpted; their links are included only where the source index or README supports them.
Main entry points: chat.py Chat endpoint · vectorstore.py Session vector store · openai_client.py LLM client · main.py FastAPI app
Components 21
Web client
- Chat interface
frontend/app/page.tsx
API and sessions
- FastAPI app
app/main.py - Health and status
app/api/v1/routes.py - Chat endpoint
app/api/v1/chat.py - Document endpoints
app/api/v1/upload.py
Agent orchestration
- Query router
app/agents/router_agent.py - General agent
app/agents/general_agent.py - RAG agent
app/agents/rag_agent.py - Analysis agent
app/agents/analysis_agent.py - LLM client
app/llm/openai_client.py
Document retrieval
- PDF loader
app/rag/loader.py - Text splitter
app/rag/splitter.py - Embeddings
app/rag/embeddings.py - Context retriever
app/rag/retriever.py
Persistent state
- Session vector store
app/rag/vectorstore.py - Conversation memory
app/agents/memory.py - SQLite database
app/database/db.py - Conversation records
app/models/conversation.py - ORM base
app/database/base.py
Other components
- User
- Ollama LLM
Connections 30
- User → Chat interface: uses
README.md - Chat interface → FastAPI app: calls API
README.md - FastAPI app → Chat endpoint: mounts route
app/main.py - FastAPI app → Document endpoints: mounts route
app/main.py - FastAPI app → Health and status: mounts route
app/main.py - Chat endpoint → Conversation memory: reads and writes
app/api/v1/chat.py - Chat endpoint → Query router: routes query
app/api/v1/chat.py - Chat endpoint → RAG agent: dispatches RAG
app/api/v1/chat.py - Chat endpoint → Analysis agent: dispatches analysis
app/api/v1/chat.py - Chat endpoint → General agent: dispatches general
app/api/v1/chat.py - Chat endpoint → Session vector store: clears session
app/api/v1/chat.py - Query router → LLM client: classifies query
app/agents/router_agent.py - General agent → LLM client: generates answer
app/agents/general_agent.py - RAG agent → Session vector store: gets session index
app/agents/rag_agent.py - RAG agent → Context retriever: retrieves context
app/agents/rag_agent.py - RAG agent → LLM client: generates answer
app/agents/rag_agent.py - Analysis agent → Session vector store: gets session index
app/agents/analysis_agent.py - Analysis agent → Context retriever: retrieves context
app/agents/analysis_agent.py - Analysis agent → LLM client: generates analysis
app/agents/analysis_agent.py - LLM client → Ollama LLM: requests completion
README.md - Document endpoints → PDF loader: loads PDFs
app/api/v1/upload.py - Document endpoints → Text splitter: splits documents
app/api/v1/upload.py - Document endpoints → Session vector store: stores chunks
app/api/v1/upload.py - Session vector store → Embeddings: embeds chunks
app/rag/vectorstore.py - Context retriever → Embeddings: embeds query
app/rag/retriever.py - Context retriever → Session vector store: searches index
app/rag/retriever.py - Conversation memory → SQLite database: uses sessions
app/agents/memory.py - Conversation memory → Conversation records: persists messages
app/agents/memory.py - Conversation records → ORM base: maps records
app/models/conversation.py - ORM base → SQLite database: imports ORM base
app/database/base.py