A comprehensive mental health support platform featuring a voice assistant with AI-powered counseling capabilities, text-to-speech synthesis, and session reporting.
- Voice Assistant: Interactive voice-based mental health support with speech recognition
- AI Counseling: Powered by Qwen2.5:3b LLM for empathetic responses
- Text-to-Speech: Multiple TTS options including Azure Neural TTS and edge-tts
- Safety Detection: Risk assessment and crisis intervention capabilities
- Session Reporting: Detailed analytics and sentiment tracking
- Multi-language Support: English and Hindi language support
- Web Interface: User-friendly testing interface
The platform consists of three main components:
-
Voice Assistant Server (Node.js) - Port 3000
- Session management
- AI dialogue processing
- Safety risk detection
- Report generation
-
TTS Server (Python FastAPI) - Port 5002
- Azure Neural TTS integration
- edge-tts fallback
- Multi-language voice synthesis
-
Client Interface (React Native)
- Mobile application interface
- Voice interaction UI
- Node.js (v16 or higher)
- Python 3.8+
- Git
-
Clone the repository
git clone <repository-url> cd mental-health-platform
-
Install Voice Assistant Dependencies
cd voiceAssistant npm install -
Install TTS Server Dependencies
cd voiceAssistant pip install fastapi uvicorn edge-tts azure-cognitiveservices-speech -
Install Client Dependencies
cd client npm install -
Install Server Dependencies
cd server npm install
Create a .env file in the voiceAssistant directory:
# LLM Configuration
USE_LLM=1
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=qwen2.5:3b
# Azure Speech Services (Optional - will fallback to edge-tts if not set)
SPEECH_KEY=your_azure_speech_key
SPEECH_REGION=your_azure_regionnpm run dev-
Start Voice Assistant Server
cd voiceAssistant node server.js -
Start TTS Server
cd voiceAssistant python tts_server.py -
Start Client
cd client npm run dev -
Start Backend Server
cd server npm run dev
- Voice Assistant Web Interface: http://localhost:3000
- TTS Server API: http://localhost:5002
- Client Application: http://localhost:3001 (or as configured)
- Backend API: http://localhost:8000 (or as configured)
- Open http://localhost:3000 in your browser
- Click "Start Session"
- Allow microphone permissions
- Use "Push to Talk" or type in the text input
- Test different voice modes (Auto, Local, Neural)
# Test Voice Assistant Health
curl http://localhost:3000/api/llm/health
# Test TTS Server
curl http://localhost:5002/voices
# Test TTS Synthesis
curl -X POST http://localhost:5002/speak \
-H "Content-Type: application/json" \
-d '{"text": "Hello, this is a test."}'- Default English Voice: en-IN-NeerjaNeural
- Default Hindi Voice: hi-IN-SwaraNeural
- Voice Modes: Auto (prefer local), Local only, Neural (Python TTS)
- Crisis keyword detection
- Risk level assessment (high/medium)
- Automatic safety responses
- Session risk flagging
- Model: Qwen2.5:3b (3.1B parameters)
- Temperature: 0.72
- Context window: 2048 tokens
- Fallback to rule-based responses if LLM unavailable
The platform generates detailed session reports including:
- Sentiment analysis over time
- Key topics discussed
- Coping strategies suggested
- Risk flags detected
- Session duration and timing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow existing code style and patterns
- Add tests for new features
- Update documentation as needed
- Ensure all services start without errors
- Test voice functionality across different browsers
Start a new counseling session
{
"locale": "en-IN"
}Process user input and get AI response
{
"sessionId": "session-id",
"userText": "I'm feeling anxious about exams"
}End session and generate report
{
"sessionId": "session-id"
}Generate speech from text
{
"text": "Hello, how are you?",
"voice": "en-IN-NeerjaNeural",
"pace": 0.95,
"semitones": 0.5
}Get available voices list
- All conversations are processed locally when possible
- No data is stored permanently without user consent
- Crisis detection triggers appropriate safety responses
- Session reports are generated locally and can be saved privately
This project is licensed under the MIT License - see the LICENSE file for details.
For technical support or questions:
- Create an issue in the GitHub repository
- Check the troubleshooting section in the documentation
- Review the API documentation for integration help
- Mobile app improvements
- Additional language support
- Advanced analytics dashboard
- Integration with external counseling services
- Offline mode capabilities
- Voice emotion detection
- Group session support