Inspiration
Emergency waiting rooms are chaotic by design. Patients arrive in distress, front desks are overwhelmed, and critical cases can get buried under administrative bottlenecks. We've all seen or experienced the frustration of waiting without any clarity on urgency or order. We built FirstIn to eliminate that friction: a system where patients check themselves in and AI handles the triage, so staff can focus entirely on care.
What it does
FirstIn is an AI-powered emergency triage platform. Patients arrive and check in via a kiosk or mobile browser, either by speaking with a voice AI agent or filling out a structured intake form. The system collects their chief complaint, symptoms, pain level, and demographics, then uses Gemini to generate an ESI (Emergency Severity Index) score from 1 (immediate) to 5 (non-urgent) along with a clinical rationale. That score drives a live priority queue visible to staff on a dedicated dashboard, where nurses and physicians can update patient status and issue prescriptions, all from one screen. Patients optionally receive a confirmation email with their triage details.
How we built it
- Frontend: Next.js 16 (App Router), Tailwind CSS v4, shadcn/ui
- Voice intake: ElevenLabs Conversational AI SDK. Patients speak naturally and the agent extracts structured intake data from the transcript.
- AI scoring: Google Gemini API generates ESI scores, red flags, and clinical summaries from normalized patient data, with a rule-based fallback if the API fails.
- Database: Supabase (Postgres) for patient records, queue state, and auth.
- Email: Resend for triage confirmation emails.
- Deployment: Vercel
The architecture is intentionally simple. API routes in Next.js, a single patients table in Supabase, and stateless scoring via Gemini. The staff dashboard polls the queue in real time and renders patients sorted by ESI score and arrival time.
Challenges we ran into
Getting the ElevenLabs voice agent to reliably extract structured intake data from freeform conversation transcripts was harder than expected. We had to carefully design the finalization prompt so Gemini could parse messy transcripts into clean fields. We also hit edge cases in ESI scoring. Gemini occasionally returned malformed JSON or hallucinated fields, so we built a rule-based fallback and an ESI-1 hard-stop for life-threatening keywords that bypasses the AI entirely.
Balancing the split-screen intake UX on both desktop and mobile required several iterations, and getting the page transitions to feel smooth rather than jarring took more care than anticipated.
Accomplishments that we're proud of
- A fully self-service patient intake flow that works via voice or text, requiring zero staff involvement
- Sub-second AI triage scoring with a reliable fallback chain
- A clean, minimal UI that doesn't feel clinical or overwhelming for patients who are already stressed
- End-to-end flow from patient check-in to staff dashboard to prescription workflow, all built in a single hackathon weekend
What we learned
Designing for distressed users is a different problem than designing for normal users. Every interaction, whether it was the split-screen mode selector, the form layout, or the "you're all set" confirmation, had to feel calm and trustworthy. We also learned that voice AI for structured data collection requires much more prompt engineering than conversational chat. The agent needs to guide the patient through specific fields without sounding robotic.
On the technical side, we got deep into Supabase RLS, Gemini's structured output mode, and the ElevenLabs Conversational AI SDK, none of which any of us had used before this weekend.
What's next for FirstIn
- Multilingual support: the intake schema already stores a
languagefield, and hooking up translation would make FirstIn accessible to non-English speakers immediately - Vitals integration: connecting to kiosk hardware (pulse ox, blood pressure cuffs) to feed objective data into the ESI scoring
- SMS status updates: patients step away from the waiting room and get texted when it's their turn
- Analytics dashboard: average wait times, ESI distribution, and throughput metrics for hospital administrators
- EHR integration: pushing triage summaries directly into Epic or Cerner to eliminate double-entry for clinical staff
Built With
- elevenlabs
- geminiapi
- javascript
- next
- node.js
- resend
- shadcn
- supabase
- tailwindcss
Log in or sign up for Devpost to join the conversation.