How varshinimishra123/documind works
DocuMind is a PDF question-answering RAG service. Users upload PDFs for page-aware semantic chunking and hybrid indexing, then submit questions through an API; retrieval fuses dense and lexical candidates, reranks them, and generation returns a grounded answer with citations. RAGAS evaluation is a separate product capability. The README documents the full retrieval stages; sampled source confirms the API orchestration, indexer, and retrieval implementation. Some internal wiring and evaluation invocation were not shown, so those connections are omitted.
Main entry points: main.py FastAPI service · retrieval.py Candidate retrieval · storage.py Dual indexing · ingestion.py PDF ingestion
Components 14
API and UI
- FastAPI service
main.py
Document Ingestion
- PDF ingestion
ingestion.py - Semantic chunking
ingestion.py - Dual indexing
storage.py - Dense index
storage.py - BM25 index
storage.py
Hybrid Retrieval
- Candidate retrieval
retrieval.py - RRF fusion
retrieval.py - Cross-encoder reranking
retrieval.py
Grounded Answers
- Grounded generation
generation.py - OpenAI / Ollama
- Answer and citations
main.py
Evaluation
- RAGAS evaluation
evaluation.py
Other components
- Questioner
Connections 14
- Questioner → FastAPI service: uploads or asks
README.md - FastAPI service → PDF ingestion: processes upload
main.py - PDF ingestion → Semantic chunking: splits pages
ingestion.py - FastAPI service → Dual indexing: builds indices
README.md - Dual indexing → Dense index: builds dense
storage.py - Dual indexing → BM25 index: builds sparse
storage.py - FastAPI service → Candidate retrieval: retrieves chunks
main.py - Candidate retrieval → Dense index: searches dense
README.md - Candidate retrieval → BM25 index: searches sparse
README.md - Candidate retrieval → RRF fusion: fuses rankings
retrieval.py - RRF fusion → Cross-encoder reranking: ranks candidates
README.md - FastAPI service → Grounded generation: generates answer
README.md - Grounded generation → OpenAI / Ollama: requests completion
generation.py - FastAPI service → Answer and citations: returns citations
main.py