๐Ÿ’ก Inspiration

In critical emergency situations, panic and delay cost lives. People in distress don't think in medical jargonโ€”they describe symptoms in plain words like "my friend suddenly can't move his left arm" or "smoke is filling the hallway." Furthermore, people often hesitate about which emergency number to call or how to perform immediate first aid while waiting for an ambulance.

We built SafeGuard AI to bridge this gap: an intelligent, calm, offline-first emergency triage assistant powered by Google Gemini 2.5 Flash. SafeGuard translates natural-language emergency descriptions into immediate, step-by-step action guides and connects users directly to localized emergency response helplines.


๐Ÿš€ What It Does

  • ๐Ÿค– Google Gemini AI Clinical Triage: Users describe any emergency in plain language. SafeGuard routes the situation to the correct emergency response protocol using Google Gemini 2.5 Flash, providing a clear AI clinical reasoning summary, urgency classification (CRITICAL, HIGH, MODERATE), and immediate 1-tap action buttons.
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Indian National Emergency Integration: Direct 1-tap calling for official Indian emergency helplines including 112 (All Emergency Services), 108 (Ambulance & Trauma), 101 (Fire), 100 (Police), 1091 (Women Helpline), and 1078 (Disaster Management).
  • ๐Ÿ”Š Web Audio Siren Alert System: Built-in browser sound synthesis via Web Audio API that emits realistic emergency audio tones when dispatching calls or getting urgent guidance.
  • ๐Ÿ“š Offline-First Interactive Rescue Guides: Comprehensive step-by-step guides for Medical Emergencies, Choking (Heimlich), Burns, Severe Allergic Reactions (Anaphylaxis), Fire Safety, Flood Response, and Gas Leaks.
  • ๐Ÿ“ GPS Nearby Emergency Locator: Geolocation lookup that uses OpenStreetMap & Google Maps to locate the closest hospitals, fire stations, and police stations within seconds.
  • ๐Ÿ–จ๏ธ Printable QR Code Stationing: Generates instant QR codes for printing emergency guides onto first-aid kits, refrigerators, or breakroom walls.

๐Ÿ› ๏ธ How We Built It

  • AI & LLM: Google Gemini 2.5 Flash API (generativelanguage.googleapis.com) with responseMimeType: application/json for deterministic, structured triage output.
  • Frontend: React 18, TypeScript, Vite, Tailwind CSS, Framer Motion for smooth motion effects, Lucide React icons.
  • Backend & Serverless: Express.js server bundled into Netlify Serverless Functions (serverless-http) with an in-memory data store for zero-latency execution.
  • Audio & Mapping: Web Audio API for client-side synthesized siren tones; OpenStreetMap Overpass API & Google Maps API for hospital geolocation.

โšก Challenges We Faced

  1. Structuring LLM JSON Responses: Ensuring Google Gemini 2.5 Flash returned strictly formatted JSON payloads without markdown wrapping, solved using native systemInstruction and JSON MIME enforcement.
  2. Zero-Failure Triage Resilience: Designing a hybrid fallback strategy so that even if network signals flicker during an emergency, the system immediately provides high-priority first-aid guidance.
  3. Cross-Platform Compatibility: Ensuring smooth execution across mobile touchscreens, offline PWAs, and desktop viewports.

๐Ÿ… Accomplishments We're Proud Of

  • Sub-second natural-language emergency symptom classification powered by Google Gemini AI.
  • Native integration with Indiaโ€™s 112 / 108 Emergency Response System.
  • 100% offline usability for core rescue guides once loaded into the browser.

๐ŸŽ“ What We Learned

  • Advanced prompt engineering and JSON mode capabilities with Google Gemini REST API.
  • Building resilient offline-first emergency UX and Web Audio sound synthesis.

๐Ÿ”ฎ What's Next for SafeGuard AI

  • Multilingual Voice Triage: Voice recognition and text-to-speech in regional Indian languages (Hindi, Tamil, Telugu, Bengali, Kannada).
  • IoT Emergency Hardware: Bluetooth SOS button integration for elderly individuals.

Built With

Share this project:

Updates