Let’s talk

Mental Health App

  • #Smart Assistant

An AI emotional support app prototype for a US digital health startup. It detects how a person feels, replies in two languages and keeps every message inside a private AWS environment, with crisis escalation to clinicians.

  • Natural Language Processing
Phone with a mood check-in beside an admin console with mood trends and flagged chats

Impact

The client is a US digital health startup selling to clinics and mental health organizations, so its product had to pass their security review. Its first proof of concept ran on a hosted model with one tone and one language, and testers dropped off after about two sessions.

We built a prototype that reads each message's emotional state, answers in either of two languages and routes risk to a human. Qwen 2.5 32B and the classifiers are self-hosted in a private AWS VPC; users get a mobile app, admins a web console.

Services we provided

Discovery and HIPAA Compliance Mapping

Self-Hosted LLM Deployment on AWS

Emotion Detection Model Training

Mobile App Development

Admin Console Development

Safety and Red-Team Testing

Tech Stack

Python

PostgreSQL

AWS

Dark mode chat offering a two-minute breathing exercise, with the detected mood marked
Weekly mood and sleep summary on a tablet, with a switch to share it with a therapist

Challenges and Solutions

🧐 Challenges

  • HIPAA-aligned privacy ruled out hosted LLM APIs, shared logging tools and any analytics that could read message text.
  • Replies had to adapt to how the user feels; the first prototype answered every message in the same tone.
  • Conversations had to work natively in two languages, including users who switch mid-sentence.

💡 Solutions

  • Qwen 2.5 32B runs on GPU nodes in a private VPC, with no public endpoint and no third-party API calls.
  • A fine-tuned classifier tags each message with one of 7 emotional states and an intensity score in about 120 ms.
  • A bilingual engine detects the language per message, with tone rules, coping scripts and safety phrases written natively for both.
  • Encryption at rest and in transit, least-privilege access, MFA for every admin and an exportable audit log.
  • A 10-second daily check-in feeds weekly mood and sleep charts that users can share with their therapist.
  • A separate risk model screens every message and, on crisis language, shows crisis resources and alerts an on-call clinician.

Business value

  • 93% emotion-detection accuracy on validation data.
  • ~1.8 sec median time to a mood-aware reply.
  • 0 user messages sent to third-party APIs.
  • ~4 sessions per active user per week during the 6-week beta.
  • 100% of high-risk test prompts routed to crisis resources.

User flow

1. The user types a message or records a short voice note in the mobile app.
2. The classifier returns one of 7 emotional states with an intensity score.
3. The engine adds recent messages, mood check-ins and the user's language, then prompts the model with tone rules for that state.
4. A short reply arrives in about 1.8 seconds, often with a breathing exercise or a coping step.
5. The detected state feeds the mood chart; risk language triggers crisis resources and a clinician alert.
6. All data stays in the client's AWS account, and admins see aggregate trends only.

This website uses cookies

We use cookies to personalize content and advertising, provide social networking features, and analyze our traffic. We also share information about your use of our website with our social media, advertising and analytics partners, who may combine it with other information you have provided to them or collected from your use of their services. You agree to our cookies if you continue to use our website.

Okay, I understand