How mohith292005/ragchatbot works
DocQuery is a document-chat product with two user interfaces: a React client backed by FastAPI and a Streamlit app that invokes the same RAG modules directly. The primary workflow uploads and extracts a document, chunks and indexes it, then retrieves relevant chunks for a grounded, cited LLM answer. The graph preserves ingestion, retrieval, generation, and both UI paths. The README documents broader formats and capabilities; source-level edges are limited to shown calls, while README evidence supports documented model behavior.
Main entry points: streamlit_app.py Streamlit UI · main.py FastAPI routes · vectorstore.py Vector store · retriever.py Semantic retrieval
Components 11
User interfaces
- React chat UI
frontend/src/App.jsx - Streamlit UI
streamlit_app.py
API orchestration
- FastAPI routes
backend/api/main.py
Document ingestion
- Text extraction
backend/ingest/extractor.py - Chunking
backend/ingest/chunker.py
Question answering
- Semantic retrieval
backend/retriever/retriever.py - Grounded answer
backend/api/llm.py
Persistence
- Uploaded files
data - Vector store
backend/ingest/vectorstore.py
Other components
- User
- OpenRouter
Connections 18
- User → React chat UI: uses
frontend/src/App.jsx - User → Streamlit UI: uses
README.md - React chat UI → FastAPI routes: requests
frontend/src/App.jsx - FastAPI routes → Uploaded files: writes upload
backend/api/main.py - FastAPI routes → Text extraction: extracts text
backend/api/main.py - FastAPI routes → Chunking: chunks text
backend/api/main.py - FastAPI routes → Vector store: adds chunks
backend/api/main.py - FastAPI routes → Semantic retrieval: retrieves chunks
backend/api/main.py - FastAPI routes → Grounded answer: generates answer
backend/api/main.py - Streamlit UI → Uploaded files: writes upload
streamlit_app.py - Streamlit UI → Text extraction: extracts text
streamlit_app.py - Streamlit UI → Chunking: chunks text
streamlit_app.py - Streamlit UI → Vector store: adds chunks
streamlit_app.py - Streamlit UI → Semantic retrieval: retrieves chunks
streamlit_app.py - Streamlit UI → Grounded answer: generates answer
streamlit_app.py - Semantic retrieval → Vector store: queries
backend/retriever/retriever.py - Vector store → OpenRouter: embeds chunks
README.md - Grounded answer → OpenRouter: requests completion
backend/api/llm.py