Project Info
This project did not submit a demo video on Devpost.
Inspiration
Emergency response coordination is a critical challenge that affects every community. During the Southern California wildfires earlier this year and recent campus emergencies at UC Berkeley, we witnessed firsthand how fragmented communication and slow decision-making can cost precious time when lives are at stake. We were inspired by the potential to combine cutting-edge AI with immersive 3D visualization to transform how cities respond to emergencies. Our team envisioned a future where AI agents could instantly analyze disaster scenarios, optimize resource allocation, and coordinate multi-agency responses; all while emergency managers watch it unfold in stunning photorealistic 3D.
What it does
AI-Powered Decision Making: Google Gemini LLM analyzes emergency events in real-time, considering severity, location, resource availability, and Berkeley-specific factors to make intelligent dispatch decisions. Immersive 3D Visualization: Using Google to render Berkeley's buildings and terrain with stunning detail, allowing emergency managers to see exactly where events occur and track vehicle movements in real-time. Multi-Agent Coordination: CrewAI agents work as a specialized team - a Triage Agent assesses threats, Resource Allocation Agent optimizes vehicle deployment, and Dispatch Agent coordinates responses. Hardware Integration: ESP32 touch-screen interfaces deployed throughout Berkeley allow field personnel to trigger emergencies instantly, bridging the physical-digital gap. Smart Vehicle Dispatch: The system automatically selects optimal emergency vehicles (ambulances, fire trucks, police) and calculates realistic routes using Google Maps' emergency routing.
How we built it
Frontend Architecture: JavaScript ES6+ with Google Maps JavaScript API v3.55 Google 3D Maps API (maps3d) for photorealistic visualization AI Backend: Python FastAPI serving the core intelligence system Google Gemini 2.0 Flash as the primary LLM for emergency analysis CrewAI v0.28.8 for multi-agent coordination and workflow Fetch.ai uAgents for decentralized agent communication Hardware Layer: ESP32 microcontrollers with 4.0" TFT touch displays
Challenges we ran into
One issue we faced early on was synchronizing Google Maps routing with vehicle movement animations while maintaining realistic speeds. Handling route calculation failures also proved technically challenging. This was a core functionality for simulating emergency responses in real time. Similarly, ensuring that the Gemini LLM provided consistent and logical emergency responses across different event types, severities, and sources required extensive prompt engineering and testing. Finally, balancing CrewAI's powerful capabilities with real-time performance requirements meant developing both full and simplified agent versions that could adapt dynamically to system load.
Accomplishments we're proud of
Given it was our first time using Agentic AI, we were able to adapt quickly while exposing ourselves to new technologies. We persevered through numerous challenges and created a system that has a real-world impact on a lot of people. In addition, we achieved sub-5-second emergency event processing from hardware trigger to AI analysis to vehicle dispatch visualization, which simulates the real-life effectiveness.
What we learned
Through this project, we learned how to bring together diverse technologies, AI, real-time simulation, embedded hardware, and geospatial data, into a unified, mission-critical system. We developed a deeper appreciation for designing user-centric tools that are both intelligent and responsive under pressure. Working with large language models and agent-based systems taught us the importance of adaptability, prompt design, and clear coordination. Above all, we learned how to turn a bold idea into a tangible, impactful solution through collaboration, iteration, and resilience.
What's next
Multi-City Expansion: Extend beyond Berkeley to San Francisco, Oakland, and eventually any city with emergency response needs. Hospital Integration: Connect with Berkeley's hospital systems for real-time bed availability and specialized care routing. Public Alert System: Add civilian notification capabilities with evacuation routing and safety instructions. Multi-Agent Decision Making Process
UrbanResponse AI - Emergency Response Simulation
3D Emergency Response Simulation for Berkeley, CA using Google Maps JavaScript API
๐ Overview
UrbanResponse AI is an interactive 3D emergency response simulation that demonstrates intelligent emergency vehicle dispatching and routing in Berkeley, California. This implementation focuses on the visualization and simulation components from the larger UrbanResponse AI project.
Key Features
- ๐บ๏ธ 3D Interactive Map: Powered by Google Maps JavaScript API with photorealistic 3D buildings
- ๐ฅ Drag & Drop Events: Create emergency events by dragging icons onto the map
- ๐ Smart Vehicle Dispatching: Automatic selection of nearest appropriate emergency vehicles
- ๐ฃ๏ธ Intelligent Routing: Real-time route calculation with Google Maps Directions API
- โก Smooth Animations: Realistic vehicle movement animations along calculated routes
- ๐ Real Berkeley Data: Actual emergency station locations and service areas
- ๐๏ธ Live Control Panel: Real-time monitoring and control of emergency responses
๐ Quick Start
Prerequisites
- Google Maps API Key - Get one from Google Cloud Console
- Modern Web Browser - Chrome, Firefox, Safari, or Edge
- Local Web Server - For CORS compliance (see setup options below)
Setup Instructions
-
Clone/Download the Project
git clone <repository-url> cd Berk2025 -
Configure Google Maps API Key
Open
index.htmland replaceYOUR_API_KEYwith your actual API key:<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_ACTUAL_API_KEY&libraries=geometry&callback=initApp&v=3.55" async defer></script>Also update
config.js:GOOGLE_MAPS_API_KEY: "YOUR_ACTUAL_API_KEY", -
Set Up Local Web Server
Choose one of these options:
Option A: Python (if installed)
# Python 3 python -m http.server 8000 # Python 2 python -m SimpleHTTPServer 8000Option B: Node.js (if installed)
npx http-server -p 8000Option C: PHP (if installed)
php -S localhost:8000Option D: Live Server Extension (VS Code)
- Install "Live Server" extension
- Right-click
index.htmlโ "Open with Live Server"
-
Open Application
Navigate to:
http://localhost:8000
๐ฎ How to Use
Creating Emergency Events
-
Drag & Drop Method:
- Select an emergency type from the sidebar (๐ฅ Fire, ๐ Medical, ๐ Police, ๐ Accident)
- Drag the icon onto the map where you want the emergency
- Drop to create the event
-
Event Information:
- Click on any event marker to see details
- Use "Dispatch Emergency Vehicles" to send response teams
Managing Vehicles
- View Status: Check vehicle availability in the sidebar
- Manual Reset: Click "Reset Vehicles" to return all vehicles to stations
- Monitor Movement: Watch real-time vehicle animations on the map
Keyboard Shortcuts
Ctrl + C: Clear all eventsCtrl + R: Reset all vehiclesEscape: Close event information panel
Map Controls
- Pan: Click and drag
- Zoom: Mouse wheel or zoom controls
- 3D View: Automatic 3D buildings in supported areas
- Station Info: Click on station markers for details
๐๏ธ Architecture
Core Components
-
MapManager (
js/mapManager.js)- Google Maps 3D integration
- Marker management
- Coordinate conversion
-
EventManager (
js/eventManager.js)- Emergency event creation and tracking
- Drag & drop functionality
- Event lifecycle management
-
VehicleManager (
js/vehicleManager.js)- Emergency vehicle dispatching
- Animation and movement
- Status tracking
-
RoutingEngine (
js/routingEngine.js)- Google Maps Directions API integration
- Route calculation and caching
- Fallback routing
Data Structure
- Emergency Stations: Real Berkeley fire stations, hospitals, and police stations
- Vehicle Fleet: Ambulances, fire trucks, and police vehicles with realistic capabilities
- Event Types: Fire, medical, police, and traffic accidents with appropriate response protocols
๐ฏ Berkeley-Specific Features
Real Emergency Stations
- Fire Stations: 5 actual Berkeley Fire Department locations
- Hospitals: Alta Bates Summit, UC Health Services, Paramedic stations
- Police: Berkeley PD headquarters, UC Police, patrol stations
Coverage Areas
- Downtown Berkeley: High-density urban response
- UC Berkeley Campus: Specialized campus emergency services
- Berkeley Hills: Wildfire and residential emergency response
- Berkeley Marina: Marine and waterfront emergencies
Realistic Response Times
- Ambulance: 4-8 minute average response
- Fire Trucks: 5-10 minute average response
- Police: 3-7 minute average response
โ๏ธ Configuration
Map Settings (config.js)
MAP_CONFIG: {
center: { lat: 37.8715, lng: -122.2730 }, // Berkeley center
zoom: 16,
mapId: "YOUR_MAP_ID", // For 3D features
tilt: 45,
heading: 0
}
Event Types
EVENT_CONFIG: {
eventTypes: {
fire: { priority: 1, requiredVehicles: ["fire_truck", "ambulance"] },
medical: { priority: 2, requiredVehicles: ["ambulance"] },
police: { priority: 3, requiredVehicles: ["police"] },
accident: { priority: 2, requiredVehicles: ["police", "ambulance"] }
}
}
Vehicle Settings
VEHICLE_CONFIG: {
animationSpeed: 50, // km/h
animationSteps: 100,
vehicleTypes: {
ambulance: { icon: "๐", color: "#e67e22" },
fire_truck: { icon: "๐", color: "#e74c3c" },
police: { icon: "๐", color: "#3498db" }
}
}
Agents
- System: Fetch.ai + CrewAI intelligent agent system
- Hardware: ESP32 field sensors and triggers
- Analytics: Response time optimization and predictive modeling
Integration Points
- WebSocket endpoints for agent communication
- Hardware event ingestion via serial/network
- RESTful APIs for external system integration
๐ Development Notes
File Structure
โโโ index.html # Main application entry
โโโ styles.css # UI styling and responsive design
โโโ config.js # System configuration
โโโ data/
โ โโโ stations.js # Berkeley emergency stations data
โโโ js/
โโโ app.js # Main application controller
โโโ mapManager.js # Google Maps integration
โโโ eventManager.js # Emergency event handling
โโโ vehicleManager.js # Vehicle dispatch and animation
โโโ routingEngine.js # Route calculation
Analysis
View
Metric
- 16
- 10
- 1
- 1
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- AnthropicIn code
- C++In code
- CrewAIIn code
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- Google GeminiClaimed
8 of 9 appear in the indexed code. 1 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- GitHub CopilotCommits
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
565 KB
Source files
27
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
tpradosh/UrbanResponseAi
40 files ยท 640 KB ยท @ afd6859
Structure
Interface
2 files ยท 5%Screens, components and styles rendered to the user.
Application logic
24 files ยท 60%Domain rules, services and shared utilities.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here โ open the file browser to check anything the diagram implies.
Languages
- JavaScript43%
- Python36%
- C++8%
- Markdown6%
- CSS4%
- HTML2%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
Agents/requirements.txt
pypi ยท 13- anthropic
- crewai
- crewai[tools]
- fastapi
- google-generativeai
- loguru
- numpy
- pandas
- pydantic
- python-dotenv
- uagents
- uagents[bureau]
- uvicorn
Declared in the repositoryโs manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This projectโs features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.