TabeebAI is a clinical decision support system designed to assist healthcare providers in performing rapid, structured patient triage in both Urdu and English.
- Bilingual Input Handling — accepts patient statements in Urdu or English, through text or audio, with automatic language detection.
- Speech Transcription — converts recorded or uploaded patient audio into text using Whisper Large V3 Turbo.
- Automatic Translation — Urdu input is translated into clinical English before downstream processing, while preserving medical meaning.
- Query Classification — every statement is classified as medical, non medical, or a mental health crisis before triage continues, with crisis cases routed directly to support resources.
- Structured Symptom Extraction — extracts chief complaint, individual symptoms, severity, duration, and urgency level in a strict JSON schema.
- Risk Scoring Engine — a deterministic scoring model combines urgency level, symptom severity, emergency keyword detection, and symptom count into a 0 to 100 risk score, mapped to Green, Yellow, or Red triage levels.
- Disease Symptom Matching — extracted symptoms are matched against a structured disease symptom dataset to surface statistically likely conditions.
- Retrieval Augmented Knowledge — a sentence embedding model retrieves the most relevant medical reference passages to ground the generated report in factual context.
- SOAP Report Generation — produces a complete Subjective, Objective, Assessment, and Plan report formatted for clinical use.
- Human in the Loop Review — physicians can edit, confirm, and sign off on generated reports before they are finalized or downloaded.
- Multi Dashboard Interface — separate views for patients, doctors, and developers, each tailored to its audience.
- Pipeline Observability — full visibility into stage by stage execution time, retrieved knowledge chunks, disease matches, and model usage for debugging and audit purposes.
- Patient input is received as typed text or recorded or uploaded audio.
- If audio is provided, it is transcribed using Whisper and the resulting language is detected.
- If the input is Urdu, it is translated into English using a Groq hosted LLaMA model.
- The translated statement is classified as medical, non medical, or crisis.
- Medical statements proceed to structured symptom extraction in JSON format.
- A deterministic risk score and triage level are computed from the extracted data.
- Extracted symptoms are matched against a disease symptom dataset to identify probable conditions.
- Relevant medical knowledge passages are retrieved using sentence embedding similarity search.
- A SOAP formatted clinical report is generated using the extracted data and retrieved context.
- The report is presented to the physician for review, editing, and confirmation before being finalized.
Patient Dashboard
Presents a simplified summary of the triage outcome, including risk level, identified symptoms, chief complaint, and clear next step instructions written for a non clinical audience.
Doctor Dashboard
Provides the full clinical picture, including the SOAP report with editing and sign off controls, detailed symptom breakdown, disease matching results, and retrieved reference knowledge.
Developer Dashboard
Exposes pipeline execution status, stage by stage timing breakdowns, raw JSON output, retrieval debug information, and the specific models used at each stage of the pipeline.
Risk is calculated using a weighted, rule based model rather than a black box prediction, which keeps the scoring transparent and auditable.
- Base score is assigned according to extracted urgency level.
- Additional points are added based on the severity of each reported symptom.
- A fixed bonus is applied if known emergency keywords are detected in either English or Urdu.
- A small additional weight is applied based on total symptom count.
- The final score is capped at 100 and mapped to a Green, Yellow, or Red triage category.
| Layer | Technology |
|---|---|
| Frontend and Application Framework | Streamlit |
| Language Model Inference | Groq API, LLaMA 3.3 70B Versatile, LLaMA 3.1 8B Instant |
| Speech Transcription | Whisper Large V3 Turbo |
| Embeddings and Retrieval | Sentence Transformers, all MiniLM L6 v2 |
| Data Processing | Pandas, NumPy |
| Core Language | Python |
| Deployment | Streamlit Community Cloud |
tabeeb/ ├── app.py Main Streamlit application and pipeline logic ├── data/ │ ├── diseases_symptoms.csv Disease and symptom reference dataset │ └── medical_knowledge.json Knowledge base used for retrieval augmented generation ├── assets/ │ ├── logo.png Application logo │ └── agahi_logo.png Organization logo └── README.md Project documentation
Clone the repository.
git clone https://github.com/hamaylzahid/tabeeb.git cd tabeeb
Create and activate a virtual environment.
python -m venv venv venv\Scripts\activate for Windows source venv/bin/activate for macOS or Linux
Install the required dependencies.
pip install -r requirements.txt
Set the Groq API key as an environment variable.
export GROQ_API_KEY=your_api_key_here for macOS or Linux set GROQ_API_KEY=your_api_key_here for Windows
Run the application.
streamlit run app.py
- Open the application in a browser using the local or deployed URL.
- Select Text Input or Audio Input from the sidebar.
- Enter patient symptoms in Urdu or English, or record or upload a voice statement.
- Click Analyze to run the full triage pipeline.
- Review the risk level, generated SOAP report, and recommended next steps in the relevant dashboard.
- Doctors may edit and confirm the SOAP report before downloading it in text or markdown format.
TabeebAI is a clinical decision support tool. It is not a diagnostic system and must not be used as a substitute for professional medical judgment. All AI generated outputs, including risk scores and SOAP reports, must be reviewed and approved by a licensed healthcare professional before being used for any clinical decision. In cases of suspected medical emergency, contact local emergency services immediately.
This project is released under the MIT License. See the LICENSE file in the repository for full terms.
