AI-powered triage system that empowers nurses with instant, expert-level assistance on ESI assessments using Fetch.AI to manage Claude and ChromaDB, ensuring critical patients never wait while reducing burnout.
๐ Live App | ๐ Devpost Submission
One of our teammates went to the ER with a broken arm and waited almost 6 hours. In busy emergency rooms like his, even the smallest inefficiencies can add up. We were inspired by the idea that digital tools and automation can support nursing staff, not replace them, by monitoring evolving conditions, surfacing early warnings, and giving transparent, actionable recommendations.
- ๐ฏ Triage Score Determination: Calculates ESI (Emergency Severity Index) priority levels based on current symptoms, history, images of injuries, and patient comments following established medical guidelines.
- ๐ Patient Records Retrieval (HL7 FHIR): Retrieves prior visits, known conditions, and reason for visit so nurses and the system have full context.
- ๐ค Voice & Text Patient Intake: Patients can speak or type their current symptoms and comments. The system uses AI to extract structured data and prompts for clarifying details.
- ๐ฉโโ๏ธ Nurse Dashboard: Presents a real-time queue, allows manual add/remove of patients, queue re-ordering, and re-running of triage logic.
- ๐จ Smart Alert System: If a patient's condition changes during chatbot conversations (ESI increases/decreases), the system triggers an alert to the nurse with the new recommendation and rationale.
- ๐ฑ Patient View: Unique links for each patient sent via SMS, allowing patients to update their symptoms in real-time through a chatbot interface.
- React - UI framework
- Vite - Build tool
- React Router - Navigation
- Browser Web Speech API - Voice recognition
- Vercel - Hosting
- Python - Core language
- Flask - Web framework
- Gunicorn - Production server
- Render - Backend hosting
- Claude 3 Haiku (Anthropic) - Triage assessment and structured data extraction
- Fetch.AI UAgents - Smart agent orchestration for data flow
- ChromaDB - Vector database for semantic search of patient medical records (HL7 FHIR)
- Twilio - SMS communication for patient links and updates
calhacks2025/
โโโ nurse-ui/ # Frontend React application
โ โโโ src/
โ โ โโโ pages/ # Page components (Queue, Nurse Form, Patient Chat, etc.)
โ โ โโโ components/ # Reusable UI components
โ โ โโโ utils/ # Utility functions (queue management)
โ โโโ package.json
โ
โโโ backend/ # Flask backend API
โ โโโ app.py # Main Flask application
โ โโโ agents/ # AI agent implementations
โ โ โโโ triage.py # ESI triage logic and prompts
โ โ โโโ nurse_agent.py
โ โ โโโ patient_agent.py
โ โโโ requirements.txt
โ
โโโ Chromadb_rag/ # ChromaDB integration for patient records
โ
โโโ README.md
- Node.js (v18 or higher)
- Python (v3.11 or higher)
- Anthropic API Key - Get one at console.anthropic.com
- Twilio Account (for SMS features) - Sign up at twilio.com
- ChromaDB (local or cloud instance)
# Navigate to frontend directory
cd nurse-ui
# Install dependencies
npm install
# Start development server
npm run devThe frontend will be available at http://localhost:5173
# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create .env file
cat > .env << EOF
ANTHROPIC_API_KEY=your_anthropic_api_key_here
TWILIO_ACCOUNT_SID=your_twilio_sid_here
TWILIO_AUTH_TOKEN=your_twilio_token_here
TWILIO_PHONE_NUMBER=your_twilio_number_here
CHROMADB_URL=your_chromadb_url_here
EOF
# Run the Flask server
python app.pyThe backend will be available at http://localhost:5000
Update the API base URL in nurse-ui/src/config.js if running locally:
export const API_BASE_URL = 'http://localhost:5000' // Local
// or
export const API_BASE_URL = 'https://calhacks2025-ncoi.onrender.com' // Production- Navigate to Queue Page: View all patients and their current ESI scores
- Add Patient: Click "Add Patient" to register a new patient
- Fill Triage Form: Enter vitals, symptoms, pain level, and comments
- Voice Input: Click the microphone icon to speak patient information - AI will automatically fill the form
- View Dashboard: See triage assessment results with ESI score and rationale
- Respond to Alerts: When patient conditions change, review and accept/reject ESI updates
- Receive SMS link with unique patient ID
- Click link to access patient waiting page
- Chat with AI assistant to update symptoms
- View estimated wait time and queue position
- Receive notifications if triage level changes
The Emergency Severity Index (ESI) is a 5-level triage algorithm:
- ESI 1: Resuscitation - Immediate life-saving intervention needed
- ESI 2: Emergency - High risk situation, should be seen immediately
- ESI 3: Urgent - Multiple resources needed, complex workup
- ESI 4: Less Urgent - One resource needed, simple workup
- ESI 5: Non-Urgent - No resources needed, simple treatment
The system continuously monitors patient chatbot conversations. When symptoms change significantly (e.g., pain increases from 3/10 to 9/10), the AI re-evaluates the ESI score and sends an alert to the nurse with:
- Current ESI vs. Suggested ESI
- Brief summary of the change
- Option to accept or reject the update
- โ Fully custom priority queue system that supports real-time triage reordering
- โ Consistent AI-generated feedback using advanced prompt engineering and model tuning
- โ Successful integration of all components (backend, agent, triage logic, frontend) into a cohesive working prototype
- โ Voice-to-form automation using Claude for structured data extraction
- โ Real-time alert system for dynamic triage updates
- LiveKit Integration Issues: Managing rooms, sessions, and audio streaming was complex. We pivoted to Browser Web Speech API for more reliable voice input.
- Custom Priority Queue: Ensuring triage scoring and patient order dynamically updated in real-time required careful state management.
- Prompt Engineering: Tuning prompts so the AI agent produced stable, actionable outputs each time required extensive iteration.
- Working with AI Agents: Learning how to manage message flow, context retention, and error recovery in multi-agent systems.
- Deploy backend and agent services on secure, scalable cloud infrastructure
- Integrate live hospital databases to access authentic patient records
- Fine-tune waiting time predictions using queue length and patient flow analytics
- Refine chatbot prompts for more empathetic, context-aware responses
- Expand multilingual and accessibility support
- Add monitoring dashboards for hospital administrators
- Implement WebSocket connections for real-time updates (eliminate polling)
Created for Cal Hacks 12.0
- Maor Barzilay
- Hritika Arjunwadkar
- Samuel Araya
- Ethan Ngo
This project was created for Cal Hacks 12.0 hackathon. All rights reserved.
- Live Application
- Devpost Submission
- Backend API:
https://calhacks2025-ncoi.onrender.com
Built with โค๏ธ at Cal Hacks 12.0