Inspiration

In Pakistan, real support exists — Edhi Foundation, Saylani, Bait-ul-Mal, Madadgar 1098 — but finding the right one in a crisis means knowing which org to call, whether you qualify, and hoping the number you found is still active. People in crisis rarely have the time to search five websites and call numbers that don't pick up. We built SafeRoute to close that gap: a fast, honest way in for the person who needs help.

What it does

SafeRoute is an AI assistant that lets someone describe their situation in plain language and get back real local services they may qualify for — never a guarantee, always a next step. It:

  • Classifies the need (food, housing, mental health, legal, crisis) using NLP, then scores its own confidence — if the situation is ambiguous, it asks a clarifying question instead of guessing, rather than returning a speculative match
  • Shows a "Decision Receipt" on every response: what was classified, why, which services matched and from where, and explicitly what the AI did NOT decide
  • Checks a hand-verified directory of 19 real Karachi organizations first, falling back through a live chain (HERE API → OpenStreetMap) → a global crisis helpline directory when local data doesn't exist — degrading gracefully instead of failing silently
  • Flags any service not re-verified in 30+ days as "please call ahead to confirm"
  • Enforces conditional eligibility language two ways: a prompt rule, and a post-processing check that rewrites any "you qualify"-style phrasing the model generates before it ever reaches the user
  • Detects crisis-risk language with a deterministic keyword filter — never an AI judgment call — and immediately surfaces a real local hotline
  • Offers a No-Data Mode where nothing about the conversation is stored, for users in situations where that matters most
  • Gives nonprofits an aggregate dashboard showing where requests are outpacing available listings

How we built it

A Next.js/TypeScript chat interface with a Leaflet map and an analytics dashboard. The full reasoning pipeline — classification, confidence scoring, retrieval, and response generation — runs natively in the same Next.js backend on the Gemini API. Service lookup checks our hand-verified Karachi directory first, then HERE API, then OpenStreetMap's Overpass API, before resolving to a country-specific entry on findahelpline.com. Conversation state and audit logs run on SQLite via Prisma, deployed on Vercel.

Challenges we ran into

The hardest part wasn't the AI, it was the data. There's no public API for benefits or shelter eligibility in Pakistan — nothing like Benefits.gov exists — so we hand-researched and verified real organizations instead of relying on a feed. We also had to be deliberate about language: an early version said "you qualify," which is exactly the kind of overconfident claim that can send someone to a service that turns them away. We rewrote every eligibility response to use conditional language, then went further and added a second enforcement layer in code, because we didn't trust the prompt alone to hold under every phrasing a model might produce.

Accomplishments that we're proud of

SafeRoute never decides who qualifies, and it never uses AI judgment to decide whether a situation is a crisis — that's a fixed keyword filter, not the model. We're also proud that when the AI itself is uncertain, it says so and asks, instead of confidently guessing — that's the harder, less common thing to actually build, not just claim.

What we learned

"Responsible AI" is most convincing when it's a constraint you can point to in the code, not a paragraph in a form — the may-qualify enforcement, the staleness flag, and the deterministic crisis filter all do real work. We also learned how fragmented public-service data is outside a handful of countries, which reshaped this from "a chatbot with a directory" into "a system that's honest about what it does and doesn't know yet."

What's next for SafeRoute: AI Benefits Navigator

  • Direct outreach to BISP, Ehsaas, and local NGOs for real data-sharing partnerships
  • Expanding verified coverage to other major Pakistani cities, then other countries
  • A persistent hosted database to support audit logs and the dashboard at scale
  • WhatsApp delivery, architected and ready, pending production phone number setup

Built With

Share this project:

Updates