How swapnil04-debug/medical-rag-chatbot works
CareGuide is a Flask medical-information assistant. The main workflow is browser query → intent and query handling → knowledge retrieval → text answer, with session memory and a separate image-analysis route. The README documents these capabilities; the excerpts show parts of both Flask implementations, but do not expose every route or call, so documented relationships use README evidence and unsampled internals are not expanded.
Main entry points: app.py Request orchestration · index.html Chat and history UI · HospInfo.csv Hospital and medicine data · faiss_index.bin FAISS index
Components 17
Client
- Chat and history UI
templates/index.html - History viewer
templates/history.html
Flask Backend
- Request orchestration
app.py - Intent gates
app.py - Query preprocessing
app.py - Session memory and history
app.py - Answer generation
app.py - Image analysis
app.py - Alternate Flask implementation
app1.py
Knowledge and Memory
- RAG retrieval
app.py - Query embeddings
app.py - FAISS index
data/faiss_index.bin - Document store
data/doc_store.pkl - Hospital and medicine data
data/HospInfo.csv
External Services
- Groq text LLM
- Groq vision LLM
Other components
- Chat user
Connections 17
- Chat user → Chat and history UI: uses
README.md - Chat and history UI → Request orchestration: submits queries
README.md - History viewer → Request orchestration: requests history
README.md - Request orchestration → Intent gates: checks intent
README.md - Request orchestration → Query preprocessing: rewrites query
README.md - Request orchestration → RAG retrieval: retrieves context
README.md - RAG retrieval → Query embeddings: embeds query
app.py - RAG retrieval → FAISS index: searches index
README.md - RAG retrieval → Document store: reads chunks
README.md - Hospital and medicine data → FAISS index: builds offline
README.md - Hospital and medicine data → Document store: builds offline
README.md - Request orchestration → Answer generation: generates answer
README.md - Answer generation → Groq text LLM: prompts
README.md - Request orchestration → Session memory and history: uses session state
README.md - Request orchestration → Image analysis: routes image
README.md - Image analysis → Groq vision LLM: analyzes image
README.md - Request orchestration → Chat and history UI: returns answer
README.md