How archiecodespiece/saharachatbot works
Sahara is a Flask cancer-care chatbot intended to combine empathetic conversation with document-grounded answers, plus medical-image analysis and pharmacy discovery. The README describes the user-facing capabilities, but the Flask routes and chat orchestration were not excerpted, so their internal connections to retrieval, prompts, and optional features cannot be verified. The shown indexing code loads and chunks a PDF, creates embeddings, and writes to Pinecone; the image and pharmacy modules show their own model and service calls.
Main entry points: streindex.py Indexing workflow · chat.html Chat interface · imagedet.py YOLO image analysis · map.py Pharmacy recommendation
Components 18
Chat experience
- Chat interface
templates/chat.html - UI styling
static/style.css - Flask application
app.py - Care prompt
prompt.py
Document knowledge
- Cancer PDF
goku.pdf - PDF loading
src/modelenc.py - Text chunking
src/modelenc.py - Embedding generation
src/modelenc.py - Indexing workflow
streindex.py - Pinecone index
Image analysis
- Medical image
- YOLO image analysis
imagedet.py - YOLO weights
best.pt
Pharmacy discovery
- Pharmacy query
- Pharmacy recommendation
map.py - Nominatim search
Other components
- User
- Groq LLM
Connections 14
- User → Chat interface: uses
README.md - Chat interface → Flask application: chat request
- Chat interface → UI styling: styled by
- Cancer PDF → Indexing workflow: indexed from
streindex.py - Indexing workflow → PDF loading: loads
streindex.py - Indexing workflow → Text chunking: chunks
streindex.py - Indexing workflow → Embedding generation: creates
streindex.py - Indexing workflow → Pinecone index: writes documents
streindex.py - Medical image → YOLO image analysis: analyzed by
README.md - YOLO image analysis → YOLO weights: loads
imagedet.py - YOLO image analysis → Groq LLM: prompts
imagedet.py - Pharmacy query → Pharmacy recommendation: checked by
- Pharmacy recommendation → Groq LLM: classifies and formats
map.py - Pharmacy recommendation → Nominatim search: searches
map.py