DoctorAI is a clinical‑grade cardiology support system powered by LLMs (Ollama / Llama 3), WHO 2025 guidelines, medical symptom mapping, OCR analysis, and intelligent emergency classification.
This is NOT a simple chatbot — it is a full medical AI framework with:
- Emergency detection (AHA/WHO compliant)
- Local medical database fusion
- WHO cardiology data integration
- Symptom-to-disease reasoning
- OCR support for ECG / reports
- Session memory + anonymized logging
- Streaming responses (ChatGPT-style)
It is designed for educational + research purposes only.
DoctorAI classifies user symptoms into:
- LEVEL 1 — EMERGENCY → “Call 108 / go to hospital NOW”
- LEVEL 2 — URGENT → Consult doctor within 24 hours
- LEVEL 3 — NON-URGENT → General guidance
Uses AHA 2025 + ESC 2024 approved symptom patterns.
Maps symptoms to possible diseases using symptom_disease_map.json.
Example:
'chest pain' → possible: Angina, MI, GERD
DoctorAI pulls data from:
cardio_faq.json(common questions)cardio_tips.json(verified health tips)clinics.json(local cardiology centers)who_cardiology_data.json(WHO medical data)
All relevant information is automatically merged into the LLM prompt.
If user uploads files like:
- ECG
- Cholesterol report
- Blood test
- Medical scan
DoctorAI extracts text using Tesseract OCR and includes it in analysis.
Responses are streamed chunk-by-chunk for smooth real-time conversation.
WHO 2025 AI Ethics built-in:
- No diagnosis
- No prescriptions
- Transparency
- User consent system
- Anonymized audit logs (HIPAA-like)
Every response ends with a mandatory disclaimer.
- Remembers last 5 user questions (only if consented)
- Full anonymized logs
- Smart caching for repeated queries
DoctorAI/
│── app.py # Main Flask server
│── uploads/ # User uploaded medical files
│── local_db/
│ ├── cardio_faq.json
│ ├── cardio_tips.json
│ ├── clinics.json
│ ├── symptom_disease_map.json
│ ├── ai_cache.json
│ └── session_memory.json
│
├── data_sources/
│ └── who_cardiology_data.json
│
└── index.html # Optional frontend UI
-
User sends message →
/chatendpoint -
System checks:
- Local DB matches
- WHO data
- Symptom patterns
- Emergency triggers
-
Builds a smart medical prompt
-
Passes to Ollama → streams response
-
Adds ethics disclaimer
-
Logs anonymized query
pip install flask flask-cors requests fuzzywuzzy python-Levenshtein pytesseract pillow
- Windows: https://github.com/UB-Mannheim/tesseract/wiki
- Linux:
sudo apt install tesseract-ocr
ollama pull llama3:8b
ollama serve
python app.py
Server runs at:
http://localhost:5000
Chat with DoctorAI.
{
"message": "I have chest pain radiating to my left arm"
}
Upload ECG / medical reports.
Health check.
DoctorAI is NOT a doctor. It provides educational guidance only. Always consult a certified cardiologist.
This is not just an LLM frontend. It is a complete medical intelligence pipeline:
- Risk classification
- Symptom inference
- WHO-level knowledge
- Real-time triage
- OCR medical analysis
- AI context merging
This puts the project in research + startup level domain.
Sanu Sharma — AI Engineer & Innovator
If you use this project, give credit to the original creator.
- Email: sanusharma0045.v@gmail.com