# anish-000/disaster-response-ai-agent architecture

> Architecture diagram of the GitHub repository anish-000/disaster-response-ai-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anish-000/disaster-response-ai-agent
- Repository: https://github.com/anish-000/disaster-response-ai-agent

## Overview

Disaster Advisor is a location-aware disaster assessment dashboard. A user submits a place or coordinates; the Streamlit app resolves the location, gathers hazard and nearby-resource data, computes six hazard severities and an overall risk, then presents maps, routes, hazard details, an action plan, and a JSON report. The app orchestrates these stages; pure risk logic and geographic helpers form the internal decision layer. README documents dashboard and export capabilities not fully visible in the sampled excerpts, so their wiring is shown only where supported.

Main entry points: [`app.py`](https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py) (Streamlit app), [`api_clients.py`](https://github.com/anish-000/disaster-response-ai-agent/blob/main/api_clients.py) (API clients), [`ai_summary.py`](https://github.com/anish-000/disaster-response-ai-agent/blob/main/ai_summary.py) (Gemini summary), [`risk_engine.py`](https://github.com/anish-000/disaster-response-ai-agent/blob/main/risk_engine.py) (Risk engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Assessment workflow"]
  node_app["Streamlit app<br/>[app.py]"]
  node_assessment["Location assessment<br/>[app.py]"]
end

subgraph group_integrations["External data"]
  node_api["API clients<br/>[api_clients.py]"]
  node_usgs["USGS earthquakes"]
  node_openmeteo["Open-Meteo weather"]
  node_geoapify["Geoapify services"]
  node_overpass["Overpass coastline"]
  node_ai["Gemini summary<br/>[ai_summary.py]"]
  node_gemini["Gemini API"]
end

subgraph group_decision["Decision and geography"]
  node_risk["Risk engine<br/>[risk_engine.py]"]
  node_config["Threshold config<br/>[config.py]"]
  node_geo["Geo helpers<br/>[geo_utils.py]"]
end

subgraph group_presentation["User outputs"]
  node_dashboard["Risk dashboard<br/>[app.py]"]
  node_maps["Interactive maps<br/>[app.py]"]
  node_directions["Route links<br/>[geo_utils.py]"]
  node_report["JSON report<br/>[app.py]"]
end

node_user(("Location seeker"))

node_user -->|"submits location"| node_app
node_app -->|"requests location data"| node_api
node_api -->|"geocodes and finds resources"| node_geoapify
node_api -->|"fetches earthquakes"| node_usgs
node_api -->|"fetches weather"| node_openmeteo
node_api -->|"checks coastline"| node_overpass
node_api -->|"calculates distances and routes"| node_geo
node_app -->|"scores hazards and plans"| node_risk
node_risk -->|"reads thresholds"| node_config
node_app -->|"builds route links"| node_geo
node_app -->|"assembles results"| node_assessment
node_app -.->|"optionally summarizes plan"| node_ai
node_ai -.->|"sends action plan"| node_gemini
node_assessment -->|"renders findings"| node_dashboard
node_dashboard -->|"displays location map"| node_maps
node_dashboard -->|"shows route links"| node_directions
node_dashboard -->|"offers JSON export"| node_report
node_dashboard -->|"presents guidance"| node_user

click node_app "https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py"
click node_api "https://github.com/anish-000/disaster-response-ai-agent/blob/main/api_clients.py"
click node_risk "https://github.com/anish-000/disaster-response-ai-agent/blob/main/risk_engine.py"
click node_config "https://github.com/anish-000/disaster-response-ai-agent/blob/main/config.py"
click node_geo "https://github.com/anish-000/disaster-response-ai-agent/blob/main/geo_utils.py"
click node_ai "https://github.com/anish-000/disaster-response-ai-agent/blob/main/ai_summary.py"
click node_dashboard "https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py"
click node_maps "https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py"
click node_directions "https://github.com/anish-000/disaster-response-ai-agent/blob/main/geo_utils.py"
click node_report "https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py"
click node_assessment "https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_assessment toneBlue
class node_api,node_usgs,node_openmeteo,node_geoapify,node_overpass,node_ai,node_gemini toneAmber
class node_risk,node_config,node_geo toneMint
class node_dashboard,node_maps,node_directions,node_report toneRose
class node_user toneIndigo
```

## Components

### Assessment workflow

- [Streamlit app](https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py): `app.py`
- [Location assessment](https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py): `app.py`

### External data

- [API clients](https://github.com/anish-000/disaster-response-ai-agent/blob/main/api_clients.py): `api_clients.py`
- **USGS earthquakes**
- **Open-Meteo weather**
- **Geoapify services**
- **Overpass coastline**
- [Gemini summary](https://github.com/anish-000/disaster-response-ai-agent/blob/main/ai_summary.py): `ai_summary.py`
- **Gemini API**

### Decision and geography

- [Risk engine](https://github.com/anish-000/disaster-response-ai-agent/blob/main/risk_engine.py): `risk_engine.py`
- [Threshold config](https://github.com/anish-000/disaster-response-ai-agent/blob/main/config.py): `config.py`
- [Geo helpers](https://github.com/anish-000/disaster-response-ai-agent/blob/main/geo_utils.py): `geo_utils.py`

### User outputs

- [Risk dashboard](https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py): `app.py`
- [Interactive maps](https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py): `app.py`
- [Route links](https://github.com/anish-000/disaster-response-ai-agent/blob/main/geo_utils.py): `geo_utils.py`
- [JSON report](https://github.com/anish-000/disaster-response-ai-agent/blob/main/app.py): `app.py`

### Other components

- **Location seeker**

## Connections

- Location seeker → Streamlit app: submits location
- Streamlit app → API clients: requests location data
- API clients → Geoapify services: geocodes and finds resources
- API clients → USGS earthquakes: fetches earthquakes
- API clients → Open-Meteo weather: fetches weather
- API clients → Overpass coastline: checks coastline
- API clients → Geo helpers: calculates distances and routes
- Streamlit app → Risk engine: scores hazards and plans
- Risk engine → Threshold config: reads thresholds
- Streamlit app → Geo helpers: builds route links
- Streamlit app → Location assessment: assembles results
- Streamlit app → Gemini summary: optionally summarizes plan
- Gemini summary → Gemini API: sends action plan
- Location assessment → Risk dashboard: renders findings
- Risk dashboard → Interactive maps: displays location map
- Risk dashboard → Route links: shows route links
- Risk dashboard → JSON report: offers JSON export
- Risk dashboard → Location seeker: presents guidance
