-
-
Airplane mode: no internet, Gemini Nano reads the message on the laptop
-
Real 2015 night replayed: 520 real posts become one ranked list
-
One pregnant woman in Mudichur posted 12 times: one request, with the points that rank it
-
Accuracy on 60 real posts (an initial check; labels made with the AI assistant)
-
Real flood test: 216 requests, 68 critical, 0 phone numbers invented
-
What Firestore actually stores: ciphertext only
-
A detail Gemini gave that was not in the message: shown, not used
-
Two volunteers took the same family: both are warned
-
Fake rescue post asking for money: verify first
-
Security: every threat, what FloodLine does, how it is checked
Inspiration
In the 2015 Chennai floods (and again in 2023, 2024 and 2025) phone lines went down and rescue requests moved to Twitter and WhatsApp. Volunteers read them by hand, all night: the same family posted twelve times by different relatives, helpline lists mixed in with real cries for help, and requests nobody picked up scrolled out of sight. In the 2018 Kerala floods volunteers built keralarescue.in, which the state adopted. FloodLine is a smaller attempt at the same idea, for the way requests actually arrive in Chennai: as messy free-text posts, not forms.
What it does
Volunteers paste the messages. FloodLine:
- Reads each one. Offline rules pull out the phone number, area (54 Chennai localities, English / Tanglish / Tamil spellings), people, water level and who is vulnerable. Then Gemini re-reads it through Firebase AI Logic, on the laptop with Gemini Nano when Chrome has it, or in the cloud otherwise.
- Checks the AI. A phone number must appear in the message, an area must be a real locality, an address must be words from the message. Anything else is dropped and shown.
- Never lets the AI hide a request. If the rules read a request and the AI disagrees, it stays on the list, marked "check", for a person to decide.
- Groups repeats (same phone or same address) and says why.
- Orders by urgency with readable points (pregnant +40, medical +40, neck-deep water +35, baby +25...). Time-critical families are never shown below "critical". The order is advice; people decide.
- Shows how exact the location is (door and street / street / area only / unknown) and asks for the address to be confirmed on a call before a boat goes.
- Keeps track: unclaimed for 45 min, no update for 90 min, "we are safe" posts, two volunteers taking the same family. Closing a critical request asks how it was confirmed.
- Works as a team on one end-to-end encrypted board, and works in airplane mode.
Tested on the real 2015 flood (a replay, not a deployment)
I took a public CC0 archive of #ChennaiFloods tweets (34,717 texts from 2–3 December 2015) and kept the 520 posts that mention being stuck or rescue and contain a phone number. Names and every number were replaced by a script. The app replays them at the minute they were posted. Gemini read all 520:
- 216 requests on the list from 325 posts. One pregnant woman in Mudichur posted 12 times; she is one request.
- 68 critical (17 pregnant, 23 with a baby, 15 needing medical care).
- 59 groups the AI thinks are helplines: kept at the bottom and marked for checking, never hidden.
- 0 phone numbers invented by Gemini.
On 60 of those posts, labelled field by field: the board gets 89.9% of details right with cloud Gemini (Gemini's own reading 95.2%), 79.8% with Gemini Nano on the laptop, 81.1% with rules alone. Honest caveat: these labels were made with the AI assistant that helped build FloodLine, so this is a first check; I am labelling the 60 posts myself (blind) on the app's labelling page. Every number is recomputed from the repository by one command.
Works when the network doesn't
I tested this on the live site with the network cut from the very start: the app loads from its service worker in about 3 seconds, Gemini Nano starts in the background, and messages are read on the laptop in about 7 seconds each, with nothing leaving the device. With no model at all, the rules still fill the board.
Security
A rescue board holds the phone numbers of families in danger, so:
- End-to-end encrypted shared board. An 80-bit group code becomes an AES-256-GCM key on each device (PBKDF2, 310,000 rounds). Firestore only stores ciphertext. Firestore rules are append-only; I tested edit, delete, impersonation, fake timestamps and plaintext writes live, and all were denied.
- Firebase App Check (reCAPTCHA Enterprise) on the Gemini calls and on sign-in: scripts without it are refused.
- Lost phone or leaked code: "Move to a new group code" re-keys the board; "Forget this board" wipes it from the device.
- Scam and phishing flags: money / UPI / OTP asks in English and Tamil, look-alike relief sites, shortened links, .apk downloads. They say "verify first", never "safe".
- Locked handover file: AES-256-GCM with a passphrase; one changed byte is refused.
How I built it
A static web app (no build step) on GitHub Pages; an event log where the board is rebuilt from events, so devices sync by exchanging encrypted events. Firebase AI Logic with InferenceMode.PREFER_ON_DEVICE (Gemini Nano via Chrome's Prompt API, cloud fallback 3.6 Flash → 3.5 Flash → 3.1 Flash-Lite), one JSON schema both ways. Python scripts for the 2015 data. 33 unit tests on GitHub Actions.
Who built what: I chose the problem and made the product decisions, what to measure, what to cut, and directed the testing. Most of the code, the data scripts and the first labels were written by an AI coding assistant (Claude Code) working from those decisions. FloodLine was started from scratch on 13 November 2026; no code existed before.
Challenges
- An audit of my own numbers. An earlier version claimed Gemini "made up" phone numbers 103 times. When I audited it, almost all of those came from a bug in my anonymisation script, not the AI. I fixed the script, re-ran Gemini on all 520 posts and corrected every claim. The real number is 0.
- Letting the AI help without letting it decide. The AI could relabel a real request as an "offer" and hide it. Now it can only add a "check" mark.
- Gemini Nano's first start takes about a minute on a laptop, which looked like a freeze in airplane mode. It now starts in the background when the page opens.
Accomplishments I'm proud of
- It works end to end on real 2015 posts, offline, on one encrypted board shared between devices.
- Every number on this page can be reproduced from the repository, including the mistakes I found and fixed.
What I learned
That being honest about limits is a feature: a volunteer needs to know how exact a location is and why a request is ranked first. And that "the AI read it" is not the same as "the AI got it right"; you have to check every answer against the message.
What's next
- A drill with a Chennai volunteer group before the next monsoon.
- Individual volunteer accounts and roles; encrypting the board stored on the phone.
- Reading voice notes and photos of handwritten notes (Gemini Nano multimodal).
- Independent human labels for all 520 posts.
Limits, plainly: not yet used in a real flood; locations are area centres unless an address is given; Tamil is handled but barely evaluated.
Built With
- chrome-prompt-api
- css3
- firebase
- firebase-ai-logic
- firebase-app-check
- firestore
- gemini
- gemini-nano
- github
- github-actions
- html5
- javascript
- leaflet.js
- openstreetmap
- python
- recaptcha-enterprise
- service-worker
- web-crypto