🌪️ ResilientFlow — Turning Disaster Chaos into 2-Minute Coordination

“With the right data in time, you save lives.”  — Every first-responder, ever


⚡ Inspiration

Growing up I was obsessed with the movie Twister: scientists racing a tornado to drop sensors into the funnel. They knew milliseconds of data could change life-or-death outcomes.

Fast-forward to 2025 and real disasters still rely on phone trees, spreadsheets, and human “air-traffic control.” I wanted to build a modern Dorothy—an AI swarm that collects data, thinks, and acts before first-responders buckle their helmets. That dream became ResilientFlow.


🧠 What I Learned

Lesson Why It Mattered
Agents-as-Tools > Micro-services Google’s Agent Development Kit (ADK) pushes a single reasoning brain that calls modular tools. This flattened my architecture from 5 Cloud Run services to one orchestrator + 5 Python functions.
Mock-first AI Training real satellite models wasn’t feasible in a hackathon. Instead I wrote behavior-accurate mocks and published a plug-in contract (vertex_ai_setup.py) so real models can drop in later.
Live UI on async back-end Visualizing agent chatter meant streaming Pub/Sub events into Streamlit with a background thread—while avoiding race conditions inside Docker.
Ruthless scoping I cut features (no fancy 3-D maps!) to ship a complete, end-to-end demo that meets every judging rubric.

🏗️ How It Was Built

flowchart TD
    Event[🌐 Disaster Data] --> Orc[🧠 ADK Orchestrator]
    subgraph Agent Tools
      A1[📡 Data Aggregator]
      A2[🗺️ Impact Assessor]
      A3[🚚 Resource Allocator]
      A4[📢 Comms Coordinator]
      A5[📄 Report Synthesizer]
    end
    Orc -->|step 1| A1 -->|2| A2 -->|3 (if severity ≥ 60)| A3
    A3 -->|parallel| A4 & A5
  • Central Orchestrator (orchestrator.py) Six-step workflow, conditional branching, parallel comms/reporting, full state tracking.
  • Five Agent Tools (agents/*.py)

    • Aggregator – mocks Vertex AI Vision to detect damage from satellite TIFFs
    • Assessor – clusters impact zones (BigQuery GIS-style mock)
    • Allocator – OR-Tools optimisation for 15 resources
    • Comms – Slack & Twilio; 4-language alerts; mock/live flag
    • Synthesizer – ReportLab PDF with exec summary + heat-map
  • Command Center (streamlit_app.py)

    • Live incident creator, metrics, Plotly analytics
    • Embedded agent-network graph (NetworkX → matplotlib)
    • Auto-refresh every 5 s to stay reactive
  • Infra-as-Code—Terraform + Cloud Build YAML deploy orchestrator & Pub/Sub.


🚧 Challenges & Solutions

Challenge Fix
“Why isn’t matplotlib drawing in Cloud Run?” Added RUN apt-get install -y fonts-dejavu in Dockerfile—missing fonts crash headless plots.
Circular asyncio errors in Streamlit Applied nest_asyncio, guarded workflow execution with a session flag, and used streamlit-autorefresh.
Too much to build, not enough time Focused on design & orchestration (core rubric) over training bespoke models. Provided clear hooks for future ML.

🌟 Current Impact

  • 8 s average end-to-end workflow
  • 15 resources allocated per scenario (optimised)
  • 108 K multilingual alerts pushed (Slack + SMS)
  • 4 languages supported by default

All reproducible via one command:

USE_MOCK=1 python -m streamlit run streamlit_app.py

🚀 What’s Next

  • Plug real Vertex AI models into Aggregator & Assessor
  • Stream live NOAA & NASA data feeds
  • On-call integration with emergency-service Slack workspaces
  • Open-source the framework so any community can spin up its own AI command center

📝 30-Second TL;DR

ResilientFlow turns hours-long disaster triage into two automated minutes: satellite data in → ADK orchestrator → 5 smart tools → resources, alerts, and reports out. Built in a week, production-ready in eight seconds, and ready to grow with real AI models.

Built With

Share this project:

Updates