Spotify AI transforms how you discover music by combining the power of LLMs with Spotify's vast music catalog and your personal listening history. Simply describe what you need in plain language, and AI curates the perfect playlist tailored to your taste.
"I need focus music for coding" β π΅ 10 perfectly matched tracks "Ethiopian chill vibes" β π΅ Authentic Amharic music "Energetic workout mix" β π΅ High-energy tracks that match your style
Describe your mood, activity, or feeling in plain language - no complex filters or searches needed.
Examples:
- "Relaxing evening music for reading"
- "Upbeat French rap for my morning run"
- "Melancholic indie for a rainy day"
- "K-pop dance tracks for a party"
The AI understands context beyond just keywords:
- β° Time of Day - Morning energy vs. evening calm
- π Day of Week - Weekend vibes vs. weekday focus
- π€οΈ Weather Conditions - Rainy day moods, sunny energy
- π Emotional State - Detected from your description
- π΅ Music Psychology - Energy levels (0-1), Valence (-1 to 1)
Unlike generic playlists, Spotify AI learns from your unique listening history:
β¨ Taste Profile Analysis
- Your top 50 artists
- Favorite genres and sub-genres
- Recent listening patterns
- Energy/valence preferences
- Preferred musical eras (2010s, 2020s, etc.)
β¨ Smart Balancing
- 60% Familiar - Artists and genres you love
- 40% Discovery - New tracks aligned with your taste
- Adjustable discovery level (familiar/balanced/discovery)
β¨ Continuous Learning
- Updates preferences after each generation
- Learns your favorite vibes and genres
- Adapts to your evolving taste
Not satisfied? Get a completely different playlist with the same vibe in one click:
- Same mood and style
- Fresh track selection
- New AI ranking
- Same personalization
Every track comes with detailed reasoning:
Track: "Yedi Gosh" by Aster Aweke
Overall Match: 98%
Why selected:
β’ Authentic Ethiopian/Amharic artist matching your request
β’ Soft, contemplative energy perfect for the mood
β’ Artist appears in your recent listening history
β’ High popularity ensures quality
Taste Alignment: 95% - "Matches your Ethiopian music taste"
Mood Fit: 92% - "Perfect for cloudy day introspection"
Your AI assistant remembers and learns:
- π΅ Saved Vibes - Keep your last 5 favorite moods
- πΈ Genre Preferences - Top 10 genres you enjoy
- β‘ Energy Levels - Your preferred intensity (0-1)
- π Mood Preferences - Valence from melancholic to uplifting
- π Playlist Length - 5-50 tracks (default: 10)
- π Discovery Level - How adventurous you want to be
- π Generation History - Total playlists created
Built on top of a Spotify Web Client with:
βΆοΈ Real-time Playback - Spotify Playback SDK integration- ποΈ Full Controls - Play, pause, skip, shuffle, repeat
- π Search & Browse - Explore millions of tracks, artists, albums
- π Playlist Management - Create, edit, delete playlists
- β€οΈ Liked Songs - Save and access your favorites
- π± Multi-Device - Switch between devices seamlessly
- π€ Artist Pages - Full discography and related artists
- πΏ Album Views - Track listings and details
Note: Premium Spotify account required for playback features
- π€ OpenAI - Natural language understanding and curation
- π§ Custom Generation Service - Intelligent playlist creation
- π Taste Profiling - User listening history analysis
- π― Smart Ranking - Multi-factor track scoring
- βοΈ React 19 - Modern UI framework
- π TypeScript - Type-safe development
- π¨ Ant Design - Professional UI components
- π Redux - State management
- πΎ Redux Persist - Persistent storage
- π΅ Spotify Web API - Music data and user info
- π Spotify Playback SDK - Real-time playback control
Natural Language Input |
AI Processing |
Curated Playlist |
Selection Reasoning |
Emotion Mapping |
Save & Play |
- Node.js 16+ and Yarn
- Spotify Premium account
- Spotify Developer App credentials
- OpenAI API key
-
Clone the repository
git clone https://github.com/yeabwang/spotify_ai.git cd spotify_ai -
Install dependencies
yarn install
-
Configure environment variables
Copy
.env.distto.envand fill in the required values:cp .env.dist .env
Edit
.envwith your credentials:# Required: Spotify API Configuration REACT_APP_SPOTIFY_CLIENT_ID=<your_spotify_client_id> REACT_APP_SPOTIFY_REDIRECT_URL=http://localhost:3000 # Optional: OpenAI API Key (can also be entered in Settings page) REACT_APP_OPENAI_API_KEY=<your_openai_api_key>
Get your Spotify credentials:
- Go to Spotify Developer Dashboard
- Create a new app
- Copy the Client ID
- Add
http://localhost:3000as a Redirect URI in your app settings
-
Start the development server
yarn start
-
Open your browser
Navigate to
http://localhost:3000 -
Configure your OpenAI API key
If you didn't set it in
.env, go to Settings (βοΈ) in the app and enter your OpenAI API key.Get your API key:
- OpenAI: Get your API key from OpenAI Platform
For self-hosted deployments, the following environment variables are required:
| Variable | Required | Description |
|---|---|---|
REACT_APP_SPOTIFY_CLIENT_ID |
Yes | Your Spotify app's Client ID |
REACT_APP_SPOTIFY_REDIRECT_URL |
Yes | Must match your deployment URL exactly |
REACT_APP_OPENAI_API_KEY |
No | Optional; users can enter in Settings |
REACT_APP_OPENAI_MODEL |
No | Defaults to gpt-5.2-chat-latest |
Important: The REACT_APP_SPOTIFY_REDIRECT_URL must exactly match:
- The URL where your app is deployed (e.g.,
https://your-domain.com) - A Redirect URI configured in your Spotify Developer Dashboard
Customize AI behavior (optional):
Modify src/config/ai.config.ts to adjust:
- Model selection and parameters
- Scoring weights (taste, mood, popularity, play frequency)
- Generation defaults (track count, discovery level)
- Preference storage settings
yarn buildThe build files will be in the build/ directory.
Simply type what you want in natural language:
- "Chill music for studying"
- "Upbeat workout tracks"
- "Relaxing Ethiopian music"
The system:
- Loads your Spotify listening history
- Analyzes your taste profile
- Understands the mood and context
- Creates a personalized music plan
Receive 10 perfectly curated tracks with:
- Overall match scores
- Detailed explanations
- Play/Save options
- Regenerate for different tracks
- Adjust discovery level
- Update preferences
- Save favorite vibes
- Generation Service API - Detailed API documentation for developers
- Spotify Web API Docs - Official Spotify API reference
- OpenAI API Docs - OpenAI API documentation
This project is built upon the excellent Spotify React Web Client created by Franco Borrelli.
π Original Project: francoborrelli/spotify-react-web-client
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Playback features require a Spotify Premium subscription
- Free accounts can browse but cannot play music
- AI features use OpenAI's API (configurable model)
- Each playlist generation makes 3-4 API calls
- Estimated cost varies by model
- Configure model and timeouts in src/config/ai.config.ts
- Consider implementing rate limiting for production
- Spotify API: 180 requests per minute
- OpenAI API: Depends on your tier
- Built-in delays to prevent rate limiting
If you encounter any issues or have questions:
- Check the AI Documentation
- Review existing Issues
- Open a new issue in this repository
- Check the original repository
- Review existing Issues
- Open a new issue in Franco's repository
If you find this project useful, please consider:
- β Starring the repository
- π Reporting bugs
- π‘ Suggesting new features
- π€ Contributing code
- π’ Sharing with others
Made with β€οΈ






