Inspiration
What it does
Here is a complete, beautifully formatted Project Story for your hackathon submission, incorporating inspiration, technical build details, challenges, lessons learned, and mathematical formulations using LaTeX.
🌟 Project Story: MindEase AI
💡 Inspiration
In a fast-paced world, mental health challenges are on the rise, yet professional therapy remains out of reach for millions due to high costs, scheduling difficulties, or social stigma. We wanted to create MindEase AI—a compassionate, conversational wellness companion that acts as a first-step sanctuary.
Our core design principles were guided by two pillars:
- Compassion & Laughter: Combining evidence-based Cognitive Behavioral Therapy (CBT) and grounding techniques with lighthearted Hinglish (Hindi + English) humor to lower cortisol levels naturally.
- Absolute Privacy: Mental wellness is deeply personal. We were inspired to build a privacy-first application where user journals, anxiety logs, and venting sessions are kept strictly inside the user's browser via local caching, ensuring no data ever leaks to cloud databases.
🛠️ How We Built It
We bootstrapped the project using Next.js (App Router) and styled it with Tailwind CSS v4 to build a modern, glassmorphic dark-mode interface.
The architecture consists of:
- The Empathetic Core: Powered by the Google Gemini API (
gemini-2.5-flash), configured with strict custom prompts to maintain a comforting, non-diagnostic tone. - The Talking Voice Bot: We integrated the native browser Web Speech API for frictionless voice interaction.
SpeechRecognitionhandles speech-to-text dictation, andSpeechSynthesisprovides spoken feedback of the assistant's responses. - CBT Thought Diary: A structured 4-step wizard that walks users through identifying automatic negative thoughts and reframing cognitive distortions.
- Interactive SVG Analytics: Real-time dashboards visualizing mood logs, distress indicators, and distortion trends using custom React logic.
📐 Mathematical Framework (LaTeX)
To quantify user improvement and wellness metrics, we developed two key mathematical models:
1. Distress Reduction Ratio ($R$)
We calculate the efficacy of our CBT Thought Diary exercises by measuring the anxiety score before ($D_{\text{before}} \in [1, 10]$) and after ($D_{\text{after}} \in [1, 10]$) the session: $$R = \frac{D_{\text{before}} - D_{\text{after}}}{D_{\text{before}}}$$ A higher $R$ value indicates a more successful cognitive reframing session, which is plotted on the user's wellness dashboard to track long-term emotional regulation.
2. Gamified Streak Reward Coefficient ($S$)
To encourage daily mindfulness practice without causing burnout, we model engagement reward coefficients ($S$) logarithmically based on consecutive streak days ($d$): $$S(d) = 1 + \ln(d) \quad \text{for } d \ge 1$$ This logarithmic scaling guarantees that early consistency is rewarded heavily, while long-term streaks scale gently to maintain a relaxed, pressure-free mental space.
🚧 Challenges We Faced
- Phonetic Hinglish Speech Synthesis: Web speech synthesis engines are optimized for English or Hindi, but struggle with "Hinglish" (Hindi phonetics written in the Roman script). We solved this by creating a text-cleaning pipeline that filters emojis and dynamically binds to regional Indian-English (
en-IN) or Hindi (hi-IN) system voices to capture the proper cadence. - Safety Rail Integration: Balancing conversational freedom with emergency safety. We resolved this by building a dual-layer regex screener (client-side and server-side) that instantly halts Gemini generation and launches a supportive emergency hotline modal if self-harm indicators are detected.
- Next.js Hydration Mismatches: Next.js static generation bails out when rendering dynamic search parameters or reading from local storage on load. We solved this by encapsulating client-dependent widgets inside
<Suspense>boundaries.
🧠 What We Learned
- Frictionless Voice Integration: Native web APIs (SpeechRecognition and SpeechSynthesis) are incredibly powerful tools for building talking AI characters without adding token overhead, API costs, or latency.
- Designing for Privacy: Building local-first applications requires careful state syncing. We learned to use custom browser window dispatch events (
"mindease_login_state_change") to keep headers, sidebars, and embedded pages reactively aligned. - Humor as Therapy: Integrating Hinglish jokes in our "Laughter Therapy" room proved that short, funny, relatable content is a fantastic gateway to breaking the ice and encouraging users to try deeper mindfulness exercises.## How we built it
Log in or sign up for Devpost to join the conversation.