Skip to content

About

A multi agent system for emergency management

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

Repository files navigation

Emergency AI System

An AI-driven multi-agent emergency management system designed to collect real-time disaster information, assess impact, allocate emergency resources, plan evacuation and response routes, and generate standardized emergency alerts.

The system integrates multiple specialized agents into a unified pipeline and provides the results through a web-based dashboard.

System Architecture

The emergency response pipeline consists of the following agents:

1. Data Collection Agent

Collects disaster-related information from multiple data sources.

The collected information can include:

  • Disaster location
  • Disaster type
  • Earthquake magnitude and depth
  • Latitude and longitude
  • Temperature
  • Humidity
  • Atmospheric pressure
  • Wind speed
  • Weather conditions
  • Rainfall
  • Water level
  • Social media reports
  • Emergency calls

The output of this agent is passed to the Damage Assessment Agent.

2. Damage Assessment Agent

Analyzes the collected disaster information and estimates the potential impact of the event.

Outputs include:

  • Damage score
  • Severity level
  • Estimated affected population
  • Geographic impact zones

The severity levels are categorized based on the calculated damage score.

3. Resource Allocation Agent

Determines the emergency resources required based on the damage assessment.

Resources may include:

  • Ambulances
  • Medical teams
  • Fire trucks
  • Police units
  • Helicopters
  • Emergency shelters

The agent also estimates the number of people that can be supported by the allocated resources.

4. CAP Alert Agent

Generates a standardized Common Alerting Protocol (CAP) XML alert using information produced by the previous agents.

The CAP alert contains information such as:

  • Disaster type
  • Location
  • Severity
  • Damage assessment
  • Affected population
  • Impact zones
  • Emergency instructions

Generated CAP alerts are saved for further distribution and processing.

5. Route Planning Agent

Determines recommended routes to nearby emergency facilities using OpenStreetMap road network data.

The agent uses OSMnx and NetworkX to:

  • Download nearby road networks
  • Discover hospitals, schools, and community centres
  • Calculate shortest paths
  • Estimate route distance
  • Estimate travel time
  • Rank available facilities
  • Generate a recommended route
  • Provide alternative routes

If no suitable road network or emergency facilities are available near a remote disaster location, the agent gracefully returns an empty route result without stopping the entire emergency pipeline.

6. EDXL Agent

Generates an Emergency Data Exchange Language (EDXL) message for emergency information exchange.

The EDXL message includes information such as:

  • Disaster location
  • Disaster type
  • Severity
  • Affected population
  • Damage score
  • Allocated emergency resources
  • Recommended evacuation routes

This allows emergency information to be represented using standardized emergency data exchange formats.

Multi-Agent Pipeline

The overall pipeline is:

Data Collection → Damage Assessment → Resource Allocation → Route Planning → CAP Alert Generation → EDXL Message Generation

The FastAPI backend exposes the complete pipeline through:

POST /pipeline

The pipeline returns:

  • Input disaster data
  • Damage assessment
  • Resource allocation
  • Route planning results
  • CAP XML alert
  • EDXL XML message

Technology Stack

Backend

  • Python
  • FastAPI
  • Uvicorn
  • OSMnx
  • NetworkX
  • Pandas
  • GeoPy
  • Machine Learning models

Frontend

  • React
  • Vite
  • Axios
  • Leaflet

External Data and Services

The system can integrate information from:

  • USGS earthquake data
  • Weather services
  • OpenStreetMap
  • PeopleSense occupancy data

Running the Backend

Navigate to the backend directory:

cd backend

Start the FastAPI server:

uvicorn main:app --reload

The backend will run at:

http://127.0.0.1:8000

FastAPI API documentation is available at:

http://127.0.0.1:8000/docs

Running the Frontend

Navigate to the frontend directory:

cd frontend

Install dependencies if required:

npm install

Start the development server:

npm run dev

Open the local URL displayed by Vite in the terminal.

API Endpoints

POST /pipeline

Runs the complete multi-agent emergency response pipeline.

GET /weather

Retrieves weather information collected by the Data Collection Agent.

GET /assess

Runs disaster data collection and damage assessment.

GET /occupancy-raw

Retrieves raw occupancy data from the PeopleSense integration.

GET /occupancy-summary

Retrieves summarized occupancy information from the PeopleSense integration.

Route Planning Error Handling

The Route Planning Agent dynamically searches for nearby road networks and emergency facilities.

To prevent the pipeline from failing for remote locations:

  • Road network searches use progressively larger search radii.
  • Road network data is cached when available.
  • Facility data is cached by location.
  • Missing OpenStreetMap facilities are handled gracefully.
  • The pipeline continues even when no recommended route can be generated.

Project Structure

Emergency-AI-System/
|
├── backend/
|   ├── agents/
|   |   ├── alert_agent/
|   |   ├── damage_assesment/
|   |   ├── datacollection/
|   |   ├── edxl_agent/
|   |   ├── resource_allocation/
|   |   └── route_planning/
|   |
|   ├── api/
|   ├── services/
|   ├── main.py
|   └── test_pipeline.py
|
├── frontend/
|   └── src/
|
└── README.md

Current Status

The multi-agent emergency response pipeline integrates data collection, AI-based damage assessment, resource allocation, route planning, CAP alert generation, and EDXL emergency message generation.

The backend is integrated with the React dashboard through the FastAPI /pipeline endpoint.

About

A multi agent system for emergency management

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages