## Inspiration When power and phone networks go down, people need specific guidance right away: is the water safe, can I run the generator in the garage, what do we do about Grandma's insulin, where do we meet? Most people think they're prepared, but under stress it's hard to remember what applies to their household, and the official guidance is spread across dozens of agency websites that you can't reach offline. We wanted an assistant that keeps working when the internet doesn't.

## What it does Uragent is an emergency companion that runs entirely on a laptop. It answers questions from a built-in library of official guidance, using an open model on the device, with no internet needed.

  • A library of official guidance: 2,140 passages (about 253,000 words) from 11 federal and California sources: FEMA (Ready.gov), CDC, National Weather Service, FDA, USDA, EPA AirNow, SAMHSA, Listos California, CAL FIRE, the California Department of Public Health and the Earthquake Country Alliance. The text is copied word for word, never rewritten.
  • Knows the household: the profile (people, medications that need refrigeration, mobility needs, pets, meeting points, an out-of-area contact) shapes every answer.
  • Safety first: danger words (rising water, gas smell, fire, a generator indoors, earthquake, heat illness) always bring the matching life-safety card into the answer.
  • Stays in its lane on medicine: for medicines and medical devices it only gives handling guidance (storage, temperature limits, when to replace them). For symptoms, injuries or doses it says to call 911 or ask a pharmacist or doctor.
  • A calm companion screen: an animated view of local conditions for five simulated scenarios (flood, wildfire, earthquake, power outage, extreme heat). It gives one manageable step at a time and hands off to the local model when the connection drops.

## How we built it

  • Collecting: we captured each official page with Chrome (Playwright), split it into short passages that keep the publisher, the page date and the source link, and checked every extraction against the rendered page.
  • Searching: each passage is embedded once with a small local model (bge-small through transformers.js). Questions are matched by meaning in about 4 ms, inside the app.
  • Answering: the agent runs on the OpenAI Agents SDK (TypeScript) against Gemma 4 26B-A4B, served locally by llama.cpp. The same code can use OpenRouter during development.
  • Checking sources: we used Cognee to build a knowledge graph of the library with a frontier model and ran its conflict review to find places where official sources disagree, such as when to shut off the gas.
  • Delivering: an Electron desktop app wraps the companion, and a benchmark of 50 questions (including follow-ups and questions the library can't answer) runs after every change.

## Challenges we ran into

  • Fitting on a 24 GB MacBook Air: the model alone takes about 15 GB, so we cut the search down to a single lightweight process.
  • A 2-hour build crash: the knowledge-graph build hit a database size limit halfway through; we repaired it and resumed.
  • Small models vs. instructions: getting a small local model to stay inside strict medical limits took explicit examples and a reminder placed right next to each question.
  • Benchmark bugs: our own citation checker was undercounting, which taught us to read the answers, not just the scores.

## Accomplishments that we're proud of

  • On our 50-question benchmark, the right official source was among the five passages shown to the model for every answerable question, and the answer contained the key fact 98 to 100% of the time (55% with hand-written cards alone).
  • It declined every question the library couldn't answer instead of guessing.
  • It runs fully offline on a laptop, at about 10 seconds per answer.

## What we learned

  • A broad library of official text beats a handful of hand-written cards.
  • Plain meaning search beat our fancier graph and hybrid search on real questions.
  • In an emergency tool, the most important feature is knowing what not to say.

## What's next for Uragent

  • County and city sources (local shelters, evacuation zones, utility outages) and Spanish.
  • Voice input that works offline.
  • Real weather and alert feeds in place of the simulation.
  • A sync step that refreshes the library whenever the laptop is online.
  • A packaged, one-click installer.

Built With

Share this project:

Updates

Submission history