ReadyBed is a multi-agent EMS handoff + routing system. It combines live audio transcription, frame-by-frame visual analysis, and hospital resource simulation to deliver a pre-arrival summary and destination recommendation in seconds.
- Multimodal intake: streaming audio + visual frames into a unified patient context.
- Pre-arrival handoff: concise clinical snapshot, timeline, and pathway signals.
- Routing engine: fastest time-to-treatment based on travel time + resource queues.
- Synthesized patient chart: ABCDE exam findings and assessment from live observations.
- Voice escalation: optional Twilio call + SMS updates with live context.
- Admin control: real-time hospital resource adjustments.
/: routing UI (travel time + wait time) with symptom input and hospital recommendations./vid: redirects to/vid/live./vid/live: ambulance-video intake with continuous frame analysis, transcript updates, synthesized patient chart, nurse call trigger, and route-patient action./cam: webcam intake using the same multimodal pipeline./summary: live summary dashboard (polls/api/videvery second)./admit: admin resource manager to changeinUse/queueper hospital resource./analyze: legacy placeholder page.
- Ingestion
- Video/webcam frames are sent to
POST /api/video/frame-analyze. - Audio chunks are sent to
POST /api/audio/transcribe.
- Video/webcam frames are sent to
- Agent state updates
- Transcript segments and visual insights are stored in in-memory runtime state (
lib/agents/state.ts). - Visual analysis also updates a synthesized patient chart (
lib/agents/chart.ts).
- Transcript segments and visual insights are stored in in-memory runtime state (
- Decision support
- Route recommendations come from
POST /api/triageorPOST /api/agents/route-patient. - Routing combines travel time + simulated hospital wait states.
- Route recommendations come from
- Handoff outputs
/summaryconsumesGET /api/vid, which merges trip store data, runtime context, andvision_analysis.json.- Twilio voice/SMS endpoints can speak or send context updates to receiving teams.
- Runtime context:
lib/agents/state.ts- Transcript/live summary, visual report, routing result, patient chart, escalation state.
- Stored in memory only (resets on server restart).
- Trip summary store:
lib/trip/store.ts- Handoff summary, triage tags, timeline events, vitals trend.
- Includes simulated vitals drift when queried.
POST /api/triageGET /api/admin/update-resourcePOST /api/admin/update-resourcePOST /api/agents/route-patientGET /api/agents/routing-status
POST /api/audio/transcribePOST /api/video/frame-analyzeGET /api/agents/live-summaryPOST /api/agents/live-summary/clearGET /api/agents/visual-statusGET /api/agents/patient-chartDELETE /api/agents/patient-chart
POST /api/agents/background/startPOST /api/agents/background/stopGET /api/agents/background/statusGET /api/agents/report
GET /api/trip/summaryPOST /api/trip/vitalsPOST /api/trip/eventPOST /api/trip/finalizeGET /api/vid
POST /api/voice/callGET /api/voice/twimlPOST /api/voice/twimlPOST /api/voice/handleGET /api/voice/status?callSid=...GET /api/voice/contextPOST /api/voice/respondPOST /api/voice/send-updatePOST /api/voice/push
POST /api/media/split(split uploaded video into audio + no-audio video viaffmpeg)GET /api/analyze(deprecated compatibility endpoint)
- Node.js 20+
- npm
ffmpegon PATH
macOS:
brew install ffmpegUbuntu/Debian:
sudo apt-get update && sudo apt-get install -y ffmpegnpm installStart from .env.example and set values based on what you want to run.
DEDALUS_API_KEY=your_key_hereWithout DEDALUS_API_KEY, audio transcription and frame analysis endpoints fail.
TWILIO_ACCOUNT_SID=...
TWILIO_AUTH_TOKEN=...
TWILIO_FROM_NUMBER=+1...
APP_BASE_URL=https://your-public-urlIf Twilio vars are missing, voice/SMS endpoints return simulation-mode responses.
ConversationRelay is only used when explicitly enabled.
TWILIO_USE_CONVERSATION_RELAY=true
TWILIO_CONVERSATION_RELAY_WS_URL=wss://your-relay-host/conversation-relayIf not enabled, Twilio uses a standard <Say> + <Gather> call flow.
DEDALUS_REPORT_MODEL(default:openai/gpt-5.2)DEDALUS_VOICE_MODEL(default:openai/gpt-5.2)GOOGLE_MAPS_API_KEY(if unset, travel time falls back to Haversine estimate)FFMPEG_PATH(default:ffmpeg)RELAY_PORT(default:8081)TWILIO_CONVERSATION_RELAY_PATH(default:/conversation-relay)RELAY_BASE_URL(default:http://localhost:8081)NEXT_PUBLIC_RECIEVER_PHONE_NUMBER(note: key is spelledRECIEVERin code)
Terminal 1:
npm run devTerminal 2 (only needed for ConversationRelay /api/voice/push flow):
npm run dev:relayOpen:
http://localhost:3000/
/vid/liveexpectspublic/processed/ambulance.mp4.- If you do not have that file, use
/caminstead, or place your own clip at that path.
- If you do not have that file, use
/api/vidalso loadsvision_analysis.jsonfor the summary dashboard’s vision panel.
- Missing Twilio credentials: call/send-update endpoints return simulation payloads.
- Missing Google Maps key: travel times are estimated locally.
- Missing Dedalus key: voice responses can still return context-based fallback text, but multimodal analysis endpoints do not run.
Do not commit real .env.local secrets (Twilio tokens, API keys, etc.) to source control.
ReadyBed is for prototypes and demos only. It is not a medical device and does not provide clinical advice.