An intelligent recommendation engine built to power personalized music discovery within the Mewwme Music Bot ecosystem.
This service delivers adaptive, behavior-driven music suggestions using a hybrid machine learning approach designed for real-time environments.
The Mewwme Music Recommendation API is a standalone microservice responsible for generating smart track suggestions based on:
- User listening behavior
- Interaction feedback signals
- Audio feature similarity
- Controlled exploration mechanisms
It is designed to integrate seamlessly with the Mewwme Music Bot while remaining scalable and independently deployable.
The system combines two complementary strategies:
-
Collaborative Filtering Understands user taste by analyzing listening patterns across users.
-
Content-Based Filtering Matches songs based on acoustic similarity and track metadata.
This hybrid design ensures both personalization and diversity in recommendations.
To prevent recommendation stagnation, the API applies an epsilon-greedy exploration strategy, allowing:
- High-confidence recommendations
- Controlled discovery of new or less-played tracks
User profiles are updated dynamically using real interaction signals:
▶️ Plays- ⏭ Skips
- ❤️ Likes
Over time, recommendations become increasingly accurate and tailored.
Built using a modern, production-ready stack:
- TypeScript for type safety and maintainability
- Node.js + Express for API handling
- TensorFlow.js for embedding and model computations
- PostgreSQL for structured data storage
- Redis for caching and performance optimization
- Spotify API for track metadata and audio features
npm installcp .env.example .envConfigure:
- Database connection
- Redis instance
- Spotify credentials
- Server port
Production:
npm run build
npm startDevelopment:
npm run devGET /recommend/:userId
Returns a personalized list of recommended tracks for a user.
POST /interaction
Records user activity (play, skip, like) to refine future recommendations.
GET /health
Provides system health status for monitoring and uptime checks.
To refresh or retrain user embeddings:
npm run trainThis recalculates preference vectors based on accumulated interaction data.
Run the test suite:
npm testWatch mode:
npm run test:watchThis API was built to:
- Support scalable recommendation workloads
- Improve personalization over time
- Operate independently as a microservice
- Seamlessly integrate with the Mewwme Music Bot infrastructure