How karthikrishna05/kidneystone-rag-genai-system works
VruCare is a Streamlit chatbot for sourced kidney-stone information. A user submits a question through the chat UI; the app loads the RAG pipeline, which can reformulate follow-ups using chat history, retrieve medical passages through FAISS and BM25, fuse rankings with RRF, and stream a guarded answer from an OpenRouter model. The knowledge base is built from PDFs into text chunks, a FAISS index, and data for keyword retrieval. The README also describes safety, conversational context, and streaming; the graph follows the sampled app and pipeline for implementation links.
Main entry points: app.py Streamlit chat · rag_pipeline.py Pipeline loader · vectorizer.py PDF ingestion · data Medical PDFs
Components 16
Chat interface
- Streamlit chat
src/app.py - Chat history
src/app.py
Knowledge base
- Medical PDFs
data - PDF ingestion
src/vectorizer.py - Text chunks
src/vectorizer.py - FAISS index
src/vectorizer.py
Retrieval
- Pipeline loader
src/rag_pipeline.py - Semantic search
src/rag_pipeline.py - Keyword search
src/rag_pipeline.py - RRF fusion
src/rag_pipeline.py - Follow-up reformulation
src/rag_pipeline.py - Retrieval chain
src/rag_pipeline.py
Answer generation
- Safety prompt
src/rag_pipeline.py - Streamed answer
src/app.py
Other components
- User
- OpenRouter model
Connections 23
- User → Streamlit chat: asks
src/app.py - Streamlit chat → Chat history: reads history
src/app.py - Streamlit chat → Pipeline loader: loads pipeline
src/app.py - Streamlit chat → Retrieval chain: streams query
src/app.py - Streamlit chat → PDF ingestion: builds if absent
src/app.py - Medical PDFs → PDF ingestion: loads PDFs
src/vectorizer.py - PDF ingestion → Text chunks: writes chunks
src/vectorizer.py - PDF ingestion → FAISS index: builds index
src/vectorizer.py - Pipeline loader → Text chunks: loads chunks
src/rag_pipeline.py - Pipeline loader → FAISS index: loads index
src/rag_pipeline.py - Pipeline loader → Semantic search: sets up
src/rag_pipeline.py - Pipeline loader → Keyword search: sets up
src/rag_pipeline.py - Semantic search → RRF fusion: ranks passages
src/rag_pipeline.py - Keyword search → RRF fusion: ranks passages
src/rag_pipeline.py - Pipeline loader → Follow-up reformulation: configures
src/rag_pipeline.py - Follow-up reformulation → Retrieval chain: provides retriever
src/rag_pipeline.py - RRF fusion → Retrieval chain: provides passages
src/rag_pipeline.py - Retrieval chain → Safety prompt: supplies context
src/rag_pipeline.py - Safety prompt → OpenRouter model: prompts model
src/rag_pipeline.py - Retrieval chain → OpenRouter model: calls model
src/rag_pipeline.py - Retrieval chain → Streamed answer: streams answer
src/app.py - Streamed answer → User: displays answer
src/app.py - Streamlit chat → Chat history: stores exchange
src/app.py