Inspiration
On August 26, 2026, a high-altitude ice-rock collapse just inside Nepal, at the head of a tributary of the Lende Khola, sent a debris flow through Tibet's Gyirong port and back into Nepal's Rasuwa district along the Bhote Koshi and Trishuli. It wiped out the Timure market and the Rasuwagadhi customs area, bridges and about 200 MW of hydropower. By August 31, Nepal's disaster authority had recorded 939 bodies recovered and 3,925 people missing.
What struck us was the timing. Seismometers recorded the collapse at 08:37 (USGS event us7000tbwb). The flood re-entered Nepal between about 09:00 and 09:15. The flood crossed the border twice, and no system is reported to have turned that upstream signal into alerts for the people downstream.
What it does
Upstream Alert is a prototype upstream-triggered flood warning system, demonstrated by replaying the August 26 event. It is a replay of a past event, not an operational warning system.
- Trigger: watches for any seismic event of magnitude 4 or more within 30 km of the Lende Khola, the upstream river.
- Arrival windows: estimates the earliest and latest time the flood reaches each of 8 villages along an 80 km flood path, from Rasuwa Gadhi at the border down to Bidur.
- Alerts: an LLM writes a short alert for each village in English and Nepali. Every number in an alert must match the routing output; a validator rejects and regenerates any alert that doesn't.
- Map replay: a live map shows the signal, the flood moving downstream, each village's countdown, and its validated alert with the time it was sent.
How we built it
- Data pipeline (Python, standard library only): river lines and village locations from OpenStreetMap via the Overpass API. We build a graph of the river network, find the shortest path down the Lende Khola, Bhote Koshi and Trishuli, snap each village to it and measure distance along the river. The collapse site is on a small tributary that isn't mapped, so the path starts with a 10 km straight-line leg in its place.
- Calibration: one constant speed band (33–55 km/h), fitted so the flood reaches Rasuwa Gadhi between 09:00 (Borderlens) and 09:15 (Nepal Red Cross) after the 08:37 signal.
- Trigger evaluation: we ran the rule over every USGS event of magnitude 4 or more near the watch zone from 2016 to 2026, and compared when USGS and GEOFON first had the August 26 event.
- AI layer: Claude Sonnet 5.5, via the Claude Code CLI, writes each alert as fixed-structure JSON from
scenario.json. The pipeline computes every number; the LLM only words the message. A validator checks every number and village name against the scenario and regenerates mismatches, up to 3 tries. - Frontend: a Leaflet map replay with street, terrain and satellite layers that reads
scenario.jsonandalerts.json, hosted on GitHub Pages. - All raw inputs are committed, so every number can be rebuilt from the repo.
Results
- Arrival windows (minutes after the 08:37 signal): Rasuwa Gadhi 23–38, Syabru Bensi 39–65, Betrawati 72–120, Bidur 85–141.
- Trigger: over 2016–2026 (22 events), the 30 km rule fired twice, both on the real August 26 collapses, with no false alarms. At 50 km it gives 7 false alarms; at 10 km it misses the main signal.
- Alerts: 160 first drafts (20 rounds × 8 villages): all 160 had the correct lead times and village names in English and Nepali before any regeneration. The failure rate could still be up to about 1.9%, so the validator stays in the loop.
Real-world impact
Global seismic networks record collapses on both sides of a border, so this approach doesn't need a cross-border data-sharing agreement to start. It uses only free public data.
Which feed you listen to decides the warning time:
- Direct processing of seismometer data, which Upstream Alert is designed for, would have alerted villages at 08:38. Rasuwa Gadhi at the border would have had 22–37 minutes.
- The GEOFON catalogue (GFZ Potsdam) had the event about 7 minutes after it happened, which would still have left Rasuwa Gadhi roughly 15–30 minutes.
- The USGS public feed didn't show it until 09:18, 41 minutes after the signal. USGS's automatic system measured it at M4.4, below the M5 cutoff for its 20-minute publishing target outside the US. By then the flood had crossed into Nepal, though Betrawati and Bidur would still have had roughly 30 to 100 minutes.
The 41-minute gap comes from how the information is processed and passed on, not from physics. Upstream Alert is designed to listen to the fastest source and alert villages one minute later.
Challenges we ran into
- Early reports said the collapse was in Tibet; China's Ministry of Natural Resources later placed it just inside Nepal. The flood crossed the border twice.
- The collapse site isn't on any mapped river, so the flood path starts with a 10 km straight-line leg. Assuming the flood starts at the river instead makes downstream arrival windows up to 1.7 times later; we report both.
- We found only one reliable arrival time. Reports say the Syabru Bensi and Betrawati river gauges stopped transmitting, so we had nothing downstream to check against.
- A widely cited water-level reading at "Kalikhola" turned out to be near the Tibet border, not downstream, so we dropped it from calibration.
- LLMs can change numbers when rewriting. The validator makes sure no alert reaches a village with a wrong time.
- The validator checks numbers and names, not wording. Our first prompt produced Nepali instructions phrased as statements, so we fixed the prompt; the Nepali still hasn't been reviewed by a native speaker.
Accomplishments that we're proud of
- A full chain from a real seismic record to validated village-level alerts in English and Nepali, with every number traceable to a source.
- An honest evaluation: the trigger tested against ten years of data, 160 alert drafts checked, an uncertainty check on arrival windows, and the real delays of public feeds.
What we learned
- USGS labelled the event "landslide" only after review. In real time it first appeared as a smaller earthquake (M4.4, 31 km from its final location), so a trigger can't rely on that label.
- Public feeds differ a lot: GEOFON had the event in about 7 minutes, USGS in 41, because USGS's 20-minute target starts at M5.
- One calibration point can't settle both where the flood starts and how fast it moves.
- For a warning, the earliest arrival time is the number that matters.
What's next
- Detect from nearby seismometers instead of waiting for a catalogue: Nepal's National Seismological Centre could flag a collapse inside Nepal within minutes, and a China–Nepal data-sharing agreement could cover the Tibetan side.
- Watch the flood itself in seismic data, to catch lake outbursts that don't start with a big collapse, like the July 2025 flood in the same valley, which has no USGS event.
- Extend the watch zones to every glacier-fed river that crosses into Nepal, using glacial lake inventories such as ICIMOD's.
- Add speed changes along the river, and calibrate against more past events.
- Have native speakers review the Nepali alerts, and work with Nepal's Department of Hydrology and Meteorology and disaster authority on delivery by SMS, cell broadcast and sirens.
Built With
- claude
- geofon
- html
- javascript
- leaflet.js
- openstreetmap
- overpass-api
- python
- usgs
Log in or sign up for Devpost to join the conversation.