An AI agent plays physician, gathering patient information sequentially via tool calls, forming diagnoses, reviewing clinical notes for errors, and planning treatment. This environment tests real-world diagnostic reasoning, not just medical knowledge recall.
Case Information
Phase 1
Gather patient info via tools
Phase 2
Review SOAP note for errors
Phase 3
Finalize care plan
1. Start Episode
2. Take Action
3. Check State
View current episode state including case progress, scores, and phase information.
Workflow: Gather patient info โ form differential โ confirm diagnosis
Available tools: chart.history, chart.vitals, chart.labs, chart.imaging, calculate, ddx.add, ddx.remove
Transition to Phase 2: Call ddx.confirm with {"diagnosis": "..."}
Workflow: Review SOAP note โ identify error โ correct it
Available tools: note.review, note.correct
Step 1: Call note.review with {} to see the note
Step 2: Call note.correct with {"sentence_id": "N", "correction": "..."}
Transition to Phase 3: Call note.flag_none with {}
Workflow: Finalize care plan โ end episode
Only tool: plan.finalize
Call: plan.finalize with {"plan": "..."} or {}
Result: Episode ends, episode reward calculated
๐ Patient Data (Phase 1)
- chart.history โ Patient HPI, PMH, meds
- chart.vitals โ Vital signs (BP, HR, temp)
- chart.labs โ Lab panels (BMP, CBC, ABG)
- chart.imaging โ Imaging reports (CXR, CT)
๐ฌ Clinical Analysis (Phase 1)
- calculate โ Run formulas (anion_gap, qsofa, Wells, etc)
- ddx.add โ Add diagnosis to differential
- ddx.remove โ Remove diagnosis
- ddx.confirm โ Confirm final diagnosis โ Phase 2
๐ Documentation & Planning (Phase 2-3)
- note.review โ View SOAP note (Phase 2)
- note.correct โ Fix error in note (Phase 2)
- note.flag_none โ Mark complete โ Phase 3
- plan.finalize โ Finalize care plan (Phase 3)
Phase 1 - Diagnosis (40%): Accuracy of ddx.confirm diagnosis (0.0-1.0 scale)
Phase 2 - Note Correction (25%): Identifying & fixing SOAP note error (0.0-1.0 scale)
Phase 3 - Calculations (20%): Accuracy of medical formulas used (ยฑ5% tolerance = 1.0)
Efficiency (15%): Avoiding unnecessary test calls (1.0 - redundant_tests ร 0.02)
Final Reward: Sum of (Phase 1 ร 0.40 + Phase 2 ร 0.25 + Phase 3 ร 0.20 + Efficiency ร 0.15) = 0.0 to 1.0
Base URL: https://pratinavseth-meddiagnostic-env.hf.space
POST /reset: Start new episode with task name
POST /step: Execute action and get reward + observation
GET /state: Get current episode state
See inference.py for complete agent integration example.
An AI agent plays physician, gathering patient information sequentially via tool calls, forming diagnoses, reviewing clinical notes for errors, and planning treatment. This environment tests real-world diagnostic reasoning.
README: Complete overview at root README.md
Demo Guide: Interactive demo examples in docs/DEMO.md
Evaluator Guide: API integration patterns in docs/EVALUATOR_GUIDE.md
Design Rationale: Technical design decisions in docs/DESIGN_RATIONALE.md