Ydhya : AI-Powered Triage for India's District Hospitals
"Empowering district doctors with elite intelligence, because quality triage shouldn't depend on geography."
The Problem: A System Designed to Fail the People It Serves
Imagine you're a Doctor who is 28 years old, three years out of MBBS, posted as Junior Medical Officer at a government district hospital. You see over 100 patients a day. There is no triage system. There is no specialist backup. When a patient walks in with chest pain, breathlessness, or sudden confusion, the decision of how urgently to treat them and whether to refer them falls entirely on you, in the next two minutes, alone.
This is not an edge case. This is the daily reality for thousands of doctors across India's 25,000+ Primary Health Centres and Community Health Centres.
The structural numbers are stark:
- 1:11,082 - India's rural doctor-to-patient ratio. Clinical exhaustion leads to critical oversight.
- 70% of specialist positions in rural Community Health Centres are currently vacant.
- 50–100 km - the distance patients travel to reach a hospital, only to risk being triaged incorrectly and sent back in critical condition.
But the more damning numbers are about what happens when triage goes wrong:
- Manual triage is accurate only ~69% of the time leaving nearly one in three patients at risk of misclassification.
- Classifying a severe patient as low-risk accounts for nearly half of all trauma deaths in emergency departments.
- Elderly patients and those with vague or subjective symptoms are systematically under-triaged, the patients least able to advocate for themselves receive the least accurate assessments.
The deadliest failures are the quiet ones. An elderly diabetic woman presenting with fatigue and vague discomfort gets sent home. She returns two days later in cardiogenic shock. The presentation was atypical for MI but a cardiologist would have flagged it immediately. There was no cardiologist available.
This is the problem Ydhya was built to solve.
What Ydhya Does
Ydhya is a multi-agent AI triage system that gives every district hospital access to a panel of six medical specialists simultaneously in real time, before a single referral decision is made.
The insight behind Ydhya is simple: the gap in rural triage quality isn't a lack of intelligence or commitment from frontline doctors. It's a structural absence of specialist input. A cardiologist and a general physician will triage the same chest-pain patient differently. Neither is wrong but only one perspective is available at a time. Ydhya fixes this by making all six perspectives available simultaneously, every time, for every patient.
Three capabilities define Ydhya:
Multi-Agent Specialist Council Architecture. Six AI specialists - Cardiology, Neurology, Pulmonology, Emergency Medicine, General Medicine, and Other Speciality will evaluate every patient in parallel. A CMO (Chief Medical Officer) agent then synthesizes their findings into one final, actionable verdict. The architecture is a hybrid neuro-symbolic system: XGBoost ML handles risk classification (deterministic, auditable, zero hallucination risk), while Gemini-powered LLMs handle specialist reasoning and meta-synthesis. ML classifies. LLMs reason. The combination eliminates the hallucination risk that pure LLM approaches carry in clinical settings.
Completes the Entire Triage in Seconds. The full pipeline - intake, classification, six specialist opinions, CMO verdict - streams live to the doctor's screen via Server-Sent Events. What previously took two minutes of guesswork is replaced by a 10–15 second evidence-based assessment. A risk-based priority queue replaces first-come-first-served. Urgent patients surface to the top automatically.
WhatsApp Native. In low-connectivity rural India, not every referral pathway starts with a browser. A clinician sends patient symptoms via WhatsApp - including uploaded PDFs of EHR documents and receives a full triage result in the same thread. The same pipeline runs; only the interface changes. Works on any phone, zero adoption friction.
How It Works: The Four-Stage Pipeline
Patient Input (Form / WhatsApp)
│
▼
POST /api/triage ──► FastAPI Backend
│
▼
SSE Stream ◄── Google ADK Multi-Agent Pipeline
│
├── [1] IngestAgent (parse, normalize, extract docs)
├── [2] ClassificationAgent (XGBoost risk prediction + SHAP)
├── [3] SpecialistCouncil (6 agents, parallel execution)
│ ├── CardiologyAgent
│ ├── NeurologyAgent
│ ├── PulmonologyAgent
│ ├── EmergencyMedicineAgent
│ ├── GeneralMedicineAgent
│ └── OtherSpecialtyAgent
└── [4] CMOAgent (synthesize, resolve conflicts, final verdict)
│
▼
Final Triage Report
(Risk Level + Priority Score + Department Routing
+ Safety Alerts + Workup Plan)
Stage 1 - IngestAgent: Turning Chaos Into Contract
District hospital intake data is messy. BP is written as "155/95" or "155 over 95." Temperature arrives in Celsius. Symptoms are free-text. Conditions are abbreviations. IngestAgent is a Gemini-powered LLM agent whose single responsibility is converting unstructured intake whether from a web form or a WhatsApp message with an attached EHR PDF into a validated StructuredPatientData Pydantic schema. Everything downstream reads from this clean contract, never from raw input.
Stage 2 - ClassificationAgent: No LLM, No Hallucinations
Risk classification is the one step in the triage pipeline where a hallucination could kill someone. Ydhya's response to this constraint is categorical: ClassificationAgent contains zero LLM calls. It loads a trained XGBoost model, constructs a feature vector from the structured patient data with schema-consistent column ordering, and returns a risk label (LOW / MEDIUM / HIGH), a probability distribution across all three classes, and SHAP-based feature attributions explaining which vitals and symptoms drove the prediction.
The model achieves 94.65% accuracy and an F1 score of 0.9467 across 2,000 test cases, with HIGH-risk precision of 0.93 and LOW-risk precision of 0.98. SpO₂, age, chest pain, and heart rate are the top predictive features per SHAP analysis.
Stage 3 - SpecialistCouncil: Six Experts, Zero Wait
Six specialist agents execute in parallel via Google ADK's ParallelAgent. Each agent receives the full structured patient data and the ML classification result, and must return a Pydantic-typed SpecialistOutput - relevance score (0–10), urgency score (0–10), confidence level, primary differential diagnoses, clinical flags (RED_FLAG / WARNING / INFO), and ordered workup recommendations. ADK enforces schema compliance at the framework level: the LLM either produces a valid schema or the call fails. This eliminates field drift and hallucinated outputs across the council.
Stage 4 - CMOAgent: Where Safety Lives
The CMO is the meta-reasoning layer. It receives all six typed specialist outputs and synthesizes them into a single CMOVerdict resolving departmental conflicts by relevance and urgency scores, implementing the worst-case principle (any specialist RED_FLAG triggers escalation consideration), and producing a plain-language explanation written for junior doctors. The CMO can override the ML risk classification upward or downward, but must document the reason. It explicitly avoids averaging conflicting signals missing a high-risk patient is treated as categorically worse than an unnecessary referral, matching the clinical ethics of triage.
From Guesswork to Evidence: The Impact
| Metric | Traditional Way | With Ydhya |
|---|---|---|
| Triage time per patient | ~2 minutes | 10–15 seconds |
| Under-triage risk | High (gut feeling) | Safety net catches edge cases |
| Specialist input | Zero | 6 AI specialists per patient |
| Patient prioritization | First-come-first-served | Risk-based priority queue |
| Referral accuracy | Blind guesswork | Department-routed with reasoning |
Ydhya doesn't replace clinical judgment. It gives that judgment the specialist backing it never had access to.
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite, Material UI, Recharts, Zustand, MUI DataGrid |
| Backend | Python, FastAPI, Google ADK (Agent Development Kit) |
| ML Model | XGBoost classifier + SHAP explainability (94.65% accuracy) |
| LLM | Google Gemini (via ADK) |
| Streaming | Server-Sent Events (SSE) |
| Integration | Twilio (WhatsApp + EHR PDF parsing) |
Challenges We Ran Into
Structured Outputs Across Six Parallel LLM Agents. Early versions of the specialist agents returned free-text responses. The CMO had to parse unstructured opinions from six agents and parsing hallucinations in a medical context is unacceptable. We resolved this by designing the SpecialistOutput Pydantic schema as a universal contract and binding every specialist agent to it via ADK's output_schema. ADK enforces schema compliance at the framework level, eliminating field drift entirely.
CMO Safety - Worst-Case Principle vs. LLM Tendency to Compromise. LLMs have a natural tendency to average out conflicting signals. When one specialist raised a RED_FLAG and four others were low-urgency, the CMO would often understate the danger - exactly backwards from how a responsible CMO should behave. We rewrote the CMO prompt to explicitly encode the worst-case principle and treat a missed high-risk case as categorically worse than an unnecessary referral.
SSE Streaming With Async Google ADK Events. Google ADK's async event model produces events with varying structure and author attribution. We built a custom SSE handler in FastAPI that inspects each ADK event's author field and content structure to classify it into the correct typed SSE event before forwarding - letting the React frontend populate specialist cards one by one as each parallel agent finishes, rather than waiting for all six.
XGBoost Feature Schema Consistency. If any feature was missing, named differently, or in the wrong column order at inference time, predictions were silently wrong - no error, just garbage output. We hard-coded ALL_SYMPTOMS and ALL_CONDITIONS as ordered lists in the ClassificationAgent and built the DataFrame row explicitly, ensuring the inference schema exactly matches the training schema.
What We're Proud Of
- A complete 4-stage pipeline from unstructured intake to CMO verdict, end-to-end, built during a hackathon
- Six parallel specialists with consistent Pydantic-typed outputs and zero schema drift
- A hybrid ML + LLM architecture where the highest-stakes decision uses deterministic XGBoost with zero hallucination risk
- Real-time streaming UI that makes the AI's reasoning transparent to the clinician - not just the conclusion
- WhatsApp integration that brings the same triage pipeline to clinicians without reliable internet or a desktop
- A user persona grounded in a real survey call made to a medical officer during the ideation phase
What We Learned
Hybrid ML + LLM beats pure LLM for clinical applications. Determinism matters when the output influences a treatment decision. XGBoost gives reproducible, auditable predictions. LLMs handle the reasoning tasks where structured uncertainty is less critical.
Pydantic is the backbone of reliable multi-agent systems. Without schema enforcement at agent boundaries, multi-agent pipelines accumulate hallucination errors across stages. Each Pydantic schema is a contract — and contracts are what make complex systems trustworthy.
Streaming is not just UX, it is clinical transparency. A triage dashboard that shows only a final verdict is a black box. A dashboard that shows each specialist arriving at their conclusion in real time is a reasoning partner. The SSE architecture was a trust feature, not a performance feature.
What's Next
Phase 1 (0–6 months): Swap Gemini for MedGemma for medically-trained reasoning. Add multilingual support : Hindi, Tamil, Telugu for real adoption. Train XGBoost on real hospital EHR data.
Phase 2 (6–12 months): Expand the specialist panel to 10+ specialties including Orthopaedics, ENT, Dermatology, Paediatrics, and OB-GYN. Add voice input for low-literacy health workers. Integrate wearables to auto-pull vitals from pulse oximeters and BP monitors.
Phase 3 (1–2 years): District-wide networks connecting multiple hospitals sharing one triage brain. Outbreak detection flagging unusual symptom clusters across regions automatically. And ultimately: India's national triage layer every district hospital, every CHC, one standard of care.
Ydhya is not trying to replace the doctor. It is trying to make sure that every doctor in every district hospital has the same specialist council at their side that a city hospital doctor takes for granted because quality triage shouldn't depend on geography.
Log in or sign up for Devpost to join the conversation.