Title
SURGICAL — AI That Learns to Triage Emergency Patients Under Pressure
Tagline
A clinical-triage copilot that watches a patient walk in, decides the next critical action, and explains itself — in real time.
Category
AI for Health (primary) · also eligible for Best Use of ML, Most Impactful, Most Innovative
The Problem
Every minute in an emergency department is a race against biology.
- A STEMI patient needs a cath lab within 90 minutes (door-to-balloon). Each 30-minute delay raises mortality.
- Sepsis must get antibiotics inside the 3-hour bundle. Delay is measured in organ failure.
- Stroke needs a CT within 25 minutes to even be eligible for thrombectomy.
- Emergency departments are overcrowded and understaffed. A single mass-casualty event can drop five critical patients on a team built for one.
When the load spikes, protocols break — and patients are lost. Triage is where those minutes are won or lost, and it is exactly where decision-making degrades under pressure.
The Solution
SURGICAL is a clinical-triage copilot trained in a high-fidelity emergency-medicine simulator. It watches a patient arrive, reads live vitals, and picks the next critical action — EKG? Cath lab? Antibiotics? ESI level? — then executes it and explains its reasoning.
Try it: open the live demo, pick a scenario, and hit RUN AI AGENT. You'll watch the copilot:
- Assess the patient's vitals
- Diagnose with the right test at the right time (EKG, lactate, D-dimer, CT…)
- Prioritize with real ESI triage levels
- Treat via clinical pathways and medications (cath lab, stroke code, ceftriaxone…)
- Dispose safely (ICU, telemetry, PICU escalation)
Every action is scored against a dense clinical reward signal — protocol timing, triage accuracy, disposition safety — and the final grade is compared against a clinical baseline per scenario.
Key Features
- AI copilot with a visible brain. An interactive decision-flow graph lights up node-by-node (ASSESS → DIAGNOSE → PRIORITIZE → TREAT → DISPOSE) as the agent acts, with a human-readable rationale on every step — the same discipline we'd demand of any AI given clinical responsibility.
- Live reward telemetry. A real-time chart streams the reward signal per action, plus live vitals for the patient on board.
- LLM-driven policies. The copilot's reasoning is generated by a frontier open LLM (DeepSeek-V3.2 on Featherless.ai, serverless, with Google Gemini as a fallback provider), then guarded by a deterministic clinical policy layer — the model proposes, the guardrails guarantee, the clinician decides. Result: AI reasoning in every step, zero API keys required, and a demo that never breaks for judges.
- Six clinical scenarios, each scored against a protocol baseline: STEMI Code, Chest Pain Workup, Mass Casualty Surge, Sepsis Alert, Stroke Code, Pediatric Respiratory.
- Dual mode. Let the AI triage, or take the wheel yourself in Manual mode and see if you can beat the baseline.
- Real-time collaboration. WebSocket-driven dashboard; every step is broadcast live.
Design Principles
SURGICAL was built around three convictions that shaped every engineering choice:
- Where AI genuinely helps, and where it must stop. A language model is good at knowing which test belongs to which clinical picture — it is not to be trusted with irreversible decisions on its own. So the copilot proposes, and a deterministic clinical policy layer guarantees the outcome. The AI improves consistency and surfaces risk earlier; the human keeps final judgment.
- An AI that can't be audited has no business near a patient. Every action carries a scored reward, a timestamp, and a plain-language rationale — a complete, replayable transcript of why each decision was made. In safety-critical settings, explainability isn't a feature, it's the license to operate.
- Reliability is a feature, not an afterthought. No API keys, no flaky model calls, no mid-demo failures. If the model is unavailable, the copilot still runs, still finishes, still explains — because a tool that fails under pressure is worse than no tool at all.
How We Built It
- Environment engine (Python 3.11): a Pydantic-typed clinical simulator with 6 tasks, dense shaped rewards, vitals deterioration, and deterministic per-task graders (0.0–1.0).
- Agent: deterministic evidence-based clinical policies for every scenario (STEMI, sepsis bundle, stroke door-to-CT, MCI ESI triage, pediatric escalation) with an OpenAI-compatible LLM layer that prefers Featherless DeepSeek-V3.2, then Gemini, and falls back gracefully — the LLM proposes actions, clinical guardrails guarantee protocol completion.
- API (FastAPI):
POST /run-agentruns a full autonomous episode (LLM-led steps capped for latency) and returns a step-by-step transcript;POST /reset,POST /step,GET /state,GET /scenariosfor the full REST agent loop; WebSockets for live broadcast. - Dashboard (vanilla JS + GSAP): brutalist clinical UI with scroll-driven animations, an ECG heartbeat hero, interactive decision nodes, and live telemetry — served as a self-contained page.
- Deployment: Docker on Hugging Face Spaces, fully live.
- Quality: 51/51 tests passing; the agent beats the clinical baseline on all 6 scenarios (0.99 on sepsis & stroke, 0.80–0.85 on cardiac).
Technology
Python · FastAPI · WebSockets · Pydantic · OpenAI SDK · Featherless.ai (DeepSeek-V3.2) · Google Gemini API · GSAP · Docker · Hugging Face Spaces · pytest
Target Users
Emergency clinicians in training, ED operations teams, and medical-education platforms — anyone who needs a safe, fast, and honest way to rehearse the highest-pressure triage decisions before they happen for real.
Real-World Impact
- Training, not guessing. Practicing ESI triage, sepsis bundles, and stroke pathways on real patients is not an option. SURGICAL lets humans and AI rehearse thousands of high-stakes decisions with zero patient risk.
- Stress-testing protocol adherence. It exposes where decision-making breaks under load (mass casualty, ambiguous chest pain) — the exact failure modes that cost lives, rehearsed until they stop being failure modes.
- A foundation for safety-critical healthcare AI. Every action is scored, timestamped, and explained in plain language — a complete, auditable record of every decision. That accountability, not raw model accuracy, is what earns a license to operate near a
Built With
- agents
- ai
- api
- clinical
- deepseek
- fastapi
- featherless.ai
- gsap
- healthcare
- healthtech
- javascript
- machine-learning
- pydantic
- pytest
- python
- reinforcement
- rest
- sdk
- websockets


Log in or sign up for Devpost to join the conversation.