How abdelrahmanmostafa33/healthcare-rag-assistant works
Healthcare RAG Assistant is an education-only web/API product: a user submits a health question, the shared pipeline applies safety and evidence checks, searches local health-source passages, then generates a cited answer or abstains. Supporting branches build and calibrate the local knowledge base and evaluate retrieval, answers, citations, and safety behavior. The excerpts show core runtime calls; the README documents major capabilities such as source ingestion and evaluation that are not fully sampled. The UI-to-API wiring and some pipeline details are not shown, so uncertain links are omitted.
Main entry points: pipeline.py RAG pipeline · provider_clients.py Provider client setup · evaluation.py RAG evaluation · safety_check.py Safety triage
Components 22
User experience
- Web interface
frontend - Web API
app.py
Question answering
- RAG pipeline
src/pipeline.py - Local safety rules
src/safety.py - Safety triage
src/safety_check.py - Search and rerank
src/retriever.py - Grounded generation
src/generator.py
Knowledge and calibration
- Evidence calibration
src/calibration.py - Source processing and indexing
src/kb.py - Local search index
data/index - Calibrated cutoff
data/index
Evaluation and providers
- RAG evaluation
src/evaluation.py - Quality metrics
src/metrics.py - Evaluation questions
data/eval
Shared runtime
- Provider client setup
src/provider_clients.py - Runtime configuration
src/config.py - Request deadline
src/deadline.py - Provider retries
src/retry.py
Other components
- Question asker
- Health-source material
- Gemini services
- LLM judge providers
Connections 24
- Question asker → Web interface: asks
README.md - Web API → RAG pipeline: runs
app.py - RAG pipeline → Local safety rules: checks rules
src/pipeline.py - RAG pipeline → Safety triage: triages unmatched
src/pipeline.py - RAG pipeline → Search and rerank: retrieves passages
src/pipeline.py - RAG pipeline → Grounded generation: generates answer
README.md - Search and rerank → Source processing and indexing: loads index
src/retriever.py - Source processing and indexing → Local search index: builds and loads
README.md - Health-source material → Source processing and indexing: provides source text
README.md - Evidence calibration → Search and rerank: scores questions
src/calibration.py - Evidence calibration → Calibrated cutoff: saves cutoff
README.md - Runtime configuration → Calibrated cutoff: validates cutoff
src/config.py - RAG pipeline → Runtime configuration: checks calibration
src/pipeline.py - RAG pipeline → Request deadline: checks budget
src/pipeline.py - Grounded generation → Provider client setup: creates client
src/generator.py - Safety triage → Provider client setup: creates client
src/safety_check.py - Grounded generation → Provider retries: retries failures
src/generator.py - Safety triage → Provider retries: retries failures
src/safety_check.py - Provider client setup → Gemini services: connects
src/provider_clients.py - RAG evaluation → RAG pipeline: evaluates behavior
src/evaluation.py - RAG evaluation → Quality metrics: computes scores
src/metrics.py - Evaluation questions → RAG evaluation: supplies questions
README.md - RAG evaluation → Provider client setup: creates judge client
src/evaluation.py - Provider client setup → LLM judge providers: connects optionally
src/provider_clients.py