How aravind13115/medrag-chatbot works
Medical RAG chatbot for educational, evidence-based answers, including surgical consultation and medication information. The principal flow is a user question through the chat API and retrieval/generation to a cited response; the documented interface also exposes emergency handling and specialty selection. The repository contains overlapping Python and Node services and a separate MedRAG pipeline/UI. The graph shows documented capabilities and source-index relationships; several connections to unsampled route and frontend code are omitted rather than assumed.
Main entry points: rag_pipeline.py RAG pipeline · App.jsx Web application · chat.py Chat endpoint · index.py API entry
Components 18
User experience
- Web application
src/App.jsx - Chat interface
src/pages/Chat.jsx - Evidence view
src/pages/EvidencePage.jsx - Formulary view
src/pages/Formulary.jsx
Medical API
- API entry
api/index.py - Chat endpoint
api/chat.py
RAG and evidence
- RAG pipeline
api/rag_pipeline.py - Clinical knowledge
api/knowledge.py - Vector search
api/vector_store.py - Site search
api/site_search.py - Result reranking
api/reranker.py - Answer generation
medrag/generation/generator.py
Clinical capabilities
- Intent classification
api/medical_intent_classifier.py - Medical entities
api/medical_entity_extractor.py - Safety checks
api/safety_layer.py - Surgical procedures
api/neurosurgery.py - Medication information
api/fda.py
Other components
- User
Connections 18
- User → Web application: uses
- Web application → Chat interface: routes to
src/App.jsx - Chat interface → Chat endpoint: submits question
- User → Chat endpoint: posts question
- API entry → Chat endpoint: imports
api/index.py - Chat endpoint → RAG pipeline: uses
api/rag_pipeline.py - RAG pipeline → Intent classification: classifies
api/rag_pipeline.py - RAG pipeline → Medical entities: extracts
api/rag_pipeline.py - RAG pipeline → Safety checks: checks safety
api/rag_pipeline.py - RAG pipeline → Clinical knowledge: retrieves from
api/rag_pipeline.py - Clinical knowledge → Vector search: searches
api/knowledge.py - RAG pipeline → Site search: adds context
api/rag_pipeline.py - RAG pipeline → Result reranking: reranks
api/rag_pipeline.py - RAG pipeline → Answer generation: generates answer
- Web application → Evidence view: routes to
src/App.jsx - Web application → Formulary view: routes to
src/App.jsx - API entry → Surgical procedures: imports
api/index.py - API entry → Medication information: imports
api/index.py