ðŠī Grounded: Panic Intervention
Real-time panic intervention in your browser.
Built at Hack Canada 2026
Inspiration
It started, fittingly, with stress.
We were already running late to the hackathon - scrambling, rushing, that familiar tight feeling in your chest when everything is happening at once. Someone in the group joked that we needed an app to calm us down. And then we stopped and actually thought about it.
Because here's the thing: in that moment, none of us would have opened Headspace. We wouldn't have navigated to a breathing exercise. We were too busy being stressed to do anything about the stress. And if that's true for us - in a low-stakes situation - how much worse is it for someone in the middle of a genuine panic attack?
That question became the entire project. Panic attacks affect roughly 1 in 5 people every year. When one hits, the last thing someone can do is find their phone, open an app, and manually start a guided meditation. Existing tools are built for maintenance - for the calm moments when you choose to invest in your mental health. Nobody has built something for the crisis itself.
So we asked: what if the tool came to you? What if you had a dedicated space that you could open the moment things felt overwhelming - a site that was ready to step in and guide you back to safety without you having to configure a single setting?
That's Grounded.
What it does
Grounded is a browser-based sanctuary that provides an immediate, escalating intervention for acute stress and panic.
- The Landing: The moment you open the site and click "Begin Session," the intervention begins. There are no accounts to create and no settings to tweak.
- The Environment: An immersive 3D forest (WebXR) loads instantly, surrounding you with a generative ambient soundscape designed to lower your heart rate.
- Active Guidance: An AI-generated voice (ElevenLabs) talks you through a breathing exercise.
- The Feedback Loop: As you follow the exercises, Grounded uses your webcam to locally monitor your facial expressions. It isn't just a timer â it's an observer:
- Progress Detected: If the model sees your expressions softening and your stress score dropping, it stays the course. After ~10 calm readings, it gently asks if you're ready to end the session.
- Persistent Distress: If your facial cues indicate the panic is not subsiding after a set interval, the system escalates â offering a live, empathetic AI Therapist (ElevenLabs Conversational AI) to talk you through the peak of the attack.
Privacy Note: All video processing happens in RAM on your machine. We never see your face, and no biometric data ever leaves your browser.
How we built it
The engine is face-api.js (TinyFaceDetector), performing real-time inference to calculate a stress score $s \in [0, 1]$ based on weighted facial probabilities:
| Stress range | Label shown |
|---|---|
| 0.00 â 0.20 | Very Calm |
| 0.20 â 0.45 | Calm |
| 0.45 â 0.65 | Mildly Stressed |
| 0.65 â 0.85 | Stressed |
| 0.85 â 1.00 | Very Stressed |
The Stack
| Layer | Technology |
|---|---|
| Intelligence | Gemini 2.5 Flash â personalised, warm verbal guidance |
| Voice | ElevenLabs TTS (Rachel) for human-grade reassurance, with Web Speech API fallback |
| Vision | face-api.js running locally to monitor intervention efficacy |
| Immersion | Three.js (WebXR) for the 3D forest; Web Audio API for synthetic ambient sound |
| Architecture | Vanilla ES Modules â no frameworks, no bundlers, immediate loading |
Challenges we ran into
Designing for the "Panic State." We had to strip away every unnecessary click. Normal UI rules - like confirmations or complex menus - are failures in a panic state. We focused on zero-touch navigation once the session starts.
The "Uncanny Valley" of Comfort. A voice that sounds too robotic can be jarring during a crisis. We spent hours fine-tuning ElevenLabs latency and Gemini's prompt engineering to ensure the AI sounded like a calm friend, not a clinical monitor.
Accomplishments that we're proud of
We built a fully working mental health intervention system - passive detection, AI generation, neural voice, live conversational AI, and an immersive 3D environment - in a single browser tab, in under 36 hours, with no native app and no backend.
The stress detection actually works. Not in a demo-only, perfect-lighting way - in a real, messy, hackathon-at-3am way. We tested it on each other repeatedly and it consistently caught genuine distress without flooding calm states with false positives.
The voice experience genuinely surprised us. We played ElevenLabs' Hope voice to someone who didn't know it was synthetic - they thought it was a human therapist. And perhaps most importantly: the whole thing runs with zero biometric data leaving the device. For a mental health tool, that's not just a privacy win - it's the only ethical way to build it.
What we learned
We learnt how to create a 3D Environment using Three.js We learnt how to use the ElevenLabs API in integration with the Gemini API We learnt how to create ElevenLabs Agents
We leart how to use Face-API
What's next for Grounded - Panic Intervention
Near-term
- Mobile app (React Native)
- Add multiple 3D environments
- Emergency contact information
Long-term
- Multi-language support
- Heart rate via webcam rPPG
Built With
- css
- elevenlabs
- face-api.js
- gemini
- google-web-speech-api
- html
- javascript
- node.js
- three.js
- webxr


Log in or sign up for Devpost to join the conversation.