# samin1554/wildfire-evidence-agent architecture

> Architecture diagram of the GitHub repository samin1554/wildfire-evidence-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/samin1554/wildfire-evidence-agent
- Repository: https://github.com/samin1554/wildfire-evidence-agent

## Overview

Wildfire Evidence Agent lets a user draw an area, ask a time-bounded wildfire question, and receive a cited report with evidence and map layers. The main path runs from the web UI through Go validation and job creation, into the Python worker’s agent and deterministic geospatial processing, then back through stored results and live progress to the browser. README capabilities also include national active-fire clusters and satellite burn/vegetation overlays. The source excerpts establish key orchestration and client links; unsampled API handlers, agent internals and activity implementation limit some arrows, which are therefore omitted.

Main entry points: [`apps/web/src/app/App.tsx`](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/app/App.tsx) (Analysis workspace), [`apps/web/src/api/client.ts`](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/api/client.ts) (API client), [`apps/api/internal/httpapi/router.go`](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/httpapi/router.go) (HTTP routes), [`apps/worker/src/inland_worker/jobs/pipeline.py`](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/jobs/pipeline.py) (Job pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Analysis workspace<br/>[App.tsx]"]
  node_analysis_ui["Analysis controls<br/>[useAnalysis.ts]"]
  node_api_client["API client<br/>[client.ts]"]
  node_map["Map and overlays<br/>[MapView.tsx]"]
  node_report_ui["Report and evidence<br/>[components.tsx]"]
  node_activity_ui["Active detections<br/>[ActivityPanel.tsx]"]
end

subgraph group_api["API and job access"]
  node_http["HTTP routes<br/>[router.go]"]
  node_validation["Request validation<br/>[analyses.go]"]
  node_job_store[("Job and result store<br/>[store.go]")]
  node_queue["Redis job streams<br/>[queue.go]"]
end

subgraph group_worker["Analysis worker"]
  node_worker_runtime["Worker runtime<br/>[__main__.py]"]
  node_pipeline["Job pipeline<br/>[pipeline.py]"]
  node_agent["Evidence agent<br/>[graph.py]"]
  node_llm["Language model<br/>[llm.py]"]
  node_contracts["Evidence contracts<br/>[models.py]"]
end

subgraph group_data["Evidence and geospatial data"]
  node_data_service["Data service<br/>[service.py]"]
  node_registry["Provider registry<br/>[registry.py]"]
  node_connectors["Fire, weather, imagery sources"]
  node_http_kit["Provider HTTP kit<br/>[http.py]"]
  node_imagery["Satellite imagery reader<br/>[imagery.py]"]
  node_satellite["Burn and NDVI analysis"]
  node_activity["Detection clustering<br/>[cluster.py]"]
end

node_user(("Analyst"))
node_external_sources["Fire, weather, satellite providers"]
node_openrouter["OpenRouter"]

node_user -->|"draws and asks"| node_app
node_app -->|"starts analysis"| node_analysis_ui
node_app -->|"shows area and layers"| node_map
node_app -->|"renders results"| node_report_ui
node_app -->|"shows activity"| node_activity_ui
node_analysis_ui -->|"calls API"| node_api_client
node_api_client -->|"sends requests"| node_http
node_http -->|"routes analyses"| node_validation
node_validation -->|"creates job"| node_job_store
node_validation -->|"enqueues job"| node_queue
node_worker_runtime -->|"runs jobs"| node_pipeline
node_pipeline -->|"runs analysis"| node_agent
node_pipeline -.->|"stores results"| node_job_store
node_pipeline -->|"uses evidence models"| node_contracts
node_agent -.->|"retrieves evidence"| node_data_service
node_agent -.->|"plans and explains"| node_llm
node_llm -->|"requests completion"| node_openrouter
node_data_service -->|"resolves providers"| node_registry
node_registry -->|"selects connector"| node_connectors
node_data_service -->|"fetches providers"| node_http_kit
node_http_kit -.->|"requests source data"| node_external_sources
node_connectors -.->|"queries providers"| node_external_sources
node_satellite -->|"reads scene pixels"| node_imagery
node_data_service -.->|"loads imagery scenes"| node_imagery
node_worker_runtime -.->|"runs activity feed"| node_activity
node_activity_ui -->|"loads activity"| node_api_client
node_map -.->|"requests layers"| node_api_client
node_http -.->|"reads job results"| node_job_store
node_http -.->|"streams progress and results"| node_api_client

click node_app "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/app/App.tsx"
click node_analysis_ui "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/analysis/useAnalysis.ts"
click node_api_client "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/api/client.ts"
click node_map "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/map/MapView.tsx"
click node_report_ui "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/analysis/components.tsx"
click node_activity_ui "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/activity/ActivityPanel.tsx"
click node_http "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/httpapi/router.go"
click node_validation "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/httpapi/analyses.go"
click node_job_store "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/store/store.go"
click node_queue "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/queue/queue.go"
click node_worker_runtime "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/__main__.py"
click node_pipeline "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/jobs/pipeline.py"
click node_agent "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/agent/graph.py"
click node_llm "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/agent/llm.py"
click node_contracts "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/contracts/models.py"
click node_data_service "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/data/service.py"
click node_registry "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/connectors/registry.py"
click node_connectors "https://github.com/samin1554/wildfire-evidence-agent/tree/main/apps/worker/src/inland_worker/connectors"
click node_http_kit "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/kit/http.py"
click node_imagery "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/kit/imagery.py"
click node_satellite "https://github.com/samin1554/wildfire-evidence-agent/tree/main/apps/worker/src/inland_worker/satellite"
click node_activity "https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/activity/cluster.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_analysis_ui,node_api_client,node_map,node_report_ui,node_activity_ui toneBlue
class node_http,node_validation,node_job_store,node_queue toneAmber
class node_worker_runtime,node_pipeline,node_agent,node_llm,node_contracts,node_openrouter toneMint
class node_data_service,node_registry,node_connectors,node_http_kit,node_imagery,node_satellite,node_activity toneRose
class node_user,node_external_sources toneIndigo
```

## Components

### Web experience

- [Analysis workspace](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/app/App.tsx): `apps/web/src/app/App.tsx`
- [Analysis controls](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/analysis/useAnalysis.ts): `apps/web/src/analysis/useAnalysis.ts`
- [API client](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/api/client.ts): `apps/web/src/api/client.ts`
- [Map and overlays](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/map/MapView.tsx): `apps/web/src/map/MapView.tsx`
- [Report and evidence](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/analysis/components.tsx): `apps/web/src/analysis/components.tsx`
- [Active detections](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/web/src/activity/ActivityPanel.tsx): `apps/web/src/activity/ActivityPanel.tsx`

### API and job access

- [HTTP routes](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/httpapi/router.go): `apps/api/internal/httpapi/router.go`
- [Request validation](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/httpapi/analyses.go): `apps/api/internal/httpapi/analyses.go`
- [Job and result store](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/store/store.go): `apps/api/internal/store/store.go`
- [Redis job streams](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/api/internal/queue/queue.go): `apps/api/internal/queue/queue.go`

### Analysis worker

- [Worker runtime](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/__main__.py): `apps/worker/src/inland_worker/__main__.py`
- [Job pipeline](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/jobs/pipeline.py): `apps/worker/src/inland_worker/jobs/pipeline.py`
- [Evidence agent](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/agent/graph.py): `apps/worker/src/inland_worker/agent/graph.py`
- [Language model](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/agent/llm.py): `apps/worker/src/inland_worker/agent/llm.py`
- [Evidence contracts](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/contracts/models.py): `apps/worker/src/inland_worker/contracts/models.py`

### Evidence and geospatial data

- [Data service](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/data/service.py): `apps/worker/src/inland_worker/data/service.py`
- [Provider registry](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/connectors/registry.py): `apps/worker/src/inland_worker/connectors/registry.py`
- [Fire, weather, imagery sources](https://github.com/samin1554/wildfire-evidence-agent/tree/main/apps/worker/src/inland_worker/connectors): `apps/worker/src/inland_worker/connectors`
- [Provider HTTP kit](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/kit/http.py): `apps/worker/src/inland_worker/kit/http.py`
- [Satellite imagery reader](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/kit/imagery.py): `apps/worker/src/inland_worker/kit/imagery.py`
- [Burn and NDVI analysis](https://github.com/samin1554/wildfire-evidence-agent/tree/main/apps/worker/src/inland_worker/satellite): `apps/worker/src/inland_worker/satellite`
- [Detection clustering](https://github.com/samin1554/wildfire-evidence-agent/blob/main/apps/worker/src/inland_worker/activity/cluster.py): `apps/worker/src/inland_worker/activity/cluster.py`

### Other components

- **Analyst**
- **Fire, weather, satellite providers**
- **OpenRouter**

## Connections

- Analyst → Analysis workspace: draws and asks (evidence: `README.md`)
- Analysis workspace → Analysis controls: starts analysis (evidence: `apps/web/src/app/App.tsx`)
- Analysis workspace → Map and overlays: shows area and layers (evidence: `apps/web/src/app/App.tsx`)
- Analysis workspace → Report and evidence: renders results (evidence: `apps/web/src/app/App.tsx`)
- Analysis workspace → Active detections: shows activity (evidence: `apps/web/src/app/App.tsx`)
- Analysis controls → API client: calls API (evidence: `apps/web/src/analysis/useAnalysis.ts`)
- API client → HTTP routes: sends requests (evidence: `apps/web/src/api/client.ts`)
- HTTP routes → Request validation: routes analyses (evidence: `apps/api/internal/httpapi/router.go`)
- Request validation → Job and result store: creates job (evidence: `apps/api/internal/httpapi/analyses.go`)
- Request validation → Redis job streams: enqueues job (evidence: `apps/api/internal/httpapi/analyses.go`)
- Worker runtime → Job pipeline: runs jobs (evidence: `apps/worker/src/inland_worker/__main__.py`)
- Job pipeline → Evidence agent: runs analysis (evidence: `apps/worker/src/inland_worker/jobs/pipeline.py`)
- Job pipeline → Job and result store: stores results
- Job pipeline → Evidence contracts: uses evidence models (evidence: `apps/worker/src/inland_worker/jobs/pipeline.py`)
- Evidence agent → Data service: retrieves evidence
- Evidence agent → Language model: plans and explains
- Language model → OpenRouter: requests completion (evidence: `apps/worker/src/inland_worker/agent/llm.py`)
- Data service → Provider registry: resolves providers (evidence: `apps/worker/src/inland_worker/data/service.py`)
- Provider registry → Fire, weather, imagery sources: selects connector (evidence: `apps/worker/src/inland_worker/connectors/registry.py`)
- Data service → Provider HTTP kit: fetches providers (evidence: `apps/worker/src/inland_worker/data/service.py`)
- Provider HTTP kit → Fire, weather, satellite providers: requests source data
- Fire, weather, imagery sources → Fire, weather, satellite providers: queries providers
- Burn and NDVI analysis → Satellite imagery reader: reads scene pixels (evidence: `apps/worker/src/inland_worker/satellite/overlay.py`)
- Data service → Satellite imagery reader: loads imagery scenes
- Worker runtime → Detection clustering: runs activity feed
- Active detections → API client: loads activity (evidence: `apps/web/src/activity/ActivityPanel.tsx`)
- Map and overlays → API client: requests layers
- HTTP routes → Job and result store: reads job results
- HTTP routes → API client: streams progress and results
