Inspiration

When a hospital discharges a patient to home health, the referral goes to 3–5 agencies at once — whoever says yes first wins the patient. ~20% of referrals arrive after hours when nobody's at the desk, feeding a $200–500M/year referral leakage problem. We built the agent that never misses that call.

What it does

Remy answers a home-health agency's referral line 24/7 on Twilio ConversationRelay. She recognizes the caller, structures the referral through natural conversation, and verifies it against real service areas, payer contracts, and staffing capacity. All green → accepts in under a minute (industry norm: ~45). Anything unverified → she captures a callback, phones the on-call coordinator for a one-keypress commitment, then calls the hospital back to confirm — one inbound call becoming a three-call autonomous chain, streamed live to a command-center dashboard.

How we built it

Twilio ConversationRelay streams voice over WebSocket to a Fastify agent on Railway. An LLM extractor turns messy speech into schema-validated data; deterministic tools query Supabase; a pure-code decision gate produces accept/escalate — the LLM words the response but can never make the decision. Supabase Realtime drives a Next.js command center on Vercel with PHI-redacted telemetry on every step.

Challenges we ran into

The three-call loop: hospital → Remy → coordinator → back to hospital. Outbound calling has its own auth, TwiML endpoints, keypress capture, and idempotency — chained across three calls that can each drop or hit voicemail, without blocking the live line. And when our extractor once stored a plausible-but-wrong callback number, we learned the golden rule: any data triggering an outbound action gets read back and confirmed first.

Accomplishments that we're proud of

A voice agent that structurally cannot hallucinate an acceptance — every yes requires three database confirmations. A full accept in under a minute against a 45-minute industry norm. A three-call autonomous chain with a human keypress in the loop. And an observability dashboard where judges can watch every field, check, and decision land in real time.

What we learned

Telephony is unforgiving — latency, barge-in, "mm-hmm" — and someone always hears your failure modes. The deepest lesson: trustworthy agents split cleanly. LLMs understand and phrase; deterministic code decides. And a call leg that fails silently may as well not exist — telemetry isn't optional.

What's next for Remy

SMS notifications (pending A2P registration), multi-referral calls, EMR write-back to systems like WellSky and HCHB — and becoming the revenue front door for every intake workflow in post-acute care.

Built With

Share this project:

Updates

Submission history