An AI-driven emergency decision-support platform that transforms fragmented, contradictory disaster reports into an explainable, resource-aware, and human-authorized response plan in seconds.
π Live Production Deployment: https://rescue-ai-mocha.vercel.app
π Product Requirements Document: PRD.md | Download RescueAI_PRD.docx
Safety Principle: RescueAI never autonomously dispatches real emergency personnel. Every AI recommendation flows through:
Emergency Report β Multi-Agent Analysis β Explainable Recommendation β Human Commander Review β Authorized Simulated Dispatch.
- π Interactive 3D Tactical Globe: Built with Three.js and React Three Fiber. Features an auto-rotating wireframe sphere, glowing geopolitical boundary of Pakistan, strategic city hubs, 100+ orbiting telemetry particles, and real-time orbital hover HUD telemetry cards.
- π΅π° Nationwide Coverage (27+ Cities): Pre-seeded nationwide dataset across Pakistan (Karachi, Lahore, Islamabad, Quetta, Peshawar, Multan, Faisalabad, Gwadar, Gilgit, Skardu, etc.) with 70+ incidents, 89+ trauma centers, and 250+ rescue fleets.
- β‘ 6 Specialized Autonomous Agents:
- Intake Agent: Classifies free-text/voice/social media reports into structured schema.
- Analysis Agent: Evaluates triage severity, confidence, and conflicting info detection.
- Resource Agent: Multi-factor matching balancing travel distance, crew readiness, and fleet capability.
- Hospital Agent: Live trauma, ICU, and burn center bed capacity scoring.
- Secondary Risk Agent: Anticipates cascading risks (gas leaks, structural collapse, aftershocks).
- Planning Agent: Synthesizes a prioritized, step-by-step action plan with RAG citations.
- π― Tactical Incident Registry & Filters: Multi-criteria filtering by Status (
REPORTED,TRIAGED,DISPATCHED,RESOLVED), Severity (CRITICAL,HIGH,MEDIUM,LOW), and Type, paired with a dynamic results counter. - π City Quick-Pick & GPS Auto-Fill: Streamlined emergency intake modal with a 29-city dropdown that automatically populates precise GPS coordinates for accurate geospatial mapping.
- π‘οΈ DEFCON Readiness & Live Telemetry: Dynamic command-center layout with DEFCON status, live PKT timestamp, and animated telemetry indicators.
- π± Mobile & Field Command Mode: Fully responsive tactical UX with an animated slide-out hamburger drawer menu (
<= 960px), compact telemetry HUD, and touch-optimized viewports for field commanders on smartphones and tablets.
rescueai/
βββ backend/
β βββ agents/ # The 6 specialized agents + orchestrator + RAG
β β βββ intake_agent.py # Agent 1: raw text -> structured incident
β β βββ analysis_agent.py # Agent 2: severity/urgency scoring + explainability
β β βββ resource_agent.py # Agent 3: multi-factor resource matching
β β βββ hospital_agent.py # Agent 4: hospital bed capacity scoring
β β βββ risk_agent.py # Agent 5: secondary-risk & hazard anticipation
β β βββ planning_agent.py # Agent 6: synthesizes comprehensive response plan
β β βββ knowledge_base.py # Lightweight TF-IDF RAG retriever
β β βββ orchestrator.py # Pipeline execution & conflict resolution
β βββ routers/ # FastAPI routers
β β βββ incidents.py # Incident intake, analysis, approval, resolve
β β βββ misc.py # Resources, hospitals, dashboard stats, audit, alerts
β β βββ demo.py # One-click crisis scenario loader
β βββ knowledge_base/ # RAG source documents (markdown guidelines)
β βββ tests/ # Unit & integration test suite (13 passing tests)
β βββ models.py # SQLAlchemy ORM (9 tables)
β βββ schemas.py # Pydantic request/response validation schemas
β βββ database.py # SQLite / PostgreSQL engine config
β βββ seed_pakistan.py # Nationwide data seeder (27+ cities, 70+ incidents)
β βββ main.py # FastAPI application & static bundle server
βββ frontend/
β βββ src/
β βββ components/
β β βββ MapView.jsx # 3D Tactical Globe (Three.js/R3F) & 2D Tactical Grid
β β βββ ParticleBackground.jsx # Ambient canvas particle dust
β β βββ PageTransition.jsx# Smooth Framer Motion page navigation
β β βββ ResponsePlanPanel.jsx # AI recommendation & explainability inspector
β β βββ SeverityBadge.jsx # Color-coded tactical severity indicators
β β βββ StatCard.jsx # Telemetry metric cards with animated counters
β βββ pages/ # Command Center, Incidents, Map, Fleets, Hospitals, Analytics
β βββ api/client.js # Axios API client wrapper
β βββ styles.css # Dark tactical EOC design system
βββ Dockerfile # Multi-stage production container
βββ docker-compose.yml
[Raw Emergency Reports] βββββββββΊ [Agent 1: Intake]
β
βΌ
[Structured Incident]
β
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββ
βΌ βΌ βΌ
[Agent 2: Analysis] [Agent 5: Risk] [Conflict Detection]
(Severity & Confidence) (Secondary Hazards) (Conflicting Eyewitnesses)
β β β
ββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββ
βΌ βΌ
[Agent 3: Resources] [Agent 4: Hospitals]
(Fleets / SAR / Fire) (Trauma & ICU Beds)
β β
ββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββ
βΌ
[Agent 6: Response Planning]
(RAG Knowledge Base Citations)
β
βΌ
[AI Recommendation & Action Steps]
β
βββββββββββββββββββββββββββββββ
π΄ HUMAN COMMANDER APPROVAL GATE
βββββββββββββββββββββββββββββββ
β
βΌ
[Simulated Dispatch + Audit Ledger]
Run both the FastAPI backend and built React frontend together on port 7860:
# 1. Clone the repository
git clone https://github.com/lizzz-dev/RescueAI.git
cd RescueAI
# 2. Setup Python environment
python -m venv venv
# On Windows:
.\venv\Scripts\activate
# On Linux/macOS:
source venv/bin/activate
# 3. Install dependencies
pip install -r backend/requirements.txt
# 4. Seed nationwide Pakistan dataset (70+ incidents, 89 hospitals, 250 fleets across 27 cities)
python backend/seed_pakistan.py
# 5. Build frontend
cd frontend
npm install
npm run build
cd ..
# 6. Launch server
python -m uvicorn backend.main:app --host 127.0.0.1 --port 7860Open your browser to: http://127.0.0.1:7860
- Web Application:
http://127.0.0.1:7860 - Interactive Swagger API Docs:
http://127.0.0.1:7860/docs
docker compose up --build- App:
http://localhost:7860 - Swagger API Docs:
http://localhost:7860/docs
Backend Terminal:
python -m uvicorn backend.main:app --host 127.0.0.1 --port 7860 --reloadFrontend Terminal:
cd frontend
npm run dev
# Running at http://localhost:5173 (proxies API requests to port 7860)RescueAI is fully configured for continuous, zero-cost deployment on Vercel:
- Frontend Client: High-performance React 18 SPA built with Vite (
frontend/dist&public/). - Serverless API Backend: Native Python 3.11 FastAPI runtime handled via
api/index.py, executing all 6 autonomous agents, SQLAlchemy ORM, and RAG knowledge retrieval. - Inter-Agency Pre-Seeded Dataset: Automatically seeds 70+ incidents, 89+ trauma hospitals, and 250+ rescue fleet units across 27+ districts on initial load.
- Production URL: https://rescue-ai-mocha.vercel.app
Every commit pushed to GitHub (main) automatically triggers Vercel to build the React application and deploy the serverless Python endpoints with zero manual intervention.
| Method | Endpoint | Purpose |
|---|---|---|
POST |
/api/incidents |
Submit emergency text report β Agent 1 structures it |
POST |
/api/incidents/{id}/reports |
Submit secondary eyewitness report (triggers conflict detection) |
GET |
/api/incidents |
List all incidents (supports filtering by status & severity) |
GET |
/api/incidents/{id} |
Retrieve incident detail and linked eyewitness reports |
POST |
/api/incidents/{id}/analyze |
Execute Agents 2β6 to synthesize response plan |
GET |
/api/incidents/{id}/response-plan |
Fetch latest AI response recommendation |
POST |
/api/incidents/{id}/approve |
Human Commander Approval β flips fleet status to DISPATCHED |
POST |
/api/incidents/{id}/reject |
Reject AI proposal with commander reason |
POST |
/api/incidents/{id}/resolve |
Mark incident fully resolved |
GET |
/api/resources |
Rescue fleets inventory (Ambulances, SAR, Fire, Utility) |
GET |
/api/hospitals |
Hospital registry with ER & ICU bed counts |
GET |
/api/dashboard/stats |
High-level operations telemetry numbers |
GET |
/api/dashboard/analytics |
Incident distribution, severity breakdown, and fleet utilization |
GET |
/api/audit-logs |
Immutable audit ledger tracking all AI and commander actions |
GET |
/api/notifications |
Real-time dispatch alerts stream |
POST |
/api/demo/load-scenario |
Loads live crisis scenario with conflicting eyewitness reports |
RescueAI includes a comprehensive test suite exercising agent logic, scoring formulas, edge cases, and end-to-end pipeline execution:
# Run backend tests
cd backend
python -m unittest tests.test_agents -v13 Passing Tests Cover:
- Incident type keyword extraction and edge cases
- Severity and urgency mathematical scoring
- Conflicting report discrepancy detection (casualty count variances)
- Workload-aware fleet matching (not just closest, but available and capable)
- Trauma hospital capacity weighting and ICU availability
- Gap reporting when zero resources are nearby
- RAG TF-IDF knowledge base document retrieval
- Full multi-agent end-to-end integration
| Component | Status | Details |
|---|---|---|
| AI Agents | Real & Deterministic | 6 rule-based, explainable scoring agents; no hallucination or hidden logic |
| Geospatial Mapping | Real Coordinates | 3D globe coordinates mapped to real Pakistani cities & boundaries |
| Fleet Dispatch | Simulated | Fleet status updates in SQLite database; no real-world sirens triggered |
| Hospital Comms | Simulated | Logged to notifications table for operational demonstration |
| RAG Knowledge Base | Real Retrieval | TF-IDF vector retrieval over curated disaster response markdown manuals |
Built for emergency response decision-support and hackathon demonstrations.
Created by Team RescueAI // Tactical EOC Systems.