Inspiration

India has one of the world's most severe mental health treatment gaps. With roughly 1 psychiatrist per 100,000 people, the burden on therapists is immense - high caseloads, short sessions, and almost no visibility into how a patient is doing between appointments.

We kept coming back to one uncomfortable truth: a patient in distress at 11pm on a Wednesday has nowhere to go. Their next session might be a week away. We wanted to change that — not by replacing the therapist, but by extending their presence. MyMindSpace exists to bring therapist-guided clinical support to patients anytime, anywhere.


What It Does

MyMindSpace is a therapist-first clinical support platform that keeps patients engaged and supported between sessions, while giving therapists the data they need to deliver better care.

  • Patients journal between sessions using CBT and ACT-aligned prompts, complete therapist-assigned wellness activities, practice social skills through AI role-play scenarios, and receive empathetic, clinically-grounded in-app reflections.
  • Therapists get a real-time dashboard - a digital twin of each patient - with mood trends, journal summaries, risk flags, and session-ready insights. They walk into every appointment already knowing what's happened since the last one.
  • Crisis moments trigger immediate alerts to the assigned therapist and structured escalation paths to professional helplines (iCall, Vandrevala Foundation).

The AI never diagnoses, never acts autonomously, and never replaces clinical judgment. Every output is a suggestion - the therapist is always the final word.


How We Built It

We built MyMindSpace as a decoupled microservices system across mobile, backend, and AI layers.

Each journal entry passes through a Named Entity Recognition pipeline that extracts recurring themes, stressors, and people - producing structured, therapist-readable summaries automatically. An LSTM-inspired memory system then manages what the AI remembers across sessions using three neural gate networks:

$$f_t = \sigma(W_f \cdot [h_{t-1}, x_t] + b_f) \quad \text{(Forget Gate)}$$ $$i_t = \sigma(W_i \cdot [h_{t-1}, x_t] + b_i) \quad \text{(Input Gate)}$$ $$o_t = \sigma(W_o \cdot [h_{t-1}, x_t] + b_o) \quad \text{(Output Gate)}$$

Each gate is a fine-tuned transformer (DistilBERT / RoBERTa / BERT) that decides what to retain, fade, or surface per conversation. Gate thresholds are continuously optimised using Proximal Policy Optimisation (PPO):

$$R = 0.4 \cdot E_{\text{engagement}} + 0.3 \cdot Q_{\text{conversation}} + 0.3 \cdot S_{\text{relevance}}$$

The assembled memory context feeds into Gemini, which generates empathetic, therapy-aligned patient reflections. The backend runs on Node.js / Express deployed via Google Cloud Run, with Firebase Firestore for structured data, AstraDB for vector storage, and Firebase Auth for role-based patient-therapist access control.


Challenges We Ran Into

  • Therapist-first vs. patient-first tension. Every instinct when building a wellness app pulls toward optimising the patient experience. We had to consistently ask: does this serve the therapist's clinical judgment, or undermine it? That reframe changed a lot of decisions.

  • RL stability in a sensitive domain. PPO optimising for engagement works well in most products — but in a mental health context, pure engagement optimisation can drift in clinically inappropriate directions. Constraining the reward function to balance quality and relevance against engagement was an ongoing calibration challenge.

  • Data isolation at every layer. Strict patient-therapist access controls couldn't just live in the UI — they had to be enforced at the API, Firestore security rules, and AI service boundaries simultaneously.

  • Scope discipline under pressure. The problem space is enormous. Keeping the MVP focused on the journaling-to-dashboard loop, and resisting feature creep, was one of the harder calls we made as a team.


Accomplishments That We're Proud Of

  • A production-ready backend with JWT-based role authentication, 5 core dashboard endpoints, and Google Cloud Run deployment - fully tested and live.
  • An LSTM-inspired memory architecture that genuinely personalises the AI's context per patient over time, rather than treating every conversation as a blank slate.
  • A PPO-optimised gate system that adapts to individual patient patterns — a real RL training loop, not a heuristic.
  • End-to-end data isolation between patient and therapist scopes, enforced at every layer of the stack.
  • Designing an AI system that clinicians can actually trust — every output auditable, every decision surfaced for human review.

What We Learned

  • Clinical design is not product design. The usual playbook - maximise engagement, optimise for delight - doesn't apply when you're building for mental health. Restraint is a feature.
  • Memory is both an engineering and an ethics problem. What a system remembers about a person, for how long, and under what consent model, has real consequences.
  • API contracts are as important as code. With multiple microservices in parallel development, keeping interfaces clean and consistent became the biggest leverage point for team velocity.
  • Cultural context is a first-class constraint. The stigma, language nuance, and stressor landscape for young adults in India aren't edge cases — they're the product.

What's Next for MyMindSpace

  • Therapist Dashboard UI - completing the React Native digital twin view with trend charts, risk alerts, and session-prep summaries.
  • Patient Mobile App - full React Native build with navigation, journaling UI, and AI reflection interface.
  • Voice Journaling - speech-to-text for patients who find writing difficult or stigmatising.
  • Longitudinal Risk Modelling - moving from reactive flagging to predictive early-warning signals for therapists.
  • NGO and Clinic Pilots - deploying with mental health organisations in India to validate the model in real clinical workflows.

Built With

Share this project:

Updates