Skip to content

Commit 452a69c

Browse files
docs: architecture README, phased roadmap, phase 0 notes
1 parent 0c2fa58 commit 452a69c

3 files changed

Lines changed: 133 additions & 0 deletions

File tree

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Aegis — Event-Driven Disaster Intelligence Pipeline
2+
3+
[![CI](https://github.com/VenkateswarluNagineni/aegis-disaster-intel/actions/workflows/ci.yml/badge.svg)](https://github.com/VenkateswarluNagineni/aegis-disaster-intel/actions/workflows/ci.yml)
4+
[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/)
5+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
6+
7+
Ingests **live public hazard feeds** (wildfires, earthquakes, severe weather), enriches
8+
each event with an **agentic LLM workflow**, scores **geospatial risk**, and serves a
9+
**RAG query layer** so an analyst can ask "what's escalating near these assets right now?"
10+
11+
Ingestion is **event-driven** — feeds fire updates that trigger processing — not naive
12+
polling, with **change-detection and dedup** so the same event isn't reprocessed or
13+
double-counted.
14+
15+
> Why it exists: disaster response needs *fresh, deduplicated, enriched, location-aware*
16+
> signal. This pipeline mirrors that end to end on real open data.
17+
18+
## Architecture
19+
20+
```mermaid
21+
flowchart LR
22+
subgraph Sources
23+
F[NASA FIRMS<br/>active fires]
24+
Q[USGS<br/>earthquakes]
25+
W[NOAA / NWS<br/>alerts]
26+
end
27+
F & Q & W --> ING[Event-driven ingestors<br/>change-detection + dedup]
28+
ING --> N[Normalize to<br/>HazardEvent schema]
29+
N --> EN[Agentic enrichment<br/>LangChain: geocode, classify,<br/>summarize, severity]
30+
EN --> GEO[Geospatial risk scoring<br/>haversine / H3, asset proximity]
31+
GEO --> ST[(Store: events +<br/>FAISS vector index)]
32+
ST --> RAG[RAG query API<br/>'what's escalating near X?']
33+
AF[Airflow] -. schedules backfills & sweeps .-> ING
34+
```
35+
36+
## What makes it different
37+
38+
- **Event-driven, not polling** — change-detection on feed state; only new/changed events flow.
39+
- **Agentic enrichment** — an LLM workflow geocodes, classifies hazard type, estimates
40+
severity, and writes an analyst-ready summary, with validation guards.
41+
- **Geospatial-first** — proximity-to-asset risk scoring, not just a table of rows.
42+
- **RAG over live events** — natural-language situational queries with citations.
43+
44+
## Tech stack
45+
46+
`Python 3.11` · `LangChain` (agentic enrichment) · `FAISS` · `GeoPandas / H3` ·
47+
`Airflow` · real APIs: `NASA FIRMS`, `USGS`, `NOAA/NWS` · `Docker`
48+
49+
## Status
50+
51+
🚧 Built in public, in phases — see **[ROADMAP.md](ROADMAP.md)**. Each phase ships tested
52+
code + a design note in [`docs/`](docs/).
53+
54+
## Quickstart
55+
56+
```bash
57+
pip install -e ".[dev]"
58+
pytest
59+
```
60+
61+
## License
62+
63+
MIT © Venkateswarlu Nagineni

ROADMAP.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Aegis Roadmap
2+
3+
Built in public, one phase at a time. Each phase ships tested code + a `docs/NOTES_<phase>.md`
4+
design note. The daily build routine picks up the next unchecked phase.
5+
6+
> Convention: `[ ]` not started · `[~]` in progress · `[x]` done.
7+
8+
## Foundations
9+
- [x] **Phase 0 — Scaffold.** Packaging, geospatial risk primitives (haversine,
10+
distance-decay proximity, asset risk), canonical `HazardEvent` schema + dedup key,
11+
tests, ruff, CI, Docker skeleton, roadmap.
12+
- [ ] **Phase 1 — USGS earthquake ingestor.** Pull the GeoJSON feed, normalize to
13+
`HazardEvent`, tests against a recorded fixture.
14+
- [ ] **Phase 2 — NASA FIRMS wildfire ingestor.** Active-fire feed → `HazardEvent`
15+
(handles FRP/confidence fields).
16+
- [ ] **Phase 3 — NOAA / NWS alerts ingestor.** Severe-weather alerts → `HazardEvent`.
17+
18+
## Event-driven core
19+
- [ ] **Phase 4 — Change-detection + dedup store.** State by `dedup_key`; only new/changed
20+
events advance (no reprocessing).
21+
- [ ] **Phase 5 — Event-driven trigger layer.** Feed-state hashing → emit only on change,
22+
replacing naive polling.
23+
- [ ] **Phase 6 — Airflow orchestration.** Scheduled sweeps + backfill DAGs with retries.
24+
25+
## Enrichment & scoring
26+
- [ ] **Phase 7 — Agentic enrichment workflow.** LangChain pipeline: reverse-geocode,
27+
classify hazard subtype, estimate severity, write analyst summary — with output
28+
validation/guards.
29+
- [ ] **Phase 8 — Geospatial risk scoring.** Asset registry + proximity risk; H3 cells
30+
for spatial bucketing and aggregation.
31+
- [ ] **Phase 9 — Severity model.** Calibrated severity/escalation score combining
32+
magnitude, trend, and proximity.
33+
34+
## Retrieval & serving
35+
- [ ] **Phase 10 — Embedding + FAISS index.** Embed enriched events for semantic search.
36+
- [ ] **Phase 11 — RAG query API (FastAPI).** "What's escalating near <area>?" with
37+
cited source events.
38+
- [ ] **Phase 12 — Situational dashboard.** Map view, escalation feed, asset risk table.
39+
40+
## Hardening & polish
41+
- [ ] **Phase 13 — Backfill + replay tooling.** Reconstruct state from history.
42+
- [ ] **Phase 14 — Rate-limit & resilience.** Backoff, caching, partial-feed handling.
43+
- [ ] **Phase 15 — Dockerized demo + sample feeds.** One-command reproducible run.
44+
- [ ] **Phase 16 — Architecture deep-dive + demo GIF.** Recruiter-ready walkthrough.

docs/NOTES_phase0.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Phase 0 — Scaffold (design notes)
2+
3+
## What landed
4+
- `src/` package `aegis` with two real, tested pieces:
5+
- `geo.py`: haversine great-circle distance + a **distance-decay proximity risk** score
6+
(exponential, `radius_km` = one e-folding). Validated against the known College
7+
Station→Austin distance (~135 km).
8+
- `schema.py`: canonical `HazardEvent` with a **`dedup_key`** property — the foundation
9+
of change-detection (phase 4).
10+
- ruff + pytest CI green from commit one.
11+
12+
## Decisions & trade-offs
13+
- **`dedup_key` from day zero.** The whole "event-driven, not polling" thesis depends on
14+
knowing when an event is the *same* event. Baking the dedup identity into the schema
15+
forces every ingestor to declare it.
16+
- **Distance-decay over a hard radius.** A binary "within 50 km" flag throws away signal;
17+
exponential decay gives a smooth, explainable risk that ranks assets sensibly.
18+
- **Pure-numpy/math core, geo libs later.** GeoPandas/H3/Shapely are heavy; the core risk
19+
math doesn't need them, so CI stays fast and the math stays readable. They arrive in
20+
phase 8 for polygon ops and spatial indexing.
21+
- **Agentic enrichment with guards (phase 7).** LLM enrichment is powerful but must be
22+
validated — the plan treats schema-validated, guarded output as non-negotiable.
23+
24+
## Next
25+
Phase 1: the USGS earthquake ingestor (cleanest public GeoJSON feed) → first real
26+
`HazardEvent` records flowing through the schema.

0 commit comments

Comments
 (0)