Inspiration
Relay was inspired by personal experience and the HBO medical drama The Pitt. EMTs and emergency-room teams are not always fully in sync before a patient arrives. Often, the ER receives the complete story only when the ambulance reaches the hospital.
That means the ER team must prepare for the worst while knowing very little. Relay explores how an AI agent can organize the information coming from an ambulance and help the hospital prepare earlier.
What it does
Relay is an AI coordination agent that connects EMTs with the receiving ER team.
While transporting a patient, the EMT enters two kinds of information:
- Field notes, such as how the accident happened, visible injuries, bleeding, confusion, and treatments already given.
- Patient vitals, such as heart rate, blood pressure, oxygen level, temperature, breathing rate, and GCS.
The AI agent compares these two sources of information. It checks whether the written report and the vital signs support each other. For example, if the EMT reports heavy bleeding and the patient also has a high heart rate, low blood pressure, and low temperature, the agent can highlight possible shock as a concern for the ER team to review.
The agent also looks for missing or conflicting information. If the notes describe the patient as alert but the reported GCS suggests confusion, Relay brings that difference to the team’s attention instead of guessing which one is correct.
After understanding the current situation, the agent turns the information into a simple orchestration plan. It:
- Creates a structured ATMIST patient handoff
- Summarizes the most urgent concerns
- Lists information that still needs to be confirmed
- Checks which fictional staff members and hospital rooms are available
- Selects the relevant receiving-team roles
- Suggests preparation tasks for each person
- Links every suggestion to the note or vital sign that supports it
- Produces a short SBAR-style briefing for each assigned staff member
For example, Relay may propose that the charge nurse prepare Trauma Bay T2, the blood bank prepare for verification and compatibility testing, the trauma surgeon review the reported bleeding, orthopedics prepare for the suspected fracture, and radiology confirm that CT is available.
The AI agent does not contact or dispatch anyone by itself. The ER lead reviews the proposed plan, makes any needed changes, and selects Approve and dispatch. Only then do staff members receive their assignments.
Each staff member can respond with Acknowledge, Ready, or Blocked. Relay sends those updates back to the ER lead, creating one shared view of the team’s readiness before the patient arrives.
How we built it
Relay was built with React, TypeScript, shadcn/ui, a Cloudflare-compatible backend, and D1 persistence. The AI coordination agent uses Gemini with structured function calling.
The agent receives the latest EMT notes, simulated patient vitals, existing assignments, staff availability, and room availability. It can use a small set of controlled tools to read available resources and submit a draft coordination plan.
The backend then checks the agent’s response. It verifies that:
- Every staff member exists
- The selected person has the correct specialty
- The person is currently available
- The selected room exists and is available
- Every task belongs to an approved preparation category
- Every recommendation points to real evidence from the current report
The model cannot approve its own plan. Approval is a separate action that belongs to the ER lead.
The application has three connected views:
- EMT view: update notes, patient information, and simulated observations
- ER-lead view: review the AI handoff and approve the preparation plan
- Staff view: receive an individual briefing and report readiness
All views share the same encounter and update approximately every two seconds.
Challenges we ran into
The biggest challenge was making the AI useful without allowing it to make final clinical decisions.
We wanted the agent to quickly understand a changing situation and coordinate people, but we did not want it to diagnose the patient, order procedures, select blood products, or dispatch the team without review.
We solved this by making the agent a preparation assistant. It proposes actions, explains its evidence, and clearly identifies unknowns. The ER lead remains responsible for reviewing and approving the plan.
Another challenge was comparing written notes with numerical vital signs. These sources may support each other, disagree, or be incomplete. Relay keeps reported facts, simulated measurements, AI concerns, and unknown information in separate sections so the team can understand where each statement came from.
We also had to manage new updates safely. If the patient’s condition changes after a plan is created, Relay marks the old plan as outdated and asks the agent to prepare a new version.
Accomplishments that we're proud of
We created an AI agent that does more than summarize text. It compares multiple kinds of patient information and turns them into a coordinated preparation workflow.
One EMT update can produce:
- A structured trauma handoff
- A list of urgent concerns
- Missing and conflicting information
- A proposed receiving team
- Room and imaging preparation
- Individual staff responsibilities
- Live readiness updates
We are also proud that every proposed task includes supporting evidence. The ER lead can see why the agent made each suggestion before approving it.
The system keeps human oversight at the center. The AI prepares and organizes, while clinicians remain responsible for decisions.
What we learned
We learned that an effective medical AI agent does not need to replace a clinician. It can provide value by organizing information, comparing different inputs, finding missing details, and helping several people prepare together.
We also learned that orchestration is different from a normal chatbot. Relay does not simply answer a question. It watches a shared situation, creates a plan, assigns responsibilities after approval, and tracks whether the team is ready.
Clear evidence and human approval are essential. People are more likely to trust an AI-generated plan when they can see where each recommendation came from and change it before anything happens.
What's next for Relay
The next step would be connecting Relay to validated medical devices and real ambulance systems so observations could arrive automatically.
Future versions could also include:
- Voice transcription for hands-free EMT notes
- Secure authentication for hospital staff
- Multiple simultaneous patient encounters
- Integration with EHR and hospital scheduling systems
- More hospital-specific preparation workflows
- Real-time staff notifications
- Automatic ETA updates
- Controlled testing with EMTs, nurses, and ER doctors
The long-term goal is for Relay to become a secure coordination layer between the ambulance and the hospital, helping the receiving team understand the situation and prepare before the patient arrives.
Built With
- agent
- ai
- ardunio
- cloudflare
- gemini
- react
- typescript
Log in or sign up for Devpost to join the conversation.