Key Features
Sub-5s Response
Target latency: <5 seconds (vs. ~100s for full analysis)
ESI Triage Scoring
Emergency Severity Index (1-5) for acuity assignment
Top 3 Differentials
Focus on life-threatening diagnoses only
Red Flag Detection
Immediate danger signs and contraindications
How It Works
Architecture
Emergency Mode skips the debate layer entirely: What’s Bypassed:- ❌ PHI Anonymization (speed over privacy — use only in true emergencies)
- ❌ Multi-round debate (no Literature or Critic agents)
- ❌ PubMed searches (too slow for ER)
- ❌ Full SOAP synthesis
- ✅ Emergency Triage Agent (parallel)
- ✅ Quick Safety Check (parallel)
- ✅ ESI scoring
- ✅ Call-to-action directive
API Usage
Endpoint
Response Format
ESI Scoring
Emergency Severity Index (1-5)
The triage agent assigns an ESI score based on:| ESI | Acuity | Criteria | Example |
|---|---|---|---|
| 1 | Resuscitation | Immediate life-saving intervention needed | Cardiac arrest, active seizure, STEMI, stroke <4.5h |
| 2 | Emergent | High risk — confused/lethargic/severe pain, vital instability | Chest pain + troponin, sepsis, head injury LOC |
| 3 | Urgent | Multiple resources needed but stable vitals | Abdominal pain + imaging, pneumonia, cellulitis |
| 4 | Less Urgent | One resource needed | Sprain (X-ray only), UTI (UA only) |
| 5 | Non-Urgent | No resources needed | Prescription refill, chronic pain |
Implementation
The Emergency Triage Agent (backend/emergency/emergency.py:68) uses this prompt:
backend/agents/prompts/emergency_system.txt:17
Emergency Triage Agent
System Prompt Strategy
The agent prioritizes:- What kills fastest? (life-threat severity)
- What’s most likely? (given presentation)
- What can we act on NOW? (treatability)
- Prompt Excerpt
- LLM Config
backend/agents/prompts/emergency_system.txt:1
Quick Safety Check
Runs in parallel with triage to flag critical medication issues:backend/emergency/emergency.py:91
This is a lightweight check (not the full Safety Agent). It only flags contraindications that could affect immediate treatment (e.g., “Patient on warfarin — hold if considering thrombolytics”).
Performance Benchmarks
Latency Breakdown
| Component | Typical Time | Notes |
|---|---|---|
| Text parsing | ~50ms | Regex-based, no LLM |
| Emergency Triage Agent | 2-3s | GPT-4o JSON mode |
| Quick Safety Check | 1-2s | GPT-4o-mini, parallel |
| Total | 3-5s | vs. 100s for full analysis |
Smoke Test Results
Production Latency: 95th percentile is 4.2s (measured across 500 test cases).
Use Cases
Emergency Department Triage
Emergency Department Triage
Scenario: Paramedics radio in a case en route. Triage nurse enters symptoms into ClinicalPilot Emergency Mode.Output:
- ESI score → assigns triage priority
- Red flags → alerts trauma team if needed
- Call-to-action → prep instructions (“Activate stroke code”)
Telemedicine Urgent Care
Telemedicine Urgent Care
Scenario: Virtual urgent care physician sees a chest pain complaint. Needs immediate risk stratification.Output:
- Top differentials → ACS vs. MSK vs. GERD
- ESI 2-3 → determines if ER transfer needed
- Safety flags → checks if current meds interact with treatment plan
Pre-Hospital EMS
Pre-Hospital EMS
Scenario: Paramedic uses tablet app to get decision support en route.Output:
- Differentials → guides field treatment (e.g., aspirin, IV access)
- Red flags → alerts to contraindications (“Don’t give nitro if RV infarct suspected”)
- Call-to-action → directs to appropriate facility (STEMI center vs. community hospital)
Rapid Response Team
Rapid Response Team
Scenario: Floor nurse calls RRT for patient decompensation. Team needs instant assessment.Output:
- ESI 1-2 → determines if ICU transfer needed
- Differentials → narrows diagnosis quickly (sepsis vs. PE vs. MI)
- Safety flags → reviews current meds for interactions with emergency treatments
When NOT to Use Emergency Mode
For these cases, use the full analysis pipeline which includes:- Multi-round debate for accuracy
- PubMed citations
- Complete SOAP note
- PHI anonymization
- Medical error prevention panel
Best Practices
Include Vitals
ESI scoring heavily weighs vital signs. Always include BP, HR, RR, temp, SpO2 if available.
State Chief Complaint Clearly
Lead with the primary symptom (“chest pain”, “shortness of breath”, “altered mental status”).
Mention Red Flags
Explicitly note concerning features: “sudden onset”, “worst headache of life”, “asymmetric pupils”.
Add Key Labs
If available, include troponin, D-dimer, lactate, glucose — these heavily influence differentials.
Code Reference
Next Steps
Full Analysis
Multi-agent debate pipeline for complex cases
Human-in-the-Loop
Doctor feedback and re-analysis workflow