skip to content
Brendan Desjardins

Backend / Search

Natural Language Playlist Generator

A playlist recommender that turns free-text descriptions into personalized Spotify recommendations using vector search and multi-stage ranking.

The idea

This started from wanting to type something like “late night drive with chill 2000s music” into Spotify and have immediate recommendations rather than searching for playlists by name or manually adding songs one at a time.

I thought it would also be a fun way to play around with embeddings and vector search on something where I could immediately tell whether the results were actually good. I used the Spotify Million Playlist Dataset as the starting point and eventually indexed more than 600,000 playlist-title embeddings.

What I’ve built

The backend uses FastAPI and Qdrant to retrieve songs and playlists that are semantically related to a natural-language prompt. Rather than just returning the nearest vectors, I built a multi-stage retrieval and ranking pipeline that combines global candidates with recommendations personalized from a user’s Spotify data.

The final ranking uses maximal marginal relevance to balance relevance with diversity, since returning twenty extremely similar songs technically scores well but usually makes for a pretty bad playlist. The application has a React frontend, runs on GCP, and uses GitHub Actions and pytest for CI.

Why I keep working on it

This project has been fun to iterate on, not for the purpose of building the worlds most advanced recommendation system, but for the sake of experimenting with search and ranking technologies on a product I actually enjoy using.

It also taught me pretty quickly that retrieval is only the first part of recommendation. Getting a list of mathematically similar results is easy compared with getting a list that actually feels coherent, personalized, and not repetitive.