The Haicheng, earthquake at Liaoning Province, China on February 4, 1975, a magnitude M 7.3 at 19:36 CST is historically noted as the only large earthquake in which evacuation was ordered before the mainshock, ostensibly based on prediction. The prediction process included multiple precursors.

Inspiration Natural disasters don’t wait for humans to be ready. During the 2023 Turkey–Syria earthquake sequence, first responders and field teams were overwhelmed by fragmented data sources, delayed updates, and conflicting social-media reports. The same pattern repeats in every major seismic event: critical minutes are lost translating raw sensor data into actionable guidance for the people who need it most.

We built EarthShield AI to close that gap. Our goal was a single, conversational assistant that lives where emergency teams already communicate — Slack — and turns complex earthquake, tsunami, and risk data into clear, fast, team-ready decisions.

What it does

EarthShield AI is a Slack-native emergency-response assistant that monitors global seismic and tsunami activity and answers natural-language questions in channels and DMs.

Key capabilities:

Real-time alerts — ingests USGS earthquake feeds and NOAA tsunami advisories and posts significant events to subscribed Slack channels. Region assessment — answers /earth assess Japan or /earth forecast California with an activity index, anomaly detection, and preparedness recommendations. Natural chat — anyone can DM the bot or @EarthShield in a channel with plain-language questions like “What’s the risk for Indonesia today?” Interactive follow-ups — every advisory includes Slack buttons for Explain advisory, Historical trend, and Preparedness guidance so teams can drill deeper without retyping queries. Subscription management — /earth subscribe and /earth unsubscribe let teams control what reaches them.

How we built it

Frontend / API framework: TanStack Start, React 19, TypeScript, Tailwind CSS AI reasoning: Google Gemini Slack integration: Slack Events API, Slash Commands, Block Kit interactive messages Backend/Database: Supabase (PostgreSQL) with Row-Level Security Data sources: USGS earthquake feeds, NOAA tsunami advisories

Challenges we ran into

  1. Cloudflare Workers cancel background promises Our first slash-command implementation returned a quick acknowledgment and then posted the real answer to Slack’s response_url in a background Promise. On Cloudflare Workers, that promise is cancelled as soon as the HTTP response is sent, so the follow-up never arrived. We fixed this by running the agent inline and returning the answer directly in the initial response, keeping response times under ~2 seconds.

  2. Slack slash commands require explicit registration We initially assumed /earth would work as soon as the backend route existed. Slack, however, requires each slash command to be created in the app manifest and the app reinstalled to grant the commands scope. We learned to treat the Slack app configuration as a first-class deployment step.

  3. Signature verification and URL routing When Slack reported “the app did not respond”, the server logs showed no incoming request. The issue was either the slash-command URL pointing to an unreachable endpoint or the SLACK_SIGNING_SECRET mismatching and returning a silent 401. We tightened logging and documented the exact public URL for each Slack configuration field.

  4. Resolving Slack IDs to human names Slack returns opaque IDs (U…, C…, D…). To keep replies readable, we built paginated user and channel lookups and expanded references in the agent’s output before posting back to Slack.

Accomplishments that we're proud of

Shipped a working Slack-native assistant — /earth slash commands, @mentions, DMs, and interactive buttons all respond end-to-end with live data, not placeholder text. Connected real-time public safety data — USGS earthquake feeds and NOAA tsunami advisories feed directly into the agent, so answers are grounded in observed events, not hallucination. Built an open MCP endpoint — the /api/public/mcp route exposes EarthShield tools over standard MCP protocol, making the assistant usable from Claude, Cursor, and other AI clients beyond Slack. Kept emergency responders in mind — every advisory includes a clear disclaimer, cites sources, and offers one-click follow-up actions so teams can make faster, safer decisions.

What we learned

Latency matters more than polish in emergency tooling. A 2-second correct answer beats a 10-second perfect one. Conversational interfaces lower the barrier for non-technical team members during crises; plain language queries out-perform rigid command syntax. Platform constraints shape architecture. Cloudflare Workers’ execution model forced us to simplify our handler and make the agent response synchronous — which ultimately made the product feel faster. Slack as a platform is powerful but exacting: signatures, scopes, retries, and manifest versions all need careful management.

What's next for EarthShield AI

Real-time push via USGS PAGER and NOAA websocket feeds instead of polling. Multi-modal alerts — SMS and email fallbacks for teams without Slack access. Regional baselines — learn normal seismicity per region to reduce false-positive alerts. Multilingual support so local response teams can interact in their native language.

Share this project:

Updates