A comprehensive emergency response system that combines AI-powered voice agents with a real-time dispatch center dashboard. Built for UGAHacks11.
- Gaurav Shrivastava
- Kavya Gupta
- Pranay Joshi
- Priyanshu Sethi
This project consists of two main components:
-
AI Phone Agent - A backend service that handles incoming emergency calls, uses AI to understand and respond to callers, and extracts critical information in real-time.
-
Dispatch Center - A modern web dashboard that provides dispatchers with live call transcripts, incident mapping, intelligence extraction, and call history management.
- π€ AI-Powered Conversations - Uses Google Gemini AI to understand emergency situations and gather critical information
- ποΈ Natural Voice Interaction - Text-to-speech via ElevenLabs for natural, human-like responses
- π Twilio Integration - Handles incoming calls and manages call sessions
- π¬ Real-time Transcription - Live transcription of caller audio
- π§ Sentiment Analysis - Analyzes caller sentiment to prioritize urgent situations
- π Structured Data Extraction - Automatically extracts location, incident type, injuries, weapons, and other critical details
- π WebSocket Streaming - Real-time updates to dispatch center dashboard
- πΎ Firebase Integration - Stores call logs, transcripts, and extracted intelligence
- π Live Incident Map - Real-time visualization of emergency locations using interactive maps
- π Live Transcripts - Real-time display of call conversations
- π― Intel Deck - Extracted intelligence including incident type, location, injuries, weapons, and more
- π Call History - View and manage past emergency calls
- π¨ Audio Visualization - Visual representation of call audio
- π Real-time Updates - WebSocket-based live updates for active calls
- π± Modern UI - Built with Next.js, React, and Tailwind CSS
ugahacks11/
βββ ai-phone-agentjs/ # Backend AI phone agent service
β βββ index.js # Main server file
β βββ firebase.js # Firebase integration
β βββ package.json # Dependencies
β
βββ dispatch-center/ # Frontend dispatch dashboard
βββ src/
β βββ app/ # Next.js app router pages
β βββ components/ # React components
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility functions
βββ package.json # Dependencies
- Node.js (v18 or higher)
- npm or yarn
- Firebase project with Firestore enabled
- Twilio account with phone number
- Google Cloud API key (for Gemini AI)
- ElevenLabs API key (for text-to-speech)
- ngrok or similar tunneling service (for local development)
git clone <repository-url>
cd ugahacks11cd ai-phone-agentjs
npm installCreate a .env file in the ai-phone-agentjs directory:
GOOGLE_API_KEY=your_google_api_key
ELEVENLABS_API_KEY=your_elevenlabs_api_key
TWILIO_ACCOUNT_SID=your_twilio_account_sid
TWILIO_AUTH_TOKEN=your_twilio_auth_token
TWILIO_PHONE_NUMBER=your_twilio_phone_number
PUBLIC_DOMAIN=your_ngrok_url_or_domain
PORT=3000cd dispatch-center
npm installCreate a .env.local file in the dispatch-center directory:
NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_firebase_auth_domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_firebase_project_id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_firebase_storage_bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_firebase_messaging_sender_id
NEXT_PUBLIC_FIREBASE_APP_ID=your_firebase_app_idcd ai-phone-agentjs
npm startThe server will start on port 3000 (or the port specified in your .env file).
cd dispatch-center
npm run devThe dashboard will be available at http://localhost:3000.
- Set up ngrok or deploy your backend to a public URL
- In your Twilio console, configure your phone number's webhook URL:
- Voice webhook:
https://your-domain.com/incoming-call - Status callback:
https://your-domain.com/call-status
- Voice webhook:
- Fastify - Fast web framework
- Google Gemini AI - Natural language understanding
- ElevenLabs - Text-to-speech synthesis
- Twilio - Voice call handling
- Firebase - Real-time database
- WebSocket - Real-time communication
- Sentiment - Sentiment analysis
- Next.js 14 - React framework
- TypeScript - Type safety
- Tailwind CSS - Styling
- Framer Motion - Animations
- React Leaflet - Map visualization
- Firebase - Real-time data sync
- Radix UI - Accessible components
The AI agent uses structured conversation flow to gather:
- Incident type (Robbery, Medical, Fire, Assault, etc.)
- Location information
- Injury status
- Weapon involvement
- People in danger
- Suspect descriptions (for crimes)
- Patient information (for medical emergencies)
The dispatch center provides:
- Live call monitoring
- Automatic intelligence extraction
- Geographic incident visualization
- Call history and search
- Audio visualization
- Status tracking
For the AI Phone Agent:
cd ai-phone-agentjs
npm run devFor the Dispatch Center:
cd dispatch-center
npm run devISC
Built for UGAHacks11 hackathon.