How sahil123goyal/medical_chatbot-vision-voice- works
This is a medical-education chatbot with text, image, and voice input. A user submits a question through the browser; the API optionally obtains an image observation, invokes the conversational agent, and returns an answer with PDF or web sources. The agent rewrites the query, retrieves book passages, decides whether current web results are needed, and generates a safety-guided response. Separate browser controls and API endpoints support speech transcription and playback. The excerpts show the main runtime wiring; the README provides no additional capability detail.
Main entry points: main.py FastAPI endpoints · knowledge.py Vector knowledge index · app.js Chat interface · agent.py Safe answer generation
Components 21
Browser interface
- Chat interface
static/app.js - Chat page
templates/index.html
API and media
- FastAPI endpoints
app/main.py - Image observation
app/main.py - Speech transcription
app/main.py - Speech synthesis
app/main.py - Runtime settings
app/config.py
Conversation agent
- Query rewrite
app/agent.py - Passage retrieval
app/agent.py - Source routing
app/agent.py - Web search
app/agent.py - Safe answer generation
app/agent.py
Knowledge and memory
- PDF ingestion
ingest.py - Medical reference PDF
data/Medical_book.pdf - Vector knowledge index
app/knowledge.py - Conversation checkpoint
app/agent.py
Other components
- User
- Groq AI services
- Pinecone
- Tavily search
- Sentence-transformers
Connections 30
- User → Chat interface: asks questions
static/app.js - Chat interface → FastAPI endpoints: sends chat
static/app.js - FastAPI endpoints → Chat interface: returns answer
static/app.js - FastAPI endpoints → Chat page: serves page
app/main.py - Chat interface → FastAPI endpoints: requests transcription
static/app.js - FastAPI endpoints → Speech transcription: handles audio
app/main.py - Speech transcription → Groq AI services: transcribes audio
app/main.py - Chat interface → FastAPI endpoints: requests playback
static/app.js - FastAPI endpoints → Speech synthesis: handles speech
app/main.py - Speech synthesis → Groq AI services: synthesizes speech
app/main.py - FastAPI endpoints → Image observation: inspects image
app/main.py - Image observation → Groq AI services: describes image
app/main.py - FastAPI endpoints → Query rewrite: invokes agent
app/main.py - Query rewrite → Passage retrieval: passes query
app/agent.py - Passage retrieval → Vector knowledge index: searches passages
app/agent.py - Passage retrieval → Source routing: passes results
app/agent.py - Source routing → Web search: dispatches if needed
app/agent.py - Source routing → Safe answer generation: dispatches directly
app/agent.py - Web search → Tavily search: searches web
app/agent.py - Web search → Safe answer generation: passes results
app/agent.py - Safe answer generation → Groq AI services: generates response
app/agent.py - Safe answer generation → Conversation checkpoint: checkpoints conversation
app/agent.py - PDF ingestion → Medical reference PDF: extracts pages
ingest.py - PDF ingestion → Vector knowledge index: upserts vectors
ingest.py - Vector knowledge index → Pinecone: queries and stores
app/knowledge.py - Vector knowledge index → Sentence-transformers: embeds query
app/knowledge.py - PDF ingestion → Vector knowledge index: requests embeddings
ingest.py - FastAPI endpoints → Runtime settings: reads configuration
app/main.py - Query rewrite → Runtime settings: reads model settings
app/agent.py - Vector knowledge index → Runtime settings: reads index settings
app/knowledge.py