How monishajaiganesh/pdf_rag_chatbot works
PDF RAG Chatbot lets users upload PDFs, explore them conversationally, and receive answers grounded in retrieved document passages. Uploads are extracted, chunked, embedded, and indexed; questions are served through hybrid semantic and keyword retrieval, reranking, and generation with source information. The product also supports resume evaluation and document deletion. The graph includes the current frontend and the indexed legacy frontend. Some implementation details are unsampled, so those relationships are shown only where the README or excerpts support them.
Main entry points: main.py FastAPI endpoints · chroma_store.py Chroma persistence · retriever.py Hybrid retrieval · chat-workspace.tsx Chat workspace
Components 19
User experience
- Chat workspace
frontend/src/components/docmind/chat-workspace.tsx - API client
frontend/src/lib/docmind/api.ts - Legacy chat UI
frontend-old/src/App.jsx
API and workflows
- FastAPI endpoints
api/main.py - Runtime configuration
config.py - Retrieval evaluation
evaluation/evaluate.py
Document indexing
- Local PDF files
api/main.py - PDF extraction and chunking
ingestion/chunker.py - Embedding generation
ingestion/embedding.py - Chroma persistence
vectorstore/chroma_store.py - FAISS store
vectorstore/faiss_store.py
Answer retrieval
- Hybrid retrieval
retrieval/retriever.py - Cross-encoder reranking
retrieval/reranker.py - Gemini answer generation
retrieval/gemini_generation.py
Other components
- User
- Uploaded PDF
- Chroma index
- Gemini service
- Ollama service
Connections 21
- User → Chat workspace: asks questions
README.md - Chat workspace → API client: sends requests
- API client → FastAPI endpoints: calls API
README.md - User → Legacy chat UI: uses legacy UI
frontend-old/src/App.jsx - Legacy chat UI → FastAPI endpoints: queries API
frontend-old/src/App.jsx - User → Uploaded PDF: uploads
README.md - Uploaded PDF → FastAPI endpoints: submits upload
README.md - FastAPI endpoints → Local PDF files: writes and deletes
api/main.py - FastAPI endpoints → Chroma persistence: indexes and deletes
api/main.py - Chroma persistence → PDF extraction and chunking: creates chunks
vectorstore/chroma_store.py - Chroma persistence → Embedding generation: creates embeddings
vectorstore/chroma_store.py - Embedding generation → Ollama service: requests vectors
ingestion/embedding.py - Chroma persistence → Chroma index: stores chunks
vectorstore/chroma_store.py - FastAPI endpoints → Hybrid retrieval: retrieves passages
api/main.py - Hybrid retrieval → Chroma index: searches vectors
retrieval/retriever.py - Hybrid retrieval → Cross-encoder reranking: reranks candidates
retrieval/retriever.py - FastAPI endpoints → Gemini answer generation: generates answers
api/main.py - Gemini answer generation → Gemini service: requests completion
retrieval/gemini_generation.py - FastAPI endpoints → Retrieval evaluation: evaluates retrieval
README.md - FastAPI endpoints → Runtime configuration: uses settings
api/main.py - FastAPI endpoints → User: returns answer and sources
api/main.py