How rohith-2504/rag-chatbot works
RAG ChatBot is a browser-based assistant for account access, multi-session conversations, chat history, document uploads and retrieval-augmented answers, with optional web search and generated media. The main workflow is React UI → FastAPI chat/upload endpoints → routing, retrieval and model/tool services → persisted history or indexed documents. The graph retains documented capabilities whose internals were not sampled; edges are limited to relationships visible in excerpts, the SOURCE INDEX, or README. Several service implementations were not excerpted, so their internal call paths are omitted.
Main entry points: media_service.py Media processing · chat.py Chat and upload API · App.jsx API requests · router_service.py Request routing
Components 31
Chat interface
- Chat and sessions UI
frontend/src/App.jsx - API requests
frontend/src/App.jsx
HTTP API
- FastAPI app
backend/app/main.py - Chat and upload API
backend/app/api/chat.py - Session API
backend/app/api/sessions.py - Message API
backend/app/api/messages.py - Authentication API
backend/app/api/auth.py
Conversation services
- Request routing
backend/app/services/router_service.py - LLM and tool dispatch
backend/app/services/llm_service.py - Assistant tools
backend/app/services/tool_service.py - Web search
backend/app/services/web_search_service.py - Session management
backend/app/services/session_service.py - Message history
backend/app/services/message_service.py - Conversation memory
backend/app/services/memory_service.py - Authentication service
backend/app/services/auth_service.py
Knowledge and media
- RAG ingestion and retrieval
backend/app/services/rag_service.py - Media processing
backend/app/services/media_service.py - Document extraction
backend/app/services/document_service.py - Audio processing
backend/app/services/audio_service.py - Image processing
backend/app/services/image_service.py - Video processing
backend/app/services/video_service.py - PDF processing
backend/app/services/pdf_service.py - Document loading
backend/app/services/document_loader.py - Vector search
backend/app/services/vector_store.py - Media generation
backend/app/services/generation_service.py
Persistence and integrations
- SQLite access
backend/app/services/database.py - Runtime configuration
backend/app/core/config.py - ChromaDB
Other components
- Chat user
- OpenAI-compatible model
- Tavily search
Connections 41
- Chat user → Chat and sessions UI: uses
README.md - Chat and sessions UI → API requests: sends requests
frontend/src/App.jsx - API requests → Chat and upload API: calls chat and upload
- API requests → Session API: manages sessions
- API requests → Message API: loads history
- API requests → Authentication API: authenticates
- FastAPI app → Chat and upload API: registers
backend/app/main.py - FastAPI app → Session API: registers
backend/app/main.py - FastAPI app → Message API: registers
backend/app/main.py - FastAPI app → Authentication API: registers
backend/app/main.py - Chat and upload API → Request routing: routes chat
backend/app/api/chat.py - Chat and upload API → Session management: creates sessions
backend/app/api/chat.py - Chat and upload API → Message history: stores chat
backend/app/api/chat.py - Chat and upload API → RAG ingestion and retrieval: indexes uploads
backend/app/api/chat.py - Request routing → RAG ingestion and retrieval: retrieves context
backend/app/services/router_service.py - Request routing → LLM and tool dispatch: requests response
backend/app/services/router_service.py - Request routing → Web search: searches web
backend/app/services/router_service.py - Request routing → Message history: uses history
backend/app/services/router_service.py - RAG ingestion and retrieval → Media processing: processes files
backend/app/services/rag_service.py - RAG ingestion and retrieval → Vector search: adds and searches
backend/app/services/rag_service.py - Media processing → Document extraction: dispatches formats
backend/app/services/media_service.py - Media processing → Audio processing: dispatches formats
backend/app/services/media_service.py - Media processing → Image processing: dispatches formats
backend/app/services/media_service.py - Media processing → Video processing: dispatches formats
backend/app/services/media_service.py - Media processing → PDF processing: dispatches formats
backend/app/services/media_service.py - LLM and tool dispatch → OpenAI-compatible model: completes prompts
backend/app/services/llm_service.py - LLM and tool dispatch → Assistant tools: dispatches tool calls
backend/app/services/llm_service.py - Assistant tools → Web search: delegates search
backend/app/services/tool_service.py - Assistant tools → Media generation: generates video
backend/app/services/tool_service.py - Web search → Tavily search: queries
backend/app/services/web_search_service.py - Session API → Session management: handles session actions
backend/app/api/sessions.py - Message API → Message history: handles history actions
backend/app/api/messages.py - Authentication API → Authentication service: delegates authentication
backend/app/api/auth.py - Session management → SQLite access: reads and writes
backend/app/services/session_service.py - Message history → SQLite access: reads and writes
backend/app/services/message_service.py - Authentication service → SQLite access: uses database
backend/app/services/auth_service.py - Vector search → ChromaDB: stores embeddings
- Runtime configuration → SQLite access: configures location
backend/app/services/database.py - Runtime configuration → LLM and tool dispatch: configures provider
backend/app/services/llm_service.py - Runtime configuration → Web search: configures key
backend/app/services/web_search_service.py - Runtime configuration → Vector search: configures storage
backend/app/services/vector_store.py