Secure AI Mental Health Companion

💡 Inspiration & Mission

The Secure AI Mental Health Companion was created to address two major gaps in today’s mental-health technologies:
1) lack of personalized emotional memory, and
2) unsafe handling of high-risk emotional inputs.

My mission is to build a multi-cloud, safety-first architecture that preserves user privacy, provides contextual advice, and isolates dangerous inputs—turning an AI assistant into a trustworthy, empathetic companion.


🏗️ Multi-Layered Architecture

1. Front-End Interaction

  • HTML + TailwindCSS responsive interface
  • Text and voice check-ins (Web Speech API)
  • Displays past emotional records

2. Core Intelligence (Claude)

  • Flask backend with Anthropic Claude 3 Haiku
  • Performs emotional analysis & risk scoring (0–3)
  • Generates support text + voice script

3. Emotional Memory (Tigris RAG)

  • Tigris S3 + Boto3 used for RAG
  • Retrieves the last 7 days of user check-ins
  • Provides historical context to Claude for personalized advice

4. Voice & Empathy (ElevenLabs)

  • Converts Claude’s supportive script into comforting audio
  • Enhances emotional engagement

5. Operational Security (Daytona Sandbox)

  • If risk_level >= 3:
    • A disposable Daytona Sandbox is automatically created
    • High-risk analysis runs isolated from the main server
  • Ensures proactive safety and strong operational integrity

🧠 Key Learnings

What I Learned

  • How to implement RAG using S3-based JSON history
  • Why sandbox isolation is essential for mental-health AI
  • How to manage multi-API pipelines with error-tolerant design

Challenges I Overcame

  • Persistent 404 errors from mismatched API endpoints
  • Tigris access failures caused by misformatted secret keys
  • Daytona SDK integration requiring careful try/except safeguards
  • Multi-API debugging across Anthropic, ElevenLabs, Tigris, and Daytona

✅ Summary

This project goes beyond calling an LLM—it demonstrates how I built a responsible, secure, multi-cloud emotional support system. The combination of empathy, RAG-based memory, and disposable sandbox safety ensures users receive contextual, safe, and supportive interactions.


Built With

  • any-high-risk-input-detected-by-claude-immediately-triggers-a-dynamic-daytona-sandbox-to-perform-isolated
  • claude
  • css
  • daytona
  • deep-diagnostics
  • elevenlabs
  • flask
  • html
  • memory-aware-advice
  • python
  • retrieving-the-user's-past-check-in-history-as-context.-the-user-experience-is-enriched-by-elevenlabs-tts
  • tigris
  • to-maintain-operational-integrity-and-safety
  • we-leverage-tigris-s3-to-implement-rag
  • which-converts-the-support-script-into-a-comforting-voice-reply.-crucially
Share this project:

Updates