Skip to content

mewwme/mewwme-recs-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎧 Mewwme Music Recommendation API

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.


🌐 About This Service

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.


🧠 Recommendation Approach

🔁 Hybrid Intelligence Model

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.


🎲 Smart Exploration

To prevent recommendation stagnation, the API applies an epsilon-greedy exploration strategy, allowing:

  • High-confidence recommendations
  • Controlled discovery of new or less-played tracks

📊 Continuous Personalization

User profiles are updated dynamically using real interaction signals:

  • ▶️ Plays
  • ⏭ Skips
  • ❤️ Likes

Over time, recommendations become increasingly accurate and tailored.


⚙️ Technology Stack

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

🚀 Getting Started

Installation

npm install

Environment Setup

cp .env.example .env

Configure:

  • Database connection
  • Redis instance
  • Spotify credentials
  • Server port

Build & Run

Production:

npm run build
npm start

Development:

npm run dev

📡 Available Endpoints

🎵 Generate Recommendations

GET /recommend/:userId

Returns a personalized list of recommended tracks for a user.


📝 Log User Interaction

POST /interaction

Records user activity (play, skip, like) to refine future recommendations.


❤️ Service Health Check

GET /health

Provides system health status for monitoring and uptime checks.


🏋️ Model Training

To refresh or retrain user embeddings:

npm run train

This recalculates preference vectors based on accumulated interaction data.


🧪 Testing

Run the test suite:

npm test

Watch mode:

npm run test:watch

🏗 Architecture Philosophy

This 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

About

An intelligent recommendation engine built to power personalized music discovery within the Mewwme Music Bot ecosystem.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 98.0%
  • JavaScript 2.0%