Inspiration

On January 8, 2025, during the Eaton and Palisades fires, LA County Fire took 4,594 inbound 911 calls. In west Altadena, more than four hours passed between the first 911 call and the evacuation order. Hospitals get the same flood on a smaller scale: families looking for someone, people asking if the ER is open, people offering to help, and a few callers who are in real danger. At night, one house supervisor and maybe one other person are on the phones, and every call looks the same until someone picks up.

The hackathon prompt asked for the gentlest response that still works, somewhere between doing nothing and the "bang". For a hospital phone line the bang is either "everyone call 911" (the ER floods) or "everyone hold for a human" (the chest-pain caller waits behind 40 "is the ER open?" calls). We wanted something in between.

What it does

Night Ledger is an AI answering line that sorts hospital calls by urgency, and a board for the supervisor who has to decide what happens next.

Every caller hears that they're talking to an AI and can ask for a person. The agent asks three fixed red-flag questions (trouble breathing, chest pain, heavy bleeding and so on), then why they're calling. From there the call climbs a ladder:

  • Watch: every call is logged and grouped, so the supervisor sees "61 callers about the outage, 0 red flags" as one card instead of 61 calls.
  • Ask: AI disclosure, red-flag screen, reason for the call.
  • Slow: a supervisor-approved status message ("the ER is open on backup power") plus an SMS link.
  • Hold: routine callers get a promised callback window instead of hold music.
  • A person soon: family reunification, a child under 2, confused callers, mental health. A human calls these people back. The AI only takes their details.
  • Hand to a person: any red flag triggers a warm transfer to the on-duty nurse in under 10 seconds, with a Handoff Card showing who is calling, which red flags fired, the callback number and the transcript.

The rule that holds everything together: the AI can move a caller up the ladder but never down. Only a named person can lower a lane, and the reason goes in the log. Surge mode, status messages and calling in staff are always a supervisor click, and the board brings each decision with its evidence ("17 calls in 3 min, normal is about 1").

It's dual-use. On an ordinary Tuesday it's the after-hours line for an on-call nurse at a small hospital or clinic network. On the worst night of the year the same system is the surge line, with surge mode one switch away. Nothing new gets installed during the crisis.

How we built it

  • Voice agent: Retell AI, with one LLM state per rung. Edges between states only point up the ladder, and every state has a direct edge to "person soon" and "hand to a person". It runs on a speech-to-speech model (gpt-realtime), with a text-model fallback.
  • Classification: keyword rules set a floor (with per-clause negation, so "no, nobody has chest pain" doesn't fire), and TypeSafe Jev returns typed probabilities that can only raise a caller's lane, never lower it. The higher of the two wins.
  • Live monitor: a sidecar reads the transcript as the call happens. If a red flag shows up mid-question, it injects context into the live call so the agent moves to handoff right away.
  • Details: names and callback numbers are read back to the caller and confirmed against the actual transcript, not guessed from what the speech model thinks it heard. Capture never delays a red-flag transfer.
  • Backend: FastAPI + Postgres. It stores calls, transcripts, events and suggestions, and runs a supervisor engine every 15 s that proposes surge mode, status messages and staffing.
  • Board: Next.js 16, React 19, Tailwind, SWR. It shows lanes, clusters, Handoff Cards, analytics, a setup page for nurse lines, and demo controls that replay an earthquake or fire night.
  • Deploy: one Docker container on Render (Postgres + FastAPI serving the static board), seeded with a serious-earthquake scenario so judges can try it without a phone.

Challenges we ran into

  • Campus Wi-Fi blocked both cloudflared and ngrok, so Retell couldn't reach our webhooks. We wrote connect.sh to fall back to localtunnel and do tunnel, deploy, publish and phone-number setup in one step.
  • Speech-to-speech models only accept Retell's OpenAI preset voices. We found that out from a 400 error on the first deploy.
  • Phone numbers over a voice line are error-prone. Hearing digits is the hard part, and reading them back from text is reliable, so we built a capture-and-confirm loop instead of trusting the transcript.
  • Our first status-message threshold (40% of calls on one topic) never fired, because in a real surge callers spread over about nine topics. We dropped it to 30% after running the earthquake scenario.
  • Merging two backends late on Saturday night.

Accomplishments that we're proud of

  • A red-flag word anywhere in the call, even mid-sentence, goes straight to a nurse, and the AI has no way to talk a caller down a lane.
  • A red caller who didn't reach a nurse raises an alert that can't be snoozed or dismissed. Someone has to close it with what actually happened.
  • It's deployed and live: a real phone number, a real board, 33 backend tests running against their own database.

What we learned

Most of the safety work isn't in the model. It's in what the model isn't allowed to do: one-way lanes, human-only broadcasts, disclosure on every call. We also learned that the supervisor shouldn't be writing anything at 2 AM. The red-flag questions, status messages and escalation list get written and approved on a calm day, and at 2 AM they just approve.

The twists

  • Funding: our primary federal path is NSF SBIR Phase I (up to $305K; the next window after a Project Pitch is November 4, 2026), with BARDA DRIVe's EZ-BAA as a backup. Pilot hospitals can come through health care coalitions funded by ASPR's Hospital Preparedness Program.
  • Global: the ladder, lanes and one-way rule stay the same anywhere. What changes per country is the emergency number (112 in the EU, 120 in China), the red-flag questions in the local language, the AI disclosure law (EU AI Act Article 50 instead of California AB 3030) and where call data is stored. The agent already answers in the caller's language, and callers it can't understand go to a person.
  • Poster: [add a line about your poster here]

What's next for Night Ledger

One supervised pilot on a real after-hours line, at a hospital or USC DPS. Before that: a HIPAA BAA with every vendor in the call path. During the pilot we'd measure time to answer, time from red flag to nurse, and how many callers hang up.

Built With

Share this project:

Updates

Submission history