How ayushpeterlakra/vector_database_design_for_rag_system works
PrecisionRAG is a Qdrant-backed passage retrieval product for MS MARCO and internal documents. Its main workflow is a user search through the web UI and FastAPI, then dense/BM25 retrieval, optional fusion and reranking, and ranked results; users can also request cited AI answers. Separate capabilities include offline corpus indexing, metadata/topic filters, live document updates with version history, and benchmark dashboards. Edges reflect the README and shown source references; some internal implementations, including API handlers and indexing details, were not fully excerpted.
Main entry points: retriever.py Retrieval pipeline · main.py FastAPI service · updates.py Live updates · store.py Qdrant store
Components 22
Search and answers
- Web UI
web/app.js - FastAPI service
api/main.py - Retrieval pipeline
precisionrag/retriever.py - Text encoders
precisionrag/encoders.py - Rank fusion
precisionrag/fusion.py - Cross-encoder
precisionrag/rerank.py - Cited answers
precisionrag/answer.py - Result cache
precisionrag/cache.py - Runtime settings
precisionrag/config.py
Index and storage
- Corpus indexing
scripts/build_index.py - Corpus preparation
precisionrag/data.py - Qdrant store
precisionrag/store.py
Tags and updates
- Metadata tagging
precisionrag/tags.py - Live updates
precisionrag/updates.py - Version history
precisionrag/changelog.py
Evaluation and reporting
- Dashboard data
precisionrag/dashboard.py - Retrieval metrics
precisionrag/metrics.py - Measurement files
precisionrag/results.py - IR evaluation
scripts/eval_ir.py
Other components
- Search user
- Groq API
- Qdrant
Connections 28
- Search user → Web UI: searches
README.md - Web UI → FastAPI service: calls API
README.md - FastAPI service → Retrieval pipeline: dispatches search
api/main.py - FastAPI service → Result cache: checks and stores
api/main.py - FastAPI service → Cited answers: requests answer
api/main.py - FastAPI service → Live updates: routes updates
api/main.py - FastAPI service → Dashboard data: serves dashboard
api/main.py - Retrieval pipeline → Text encoders: encodes queries
precisionrag/retriever.py - Retrieval pipeline → Qdrant store: searches candidates
precisionrag/retriever.py - Retrieval pipeline → Rank fusion: fuses rankings
precisionrag/retriever.py - Retrieval pipeline → Cross-encoder: reranks candidates
precisionrag/retriever.py - Retrieval pipeline → Metadata tagging: gets topic suggestions
precisionrag/retriever.py - Cited answers → Groq API: generates answer
README.md - Corpus indexing → Corpus preparation: prepares passages
scripts/build_index.py - Corpus indexing → Text encoders: creates vectors
scripts/build_index.py - Corpus indexing → Qdrant store: writes index
scripts/build_index.py - Qdrant store → Qdrant: reads and writes
precisionrag/store.py - Live updates → Text encoders: re-embeds documents
precisionrag/updates.py - Live updates → Qdrant store: upserts and deletes
precisionrag/updates.py - Live updates → Metadata tagging: assigns metadata
precisionrag/updates.py - Live updates → Version history: records versions
precisionrag/updates.py - Metadata tagging → Text encoders: uses dense vectors
precisionrag/tags.py - IR evaluation → Retrieval pipeline: evaluates modes
scripts/eval_ir.py - IR evaluation → Retrieval metrics: computes scores
scripts/eval_ir.py - IR evaluation → Measurement files: saves measurements
scripts/eval_ir.py - Dashboard data → Measurement files: reads measurements
precisionrag/dashboard.py - FastAPI service → Runtime settings: loads settings
api/main.py - Retrieval pipeline → Runtime settings: loads profiles
precisionrag/retriever.py