MindCure is the world's first voice-first mental health platform powered by an ecosystem of specialized LiveKit AI agents. We've revolutionized mental healthcare by combining real-time voice therapy, browser automation, and intelligent agent orchestration in a single unified platform.
- Gemini Live Integration for natural, empathetic conversations
- Sub-250ms Latency through LiveKit's WebRTC infrastructure
- Continuous Voice Processing with advanced turn detection
- Therapeutic Context maintained across all specialist agents
- Orchestrator Agent - Routes conversations to appropriate specialists
- Task Generator Agent - Creates personalized mental health tasks
- Productivity Agent - Goal tracking and habit formation coaching
- Crisis Detection Agent - Emergency intervention and risk assessment
- Therapist Matcher Agent - Professional therapy booking assistance
- P2P Coordinator Agent - Anonymous peer support matching
- Operator Agent - Browser automation with real-time narration
- Gemini Live Agent - Primary voice therapy interface
- Smart Matching algorithm based on conditions, location, and insurance
- Real-time Booking system with availability management
- Video/Voice Sessions via LiveKit integration
- Insurance Verification and automated billing
- Crisis-Priority Scheduling for urgent mental health needs
- Anonymous Matching similar to Omegle but for mental health support
- Mood-based Pairing using AI to connect compatible users
- Safety Moderation with AI content filtering and crisis detection
- Support Groups and community features
- AI-Generated Tasks personalized to improve mental health
- Habit Formation tracking and guidance
- Integrated Scoring linking productivity to mental wellness
- Progress Analytics and achievement systems
- Real-time Detection using LangChain agents and keyword analysis
- Automatic Escalation to professional services
- Emergency Contacts and crisis hotline integration
- Safety Protocols and follow-up care coordination
ββββ LangChain Multi-Agent System βββββ ββββ External Services ββββββ
β β β β
β Master Orchestrator Agent β β π Kaggle GPU (Bark TTS) β
β βββ Mental Health Agent ββββββ€ π€ Whisper STT β
β βββ Crisis Detection Agent β β π§ Gemini Pro LLM β
β βββ Therapist Matching Agent β β π LiveKit RTC β
β βββ P2P Coordinator Agent β β πΎ PostgreSQL DB β
β βββ Productivity Agent β β β‘ Redis Cache β
β βββ Task Generator Agent β β β
β β βββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββ
- Python 3.12+ with pip
- Node.js 18+ and npm
- PostgreSQL 14+ database
- Redis 6+ for caching
- API Keys: Google Gemini, Kaggle, LiveKit
cd backend
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/Mac
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env with your API keys
# Initialize database
python init_db.py
# Start backend server
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000cd frontend
npm install
# Start development server
npm run dev- Upload
kaggle/bark-tts-api.ipynbto Kaggle - Enable GPU (P100 or T4)
- Install ngrok for API tunnel
- Update
BARK_TTS_ENDPOINTin.env
- Authentication:
/api/v1/auth/(register, login, refresh) - Mental Health:
/api/v1/mental-health/(AI therapy, scores, crisis) - Professional Therapy:
/api/v1/therapists/(search, book, sessions) - Peer Support:
/api/v1/p2p/(matching, connections, safety) - Productivity:
/api/v1/productivity/(tasks, goals, habits) - Crisis Support:
/api/v1/crisis/(emergency, resources, follow-up)
Interactive Documentation: http://localhost:8000/docs
- Master Orchestrator: Routes requests and maintains context
- Mental Health Agent: Conducts therapeutic conversations
- Crisis Detection Agent: Real-time risk assessment and escalation
- Therapist Matching Agent: Intelligent professional matching
- P2P Coordinator Agent: Safe peer support connections
- Productivity Agent: Mental health-integrated task coaching
- Task Generator Agent: Personalized task creation
- users: Account management and authentication
- user_profiles: Mental health scores and preferences
- therapists: Professional directory and credentials
- sessions: Therapy and support session records
- tasks: Mental health and productivity tasks
- conversations: Session dialogue and analysis
- p2p_matches: Peer support connections
- crisis_events: Crisis detection and intervention
- bookings: Professional therapy appointments
- β End-to-end encryption for all communications
- β Data anonymization for AI training
- β Access controls and audit logging
- β Secure data storage with encryption at rest
- β Privacy by design principles
- JWT authentication with refresh tokens
- API rate limiting and DDoS protection
- Input validation and SQL injection prevention
- CORS configuration for secure frontend integration
- TLS/SSL encryption for all data transmission
- Response Times: API < 500ms, Voice < 5 seconds
- Concurrent Users: 500+ simultaneous users
- Database Performance: 1000+ QPS, <100ms latency
- Uptime Target: 99.9% availability
# EC2 t2.micro instance setup
sudo apt update && sudo apt install -y python3.12 postgresql redis-server
git clone <repository-url>
cd mindcure/backend
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python init_db.py
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000cd mindcure/
docker-compose -f aws/deployment/docker-compose.yml up -dmindcure/
βββ backend/ # FastAPI backend with LangChain agents
β βββ agents/ # LangChain multi-agent system
β βββ app/ # FastAPI application core
β βββ services/ # Business logic services
β βββ requirements.txt # Python dependencies
βββ frontend/ # React TypeScript frontend
β βββ src/components/ # UI components
β βββ src/pages/ # Application pages
β βββ src/services/ # API client services
βββ kaggle/ # Bark TTS GPU processing
β βββ bark-tts-api.ipynb # Kaggle notebook for TTS
β βββ deployment-scripts/ # Auto-restart and monitoring
βββ aws/ # Infrastructure and deployment
β βββ infrastructure/ # EC2 setup scripts
β βββ deployment/ # Docker compose files
β βββ monitoring/ # CloudWatch configuration
βββ database/ # Database schemas and migrations
βββ docs/ # Comprehensive documentation
βββ tests/ # Test suites for all components
# Format code
black backend/app/ backend/agents/ backend/services/
# Lint code
flake8 backend/
# Type checking
mypy backend/
# Run tests
pytest backend/tests/ -vRequired environment variables in .env:
DATABASE_URL: PostgreSQL connectionREDIS_URL: Redis connectionGEMINI_API_KEY: Google Gemini APIKAGGLE_API_KEY: Kaggle API for TTSBARK_TTS_ENDPOINT: TTS service URLLIVEKIT_API_KEY: Real-time communicationJWT_SECRET: Authentication secret
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open Pull Request
- Follow PEP 8 style guidelines
- Write comprehensive tests for new features
- Update documentation for API changes
- Ensure HIPAA compliance for health data
- Test crisis detection and safety features thoroughly
- National Suicide Prevention Lifeline: 988
- Crisis Text Line: Text HOME to 741741
- International Association for Suicide Prevention: https://www.iasp.info/resources/Crisis_Centres/
This project is licensed under the MIT License - see the LICENSE file for details.
- LangChain for the multi-agent framework
- FastAPI for the modern web framework
- Kaggle for free GPU access for TTS processing
- Mental health professionals who provided guidance
- Open source community for invaluable tools and libraries
MindCure is designed to support mental health and wellness but is not a substitute for professional medical advice, diagnosis, or treatment. Always seek the advice of qualified health providers with questions about mental health conditions. In case of emergency or crisis, contact local emergency services immediately.
π Privacy Notice
Your privacy and data security are our top priorities. All data is encrypted, anonymized where possible, and handled in compliance with HIPAA regulations. We never share personal information without explicit consent.
Built with β€οΈ for mental health and wellness