How sudheera96/kidneycare-rag works
KidneyCare RAG turns a user's CKD question into a relevance-checked answer with retrieved source citations. At startup, the Gradio app initializes the RAG pipeline, which loads local documents, chunks them, and builds an in-memory semantic index. For questions, the pipeline classifies and expands the query, retrieves passages, checks whether the evidence is sufficient, generates and validates an answer, and formats sources for display. The README documents these capabilities; unsampled pipeline sections and evaluation wiring are represented only where the supplied source index or README supports them.
Main entry points: rag_pipeline.py RAG Pipeline · app.py App Initialization · vector_store.py Passage Retrieval · document_loader.py Document Loader
Components 15
User Interface
- Gradio Interface
src/app.py - App Initialization
src/app.py
Knowledge Preparation
- Local CKD Documents
data - Document Loader
src/document_loader.py - Text Chunker
src/chunker.py - Semantic Index
src/vector_store.py
Grounded Answering
- RAG Pipeline
src/rag_pipeline.py - Topic Classification
src/rag_pipeline.py - Query Expansion
src/rag_pipeline.py - Passage Retrieval
src/vector_store.py - Relevance Gate
src/rag_pipeline.py - Answer Generation
src/rag_pipeline.py - Answer And Sources
src/rag_pipeline.py
Evaluation
- Question Evaluation
evaluation/evaluate.py
Other components
- Questioner
Connections 17
- Questioner → Gradio Interface: asks
README.md - Gradio Interface → App Initialization: submits
src/app.py - App Initialization → RAG Pipeline: initializes
src/app.py - App Initialization → RAG Pipeline: forwards question
src/app.py - RAG Pipeline → Topic Classification: classifies
src/rag_pipeline.py - RAG Pipeline → Query Expansion: expands
src/rag_pipeline.py - Local CKD Documents → Document Loader: provides files
README.md - RAG Pipeline → Document Loader: loads documents
src/rag_pipeline.py - RAG Pipeline → Text Chunker: chunks documents
src/rag_pipeline.py - RAG Pipeline → Semantic Index: builds index
src/rag_pipeline.py - RAG Pipeline → Passage Retrieval: searches
src/rag_pipeline.py - Passage Retrieval → Semantic Index: searches index
src/vector_store.py - RAG Pipeline → Relevance Gate: checks relevance
src/rag_pipeline.py - RAG Pipeline → Answer Generation: generates answer
src/rag_pipeline.py - RAG Pipeline → Answer And Sources: formats response
src/rag_pipeline.py - Answer And Sources → Gradio Interface: returns answer and sources
src/app.py - Question Evaluation → RAG Pipeline: evaluates questions
evaluation/evaluate.py