DEV Community

Dhruv Jain
Dhruv Jain

Posted on

Two-stage AI triage: Claude on Bedrock plus a conformal ML ensemble, on DynamoDB and Vercel

Solace assigns an emergency-department acuity level (ESI) from a patient's own words and then refines it at the bedside. I wanted a model that helps a clinician without ever pretending to make the call. Here is how the triage brain works, and how it sits on DynamoDB and Vercel.

Stage one: narrative ESI on intake

A patient describes what is wrong by voice or text, in any of 20+ languages (speech runs through Amazon Transcribe and Polly). Amazon Bedrock (Claude) reads that narrative and produces a provisional ESI before any vitals exist. This is what powers the calm spoken result the patient hears and the first sort of the live clinician queue.

Everything runs inside AWS managed services covered by the Business Associate Agreement, so patient text never leaves the BAA boundary.

Stage two: refinement at the bedside

When vitals are entered, a stacked ensemble (LightGBM, XGBoost, CatBoost, and an MLP) refines the ESI. Two things make it usable in a real department:

  • SHAP attributions, so a clinician sees which features drove the score instead of a black-box number.
  • Split-conformal prediction sets, so the model can say "I am not sure" with a real coverage guarantee rather than a fake confidence percentage.

A deterministic safety floor sits on top: the system never down-triages a life threat, regardless of what the model thinks.

Where it lives

The refined ESI, the conformal set, and the top features are written back onto the patient record in DynamoDB, so the clinician cockpit reads a single, current source of truth in milliseconds. The cockpit and the patient app both deploy on Vercel and call the FastAPI-on-Lambda backend that fronts DynamoDB.

The model never overrides the clinician. It hands them a defensible starting point, shows its work, and gets out of the way.

I created this content for the purposes of entering the H0: Hack the Zero Stack hackathon. #H0Hackathon

Top comments (0)