Skip to content

Case study · Digital Health

Safety-Aware Mental-Health AI Assistant

A RAG-grounded mental-health support assistant with mood assessment and tracking, CBT and mindfulness guidance, session memory and automatic crisis-risk detection that points users to helplines.

Client
Mental-health startup (MVP)
Project
Namhee
Status
Delivered
Pass rate across 11 core tests
100%
RAG response target
<5s
Crisis-risk escalation
Auto

The challenge

A mental-health startup needed a supportive assistant that could guide users with evidence-based techniques.

Safety was non-negotiable: the assistant had to recognize crisis signals and route people to real help instead of improvising.

System architecture4 stages
  1. 01

    ScreenCrisis-risk detection

  2. 02

    RetrievePinecone CBT/mindfulness corpus

  3. 03

    GenerateGPT-4o via LangChain

  4. 04

    RememberSession memory and mood history

Architecture · 4 stages

  1. 01

    Screen

    Crisis-risk detection

  2. 02

    Retrieve

    Pinecone CBT/mindfulness corpus

  3. 03

    Generate

    GPT-4o via LangChain

  4. 04

    Remember

    Session memory and mood history

The solution

I built a FastAPI service with LangChain orchestration over GPT-4o, grounded in a Pinecone knowledge base of CBT and mindfulness material. The assistant runs mood assessments, tracks mood over time and keeps session memory for continuity.

A dedicated risk-detection layer screens messages and surfaces crisis helplines when warning signs appear. The MVP shipped production-ready with a 100% pass rate across 11 core automated tests and documented performance targets, including sub-5-second RAG responses.

Engineering highlights

  • Automatic crisis-risk detection with helpline escalation
  • Mood assessment and longitudinal mood tracking
  • CBT and mindfulness guidance grounded in a curated corpus
  • Session memory for continuity of care

Technology

  • Python
  • FastAPI
  • LangChain
  • Pinecone
  • GPT-4o

Building something similar?

Get a candid view of the architecture, risks and timeline on a free 30-minute call, or ask the AI assistant how this approach would map to your project.

Book a discovery call
Available for new engagements

Have an AI initiative in mind? Let’s scope it in 30 minutes.

Free discovery call. You'll leave with a clear view of the architecture, risks and next steps, whether or not we work together. I reply within 24 hours.

Not ready to talk yet? Get an instant project plan.