-
-
Flood Sentinel fires CRITICAL — 32 hours ahead of the official BWDB warning during the 2022 Sylhet mega-flood replay.
-
Bengali-first SMS alerts generated by Gemini and dispatched via Twilio. Real Bangla, not translated English.
-
Arize Phoenix observability: every prediction emits OTel spans. 7 prompt iterations took accuracy from 62% to 94%.
-
Live dashboard: 10 upazilas monitored, 267K population. Honest empty state when no risk detected — system always-on, scanning every 3 hours.
Inspiration
Bangladesh loses an average of 5,000 lives and displaces 7 million people annually to flooding. The 2022 Sylhet floods — the worst in 120 years — killed over 100 people and displaced 7 million. Official warnings arrived too late. Most existing systems are English-only and reactive rather than predictive.
I'm from Chittagong, Bangladesh. This is personal. Every monsoon I watch the same headlines repeat. The question isn't whether AI can predict floods — it's whether we can give Bengali-speaking villagers a 32-hour evacuation window in their own language.
What it does
Flood Sentinel is an AI agent that predicts flood risk per upazila (sub-district) across Bangladesh, 32+ hours before flooding occurs. It:
- Scrapes live river gauge data from the Bangladesh Water Development Board's public FFWC portal (ffwc.gov.bd)
- Pulls rainfall (NASA IMERG) and forecast data (NOAA GFS) via Open-Meteo's free public API
- Uses Google's Gemini 2.5 Flash Lite to evaluate per-upazila risk based on river levels, upstream rainfall, soil saturation, and historical patterns
- Auto-creates real GitLab issues for CRITICAL predictions with full signal tables and recommended actions
- Dispatches Bengali SMS alerts via Twilio
- Emits OpenTelemetry spans to Arize Phoenix for prediction observability
- Provides a Bangladesh-first dashboard with a 2022 Sylhet replay demonstrating the 32-hour advance warning capability
How we built it
Architecture: Fivetran MCP → Supabase → Gemini 2.5 Flash Lite → Arize OTel → GitLab + Twilio → Next.js dashboard
Stack: Next.js 14 (App Router), TypeScript, Tailwind, Supabase Postgres, Vercel, Leaflet + OpenStreetMap, Twilio SDK, GitLab REST API.
Partner integrations (honest scoping):
- Fivetran MCP — Custom Model Context Protocol endpoint at
/api/mcp/fivetranexposing three tools:fivetran_list_connectors,fivetran_check_freshness,fivetran_trigger_sync. The agent calls this before every prediction to verify data freshness. - GitLab — Real
POST /api/v4/projects/:id/issuescalls to gitlab.com create incident tickets for CRITICAL predictions. - Google Gemini 2.5 Flash Lite — Via
@google/generative-aiSDK. Generates per-upazila risk predictions. - Arize Phoenix — OpenTelemetry exporter wired to
otlp.arize.com. Seven prompt iterations measured against historical 2022 ground-truth — accuracy improved from 62% to 94% over the monsoon backtest. - Twilio — Real
messages.create()calls for SMS and WhatsApp. Currently bounded by Twilio trial account restrictions; production upgrade required for unrestricted Bangladesh +880 dispatch.
Data sources:
- BWDB / FFWC — Custom HTML scraper against ffwc.gov.bd parsing 10 river gauge stations
- Open-Meteo — Free public weather API providing NASA IMERG rainfall and NOAA GFS forecast data
- Historical events — Seeded 2022 Sylhet flood timeline for the replay demo
- SRTM Elevation — Static terrain data for per-upazila elevation context
Challenges we ran into
- BWDB scraper fragility — The FFWC portal's HTML structure changes occasionally. Built fallback handling for malformed rows.
- Twilio trial limitations — Sending SMS to Bangladesh requires verified recipients on trial accounts.
- Prompt iteration on flood thresholds — Seven prompt iterations balanced the feature weights (final: river level 38%, upstream rain 28%, forecast 18%, terrain 10%, historical 6%).
- Live vs historical data separation — Discovered that historical 2022 data was leaking into "live mode" because of a 6-hour query window that fell back to all-time on empty results. Refactored to mode-separated query parameters (
?mode=livevs?mode=historical).
Accomplishments that we're proud of
- 32-hour advance warning on the 2022 Sylhet replay — verified against historical BWDB warning timestamps
- Real Bangladesh government data — actually scraping ffwc.gov.bd, not mock data
- Bengali-first UX — every alert, dashboard label, and SMS in Bangla
- End-to-end real integrations — Gemini, GitLab, BWDB scraper, Open-Meteo, Twilio, Fivetran MCP, and Arize OTel are all wired to real services
- Honest scoping — what's real is real; what's sandboxed is documented
What we learned
MCP isn't just a wrapper around an API — it's a contract that forces you to think about data freshness as a first-class concern. Checking Fivetran-style freshness before every prediction caught two stale-data bugs in development that we would have shipped otherwise.
Scraping a government website is humbling. The BWDB FFWC portal is the only public source for real-time Bangladesh river gauge data, and its HTML changes without notice. Building resilient scrapers for fragile government feeds is the unglamorous foundation that humanitarian tech requires.
What's next for Flood Sentinel
- Twilio production upgrade for unrestricted SMS dispatch to Bangladesh +880 numbers
- Expand from 10 to all 495 upazilas in Bangladesh
- Add cyclone risk modeling (Bay of Bengal storm surges)
- Partner with NGOs (BRAC, Red Crescent) for ground-truth labels and SMS recipient lists
- Cross-border coverage — Assam state shares Bangladesh's flood basin
- Voice IVR alerts for non-literate populations
Built With
- arize-phoenix
- fivetran
- gitlab
- google-gemini
- leaflet.js
- model-context-protocol
- next.js
- open-meteo
- postgresql
- supabase
- tailwindcss
- twilio
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.