The Spark
I'll be honest — this project started from a frustration. I kept reading about universities and communities that wanted to use AI to catch mental health warning signs in student messages and online posts. Every tool out there requires you to pipe deeply personal, sensitive text through some cloud API. That's a non-starter. You can't ask a suicidal teenager to trust that their words aren't sitting on some company's server somewhere in Virginia. So I asked myself: what if the AI never saw the data at all? What if the entire engine ran right here, in the browser, and nothing ever left?
That single question turned into CrisisGuard AI.
What CrisisGuard AI Actually Does
This isn't a chatbot. This isn't another wrapper around GPT. CrisisGuard AI is a full-stack crisis detection and response platform designed for the people who actually respond to emergencies — university counselors, community moderators, and clinical intake teams.
Here's the pipeline:
Multi-Layer NLP Engine — You paste in text (a message, a social media post, a chat log) and our engine analyzes it against 9 clinical risk categories: suicidal ideation, violence, self-harm, severe distress, hopelessness, isolation, substance abuse, depression, and anxiety. This isn't keyword matching — it handles context. "I'm killing it at work" scores zero. "I want to kill myself" scores critical.
Clinical Severity Scoring (0-100) — The engine calculates a weighted severity score accounting for how many categories fire simultaneously, whether there are temporal urgency markers ("tonight", "right now"), and whether protective factors exist ("but I have my kids", "my therapist said"). This is the same triage logic used in clinical QPR assessments.
Context-Aware AI Advice — Instead of generic "call a helpline" advice, the system generates specific clinical protocols based on exactly what was detected. If violence and depression co-occur, the advice is fundamentally different than if it's isolation alone. Each recommendation maps to established crisis intervention frameworks.
GPS-Based Counselor Finder — This is the feature I'm most proud of. When severity is Moderate or higher, the system automatically asks for the user's location. Using the browser's Geolocation API and reverse geocoding, it identifies their country and instantly surfaces local crisis helplines with one-click Call, Text, and Website buttons. We built a database covering 13+ countries — US, UK, India, Canada, Australia, Germany, France, Japan, Brazil, South Africa, Philippines, New Zealand, Singapore — with an international fallback. It also shows virtual counseling options (BetterHelp, 7Cups, Talkspace) for anyone, anywhere.
Live Monitoring Dashboard — A real-time command center with 24-hour crisis trend analytics, severity distribution charts, a risk heatmap broken down by category and time of day, and a live feed that simulates continuous message ingestion with automatic flagging.
Interactive Neural Network UI — The entire interface features a custom-built HTML5 Canvas particle system rendering 80 animated neural network nodes with mouse-reactive physics, glowing connections, and floating mesh gradient blobs. It's not decorative — it communicates that this is an AI-powered system at a glance.
How I Built It
The entire platform is built with zero backend dependencies. No Node server, no Python Flask, no cloud functions, no API keys. Everything runs in vanilla JavaScript directly in the browser.
nlp-engine.js— The brain. Handles tokenization → multi-category phrase/word matching → sentiment modifier analysis → weighted severity calculation → contextual advice generation.app.js— The nervous system. Page state management, Canvas particle engine, Chart.js dashboards, geolocation-based counselor matching, and the live monitoring simulation.style.css— Pure CSS3 with glassmorphism, animated gradient borders, staggered card reveals, and mouse-follow glow effects. No Tailwind, no Bootstrap.
The architecture is deliberately simple because the constraint is the innovation. By proving that a meaningful, clinical-grade AI tool can run entirely on the client edge, we eliminate the need for expensive cloud infrastructure — and with it, every privacy concern.
The Hard Parts
Getting the NLP engine right without an LLM was genuinely difficult. Early versions flagged "I'm killing it at work!" as a critical threat. The solution was building context windows — the engine doesn't just match words, it looks at surrounding phrases and sentiment modifiers to distinguish genuine distress from colloquial language.
The Counselor Finder was another challenge. I needed a free, no-API-key reverse geocoding solution that works client-side, and had to manually curate verified helpline numbers for 13 countries. Every phone number and helpline in the database was individually verified against official sources.
What I Learned
The biggest takeaway: you don't need a massive cloud LLM for every AI problem. For specific, high-stakes classification tasks like crisis triage, a well-designed deterministic model running on the edge can be faster, more private, and surprisingly accurate. Not everything needs GPT-4.
I also learned that the gap between "detection" and "action" is where most mental health tools fail. Identifying that someone is in crisis is only half the problem — you need to immediately connect them with help. The Counselor Finder closes that loop.
What's Next
- Browser Extension: A Chrome extension that lets moderators right-click any text on the web and analyze it instantly
- Multi-Language Support: Expanding the crisis lexicon to Spanish, Hindi, and Mandarin
- WebGPU Local LLM: Using on-device models like Llama-3 8B through WebGPU for deeper semantic understanding — still fully private
- Institutional API: A webhook system so universities can connect their anonymous messaging platforms directly to the CrisisGuard engine
- Expanded Counselor Database: Growing from 13 to 50+ countries with verified helpline data
Built With
- chart.js
- css3
- edge-computing
- html5
- javascript
- natural-language-processing
- progressive
- web
Log in or sign up for Devpost to join the conversation.