InnerAI is a sophisticated mental health companion that uses Google's Gemini AI to provide intelligent, empathetic, and therapeutic-quality conversations for emotional support and mental wellness.
- Advanced Natural Language Understanding: Goes beyond keyword matching to understand context, nuance, and emotional subtext
- Therapeutic-Grade Responses: Uses evidence-based therapy principles (CBT, DBT, person-centered therapy)
- Conversation Memory: Maintains context across conversations for personalized support
- Risk Assessment: Intelligent detection of mental health concerns and crisis situations
- 20+ Mental Health Conditions detected with AI-level accuracy
- Sophisticated emotion analysis that understands intensity, triggers, and patterns
- Personalized therapeutic recommendations based on individual needs
- Real-time mood tracking and emotional journey analysis
- Emotion-Based Recommendations: AI analyzes your emotional state and curates Spotify playlists
- Audio Feature Matching: Uses Spotify's audio analysis (valence, energy, acousticness) to match music to your mood
- Therapeutic Playlists: Access to professionally curated playlists for mental health
- Real-time Music Suggestions: Dynamic recommendations that adapt to your emotional journey
- Crisis Detection: Automatic identification of high-risk situations with appropriate resources
- Music Therapy: AI-recommended therapeutic music based on emotional state
- Breathing Exercises: Guided mindfulness and stress relief techniques
- Progress Tracking: Comprehensive dashboard with insights and growth metrics
- Node.js 18+
- A Google Gemini API key (free tier available)
- Spotify Developer Account (for music therapy features)
- Clone and Install
git clone <repository-url>
cd innerai
npm install- Configure API Keys
- Copy
.env.exampleto.env - Get your free Gemini API key from Google AI Studio
- Get your Spotify credentials from Spotify Developer Dashboard
- Update your
.envfile:
- Copy
# Gemini AI Configuration
VITE_GEMINI_API_KEY=your_gemini_api_key_here
VITE_GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent
# Spotify Integration
VITE_SPOTIFY_CLIENT_ID=your_spotify_client_id_here
VITE_SPOTIFY_CLIENT_SECRET=your_spotify_client_secret_here- Start the Application
npm run dev- Verify Integrations
- The app will show "AI Active" indicators when Gemini is connected
- Spotify integration will be available in the Music Therapy section
- Check browser console for connection status
- Natural dialogue that feels like talking to an understanding friend
- Therapeutic insights woven naturally into conversations
- Personalized responses based on your emotional patterns and history
- Crisis-sensitive with appropriate safety resources
- Real-time emotion detection from your messages
- Pattern recognition for triggers, coping strategies, and growth areas
- Mental health screening for 20+ conditions with confidence scoring
- Progress tracking over time with detailed insights
- Emotion-based music curation using Spotify's vast library
- Audio feature analysis to match music to your emotional needs
- Therapeutic playlists professionally curated for mental health
- Real-time recommendations that adapt as your mood changes
- Search functionality to find specific songs or artists
- Seamless Spotify integration with direct links to play music
- 4-7-8 Breathing Exercise with guided animation and progress tracking
- Local Music Library with emotion-based recommendations
- Grounding Techniques for anxiety and overwhelm
- Mindfulness Exercises integrated into conversations
- Crisis detection with immediate resource provision
- Risk assessment with protective factor identification
- Professional referral recommendations when appropriate
- 24/7 crisis hotline integration (988, Crisis Text Line)
- Emotional journey visualization and trends
- Achievement system with meaningful milestones
- Goal setting and progress tracking
- Comprehensive insights for personal growth
- Gemini 1.5 Flash for natural language processing
- Advanced prompt engineering for therapeutic responses
- Conversation memory with context preservation
- Fallback systems for reliability
- Client Credentials Flow for accessing Spotify's API
- Audio Features Analysis for emotion-based matching
- Recommendation Engine using Spotify's machine learning
- Real-time search and playlist curation
- React 18 with TypeScript for type safety
- Tailwind CSS for responsive, beautiful design
- Lucide React for consistent iconography
- Anime.js for smooth animations and micro-interactions
- Evidence-based therapeutic techniques
- HIPAA-conscious design (no data storage)
- Crisis intervention protocols
- Professional-grade mental health screening
- Go to Spotify Developer Dashboard
- Click "Create App"
- Fill in app details:
- App Name: InnerAI Music Therapy
- App Description: Mental health music therapy integration
- Redirect URI:
http://localhost:5173(for development)
- Save your Client ID and Client Secret
Add your Spotify credentials to .env:
VITE_SPOTIFY_CLIENT_ID=your_client_id_here
VITE_SPOTIFY_CLIENT_SECRET=your_client_secret_here- Emotion Detection: AI analyzes your emotional state from conversations
- Audio Feature Mapping: Each emotion maps to specific audio characteristics:
- Anxious: Low energy, high acousticness, slow tempo
- Happy: High valence, medium energy, upbeat tempo
- Sad: Low valence, low energy, acoustic instruments
- Spotify API: Fetches recommendations based on these audio features
- Curated Playlists: Searches for professionally made therapeutic playlists
- Real-time Updates: Recommendations update as your emotional state changes
- β Emotion-based track recommendations
- β Curated therapeutic playlists
- β Search functionality
- β Direct Spotify links
- β Audio feature analysis
- β Real-time mood adaptation
- No conversation storage - conversations are not saved
- Local processing - emotional analysis happens in your browser
- No tracking - your privacy is completely protected
- Spotify data - Only public data accessed, no personal playlists
- Crisis detection with immediate resource provision
- Professional referrals when appropriate
- Clear disclaimers about AI limitations
- Emergency resources always accessible
- Secure token management for Spotify integration
- Rate limiting to prevent API abuse
- Error handling with graceful fallbacks
- No sensitive data storage
npm run devnpm run build
npm run preview# Required for AI features
VITE_GEMINI_API_KEY=your_api_key_here
VITE_GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-latest:generateContent
# Required for Spotify music therapy
VITE_SPOTIFY_CLIENT_ID=your_spotify_client_id_here
VITE_SPOTIFY_CLIENT_SECRET=your_spotify_client_secret_hereWe welcome contributions that improve mental health support and AI capabilities:
- Fork the repository
- Create a feature branch
- Add your improvements
- Test thoroughly (especially mental health features)
- Submit a pull request
- Additional therapeutic techniques
- Enhanced AI prompts and responses
- New mental health screening tools
- Accessibility improvements
- Multi-language support
- Additional music service integrations
- National Suicide Prevention Lifeline - 988
- Crisis Text Line - Text HOME to 741741
- NAMI (National Alliance on Mental Illness)
- Not a replacement for professional mental health care
- Emergency situations require immediate professional help (call 911)
- AI limitations - responses are generated, not from human therapists
- Spotify integration - requires active Spotify account for full functionality
- Seek professional help for persistent or severe mental health concerns
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI for advanced language understanding
- Spotify for music intelligence and therapeutic audio access
- Mental health professionals who informed our therapeutic approaches
- Open source community for the tools and libraries that make this possible
- Users who trust us with their mental health journey
Remember: Your mental health matters. This tool is here to support you, but professional help is always available when you need it. You're not alone. π
- Check that
VITE_GEMINI_API_KEYis set in your.envfile - Verify your API key is valid at Google AI Studio
- Check browser console for error messages
- Ensure you have internet connectivity
- Verify
VITE_SPOTIFY_CLIENT_IDandVITE_SPOTIFY_CLIENT_SECRETare set - Check your Spotify app settings at Spotify Developer Dashboard
- Ensure your app has the correct redirect URIs configured
- Check browser console for Spotify API errors
- Verify your Spotify app is not in development mode restrictions
- Check that audio files are in
public/audio/directory - Verify file paths in
musicLibrary.tsare correct - Ensure audio files are in supported formats (MP3, WAV, OGG, M4A)
- For Spotify tracks, ensure you have an active Spotify account
- Check browser console for loading errors
- Reduce audio file sizes (compress to 128-192 kbps)
- Limit conversation history length
- Clear browser cache and reload
- Check for browser compatibility issues
- Monitor network usage for Spotify API calls
For more help, check the browser console for detailed error messages or create an issue in the repository.