How kallappa2005/docu-rag works
This is a FastAPI document RAG chatbot: users upload PDFs and ask questions answered using retrieved document context and Groq, with in-memory conversation history. The sampled upload handler only saves files; the README describes a subsequent ingestion pipeline, but its runtime wiring is not shown. The chat path is explicit in source. Unsampled ingestion links below are documented, not verified calls.
Main entry points: rag_chain.py RAG orchestration · chat.py Chat endpoint · main.py FastAPI app · upload.py Upload endpoint
Components 20
API
- FastAPI app
app/main.py - Upload endpoint
app/routers/upload.py - Chat endpoint
app/routers/chat.py - Health endpoint
app/routers/health.py - Upload response
app/models/response_models.py - Chat request
app/models/request_models.py - Chat response
app/models/response_models.py
Document Ingestion
- PDF file saving
app/services/pdf_service.py - PDF extraction
app/services/pdf_loader.py - Text chunking
app/services/text_splitter.py - HuggingFace embeddings
app/services/embedding_service.py - Chroma vector store
app/services/vector_store.py
RAG Answering
- RAG orchestration
app/services/rag_chain.py - Semantic retrieval
app/services/retriever.py - RAG prompt
app/prompts/prompt.py - Groq LLM client
app/services/groq_service.py - Chat memory
app/memory/chat_memory.py
Configuration and State
- Environment settings
app/config/settings.py
Other components
- API user
- Health-check caller
Connections 22
- API user → FastAPI app: sends requests
README.md - FastAPI app → Upload endpoint: registers route
app/main.py - FastAPI app → Chat endpoint: registers route
app/main.py - FastAPI app → Health endpoint: registers route
app/main.py - API user → Upload endpoint: uploads PDF
README.md - Upload endpoint → PDF file saving: saves file
app/routers/upload.py - Upload endpoint → Upload response: returns response
app/routers/upload.py - API user → Chat endpoint: asks question
README.md - Chat endpoint → Chat request: accepts request
app/routers/chat.py - Chat endpoint → RAG orchestration: asks question
app/routers/chat.py - Chat endpoint → Chat response: returns answer
app/routers/chat.py - RAG orchestration → Semantic retrieval: retrieves chunks
app/services/rag_chain.py - Semantic retrieval → Chroma vector store: searches vectors
app/services/retriever.py - RAG orchestration → Chat memory: reads and updates
app/services/rag_chain.py - RAG orchestration → RAG prompt: formats context
app/services/rag_chain.py - RAG orchestration → Groq LLM client: invokes model
app/services/rag_chain.py - Health-check caller → Health endpoint: checks status
README.md - PDF file saving → PDF extraction: loads saved PDF
README.md - PDF extraction → Text chunking: extracts for chunking
README.md - Text chunking → HuggingFace embeddings: embeds chunks
README.md - HuggingFace embeddings → Chroma vector store: stores vectors
README.md - Chroma vector store → Semantic retrieval: serves similarity search
README.md