Inspiration
Most modern AI wellness tools operate as black boxes. They rely heavily on unvalidated generative text, offering generic advice without explainability, safety guardrails, or clinical auditability. When a user in distress turns to an AI, standard LLM responses can hallucinate or miss critical warning signs, putting vulnerable individuals at risk.
MindCareAI was created to change this paradigm. The goal was to build a safety-first, auditable, and mathematically grounded mental wellness platform that prioritizes user safety over raw generative freedom.
What it does
MindCareAI combines conversational AI with real-time safety monitoring and quantitative data engine logic:Safety-First Guardian Architecture: Every interaction in the companion chat passes through a real-time safety classifier. If critical distress or crisis signals are detected, the platform logs a SafetyEvent, opens a Guardian side-panel, and displays a non-intrusive Crisis Overlay containing local and international emergency helplines.Mathematically Rigorous Pattern Engine: Instead of guessing daily wellness trends using LLMs, MindCareAI calculates true pairwise Pearson correlation coefficients with a 1-day lag ($n \ge 7$ gating) to reveal actual trends between sleep, energy, stress, and mood:$$r = \frac{\sum_{i=1}^{n} (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum_{i=1}^{n} (x_i - \bar{x})^2 \sum_{i=1}^{n} (y_i - \bar{y})^2}}$$Auditable Guardian Console: An environment-gated administrator view (/guardian) allows authorized guardians to review logged safety events, filter by verdict or resolution state, and maintain an auditable safety trail.Interactive Journal & Reflections: Includes regex search, tag filtering, custom AI daily prompts, panic button access on all screens, and weekly reflection email summaries delivered via Resend.
How we built it
Backend: Built with FastAPI and MongoDB (Motor) for asynchronous performance. Powered natively by Google's official @google/genai SDK using the Gemini 3.6 Flash model for streaming chat responses, sentiment evaluation, and daily journal prompts.
Frontend: Developed using React 19, Tailwind CSS, shadcn/ui, Framer Motion, and Recharts for clear data visualizations and a dark "calm-clinical" user interface.
Communication & Security: Implemented JWT authentication, Server-Sent Events (SSE) for streaming companion responses, and the Resend API for weekly automated summaries.
Challenges we ran into
Pivoting Architecture Mid-Build: We initially started with third-party SDK abstractions, but encountered integration bottlenecks. Mid-hackathon, we refactored the entire AI pipeline to interface directly with Google's official google-genai SDK and gemini-3.6-flash.
Deterministic Safety Evaluation: Ensuring the safety classifier reliably returned structured JSON outputs for every chat message required strict schema enforcement and fallback error handling.
Lagged Correlation Calculation: Computing 1-day lagged Pearson correlations across dynamic check-in datasets required clean array alignment in Python while ensuring missing days didn't distort statistical accuracy.
Accomplishments that we're proud of
Zero dependency on black-box wrappers: Every AI call degrades gracefully to hardcoded fallbacks if API limits are hit or connection issues occur.
A fully functional, auditable admin workflow that treats AI safety as a core architectural feature rather than an afterthought.
Delivering real mathematical data visualization alongside conversational AI within a tight 2-day hackathon timeline.
What we learned
Building MindCareAI highlighted the necessity of hybrid architectures in healthcare and wellness tech: coupling deterministic, mathematical data processing with generative AI yields significantly higher trust, auditability, and user safety than relying on generative models alone.
What's next for MindCare AI
Built With
- express.js
- fastapi
- framer-motion
- gemini-api
- google-genai-sdk
- javascript
- jwt
- mongodb
- python
- react
- recharts
- resend-api
- shadcn-ui
- tailwind-css
Log in or sign up for Devpost to join the conversation.