Inspiration

What it does

How we built it

Challenges we ran intoInspiration

For elders living with dementia, the most dangerous moments rarely happen in ideal conditions. A sudden bout of disorientation in an elevator, a wrong turn outside a neighborhood park, a missed or duplicated medication dose, or a fall in a low-signal corridor can quickly escalate into a crisis.

Most existing assistive tools fail on two fronts:

Cloud dependency: Pure cloud voice assistants stall when connectivity drops—precisely when an elder needs calm, immediate guidance. Stigmatizing hardware: Bulky, clinical "panic buttons" are often left on nightstands because elders feel self-conscious wearing them.

We built Mitra / Smriti (स्मृति) AI to deliver privacy-first, offline-resilient cognitive companionship and deterministic safety through a dignified faceted-heart wearable pendant, an always-on hybrid AI Android app, and a real-time caregiver command center.

What It Does

Mitra (Smriti) AI unifies elder orientation, caregiver visibility, and emergency response across three hybrid inference modes (ONLY_ON_DEVICE, PREFER_ON_DEVICE, and ONLY_IN_CLOUD):

Always-On Zero-Focus Multilingual Voice: Runs Silero Neural VAD v5 and Sherpa-ONNX keyword spotting ("Hey Mitra", "Bachao", "Help Me") continuously in the background without claiming AudioFocus—supporting 8 languages (English, हिन्दी, Punjabi, Marathi, Bengali, Gujarati, Tamil, Telugu) at a calm 0.85x speaking cadence. Who's This? & Pill Strip Verification: Uses CameraX + ML Kit on-device vision to identify familiar faces from local memory cards and verify medicine strips against the elder's active prescription schedule before dosing. Safe Return Co-Pilot: Detects wandering outside the home safe zone and guides the elder home step-by-step using familiar neighborhood landmarks. 7 Deterministic Safety SOPs (SOP_01–SOP_07): Standardizes fall impact, voice distress, road panic, geofence breaches, sharp/hazard proximity, BLE phone separation (RSSI < -85 dBm), and critical medication safety blocks across Edge, Mobile, and Cloud. ESP32 Faceted-Heart Wearable Pendant: A 3D-printable metallic-style faceted heart pendant featuring an arc-reactor-inspired front camera aperture, a top-vertex microphone port, dual upward-angled speaker slots, IMU fall detection, GPS, and BLE GATT tethering. How We Built It

  1. Android Dual-Role App (android-app/) Built in Kotlin + Jetpack Compose (minSdk 26, targetSdk 35) serving both Elder Companion and Caregiver Console roles in a single APK. MitraVoiceForegroundService: Captures 16 kHz mono PCM via AudioRecord with hardware Acoustic Echo Cancellation (AEC) and NoiseSuppressor, feeding 32 ms frames ( 512  samples 512 samples) into Silero VAD and Sherpa-ONNX, with optional Gemini Live bidirectional WebSocket streaming and automatic REST/local fallback. Local Resilience: OfflineSyncStore persists routines, home geofence coordinates, demo overrides, and queued offline events for batch reconciliation.
  2. Spring Boot Cloud Hub & Caregiver Web Super-App (backend/) Built with Java 21 + Spring Boot 3.4.2 + Spring Data JPA (H2) + WebSockets (/ws/caregiver/{patientId}, /ws/pendant/{patientId}). Implements Haversine geofence evaluation to detect boundary breaches (SOP_04_GEOFENCE_BREACH) when the elder's distance 𝑑 d from home exceeds wanderingRadiusMeters ( 𝑟 wandering r wandering ​

):

𝑑

2 𝑅 arcsin ⁡ ( sin ⁡ 2 ( 𝜙 2 − 𝜙 1 2 ) + cos ⁡ ( 𝜙 1 ) cos ⁡ ( 𝜙 2 ) sin ⁡ 2 ( 𝜆 2 − 𝜆 1 2 ) )

𝑟 wandering d=2Rarcsin( sin 2 ( 2 ϕ 2 ​

−ϕ 1 ​

​

)+cos(ϕ 1 ​

)cos(ϕ 2 ​

)sin 2 ( 2 λ 2 ​

−λ 1 ​

​

) ​

)>r wandering ​

Packaged with Docker Compose (docker compose up --build) so the entire backend and Caregiver Web UI (http://localhost:8080/) start cleanly without any .env file or real API keys, gracefully reporting KEY_NOT_SET and falling back to LOCAL_CONTEXT_AGENT.

  1. ESP32 Wearable Pendant (esp32-pendant/) Programmatically modeled a 3D-printable faceted heart enclosure (generate_mitra_pendant.py) with exportable STL and GLB assemblies. Evaluates 3-axis accelerometer impact spikes alongside gyroscope rotation to trigger SOP_01_FALL_IMPACT when resultant acceleration exceeds 3.5 𝑔 3.5g: ∣ 𝑎 ∣ = 𝑎 𝑥 2 + 𝑎 𝑦 2 + 𝑎 𝑧 2 𝑔 0 > 3.5 ∣a∣= g 0 ​

a x 2 ​

+a y 2 ​

+a z 2 ​

​

​

3.5 Challenges We Ran Into Android 14+ Background Microphone Restrictions: Starting or restarting a microphone-type foreground service from background callbacks triggers ForegroundServiceStartNotAllowedException, and delaying startForeground() past the 5-second window causes ANRs. We resolved this by invoking createNotificationChannel() and startForeground() at the very top of every onStartCommand code path, lazy-initializing heavy native Sherpa-ONNX libraries afterward, and removing unsafe background restarts in onTaskRemoved. Preventing AudioFocus & TTS Echo Loops: Standard SpeechRecognizer pipelines pause music/calls and re-trigger on the assistant's own voice. We switched to a zero-AudioFocus AudioRecord loop paired with word-overlap echo suppression (MitraVoiceBus.isBlockedOrEcho) and TTS cooldown windows. Zero-Key Reproducibility: Ensuring judges can run docker compose up with zero secrets while still experiencing live seeded data, SOP escalation, and grounded caregiver chat required building a deterministic LOCAL_CONTEXT_AGENT fallback. Accomplishments That We're Proud Of End-to-End Hybrid Architecture: Seamless coordination between custom 3D-printable ESP32 hardware, on-device neural audio/vision, and a real-time WebSocket cloud hub. One-Command Docker Deployment: Starts out of the box with no .env or API keys, complete with seeded patient/medication/landmark state and passing integration tests. Dignity-First Design: Replacing clinical panic-button aesthetics with a faceted-heart pendant and a calm, clutter-free SOS interface. What We Learned Edge-first safety is non-negotiable: Wake-word detection, fall thresholds, and emergency UI transitions must never wait on a network round-trip. Acoustic geometry matters: Positioning the pendant's microphone at the top vertex and angling dual speaker slots upward significantly improves elder voice clarity without blasting surroundings. Graceful degradation builds trust: Designing for KEY_NOT_SET and offline bunker modes from day one makes the entire system more deterministic and testable. What's Next for Mitra / Smriti AI Miniaturize a custom ESP32-S3 PCB inside the faceted-heart enclosure with optimized deep-sleep battery management. Conduct usability and clinical validation pilots with dementia care families and geriatric specialists. Add FHIR/EHR clinical digest exports and multi-patient dashboards for assisted-living care homes.

Accomplishments that we're proud of

What we learned

What's next for Mitra ai

Built With

Share this project:

Updates

Submission history