← All posts

Music / Build notes · · Updated 23 September 2026

Getting better recommendations on Spotify.

A small experiment in music discovery. The method, the limits, and a notebook you can change.

I wanted a playlist that could move beyond songs I already knew. A change of theme was not enough. I wanted control over how far the music moved from my usual taste.

The question was simple: can I start with music I like and control how far the next playlist travels? House to deep house could be a small step. House to acid jazz could take a longer path, with something familiar along the way.

I started with a notebook so I could inspect the data and change the rules before building an interface. The connected app is intended for a small group of friends. This article and the notebook source are for anyone who wants to understand or adapt the experiment.

From input to recommendations

What we built, step by step.

  1. Source recordings, then check the evidence.

    We collected a research sample of 1,258 recordings from MusicBrainz. Titles, artist credits, recording IDs, and community genre tags form the starting data. We keep source details and file hashes so a result can be traced to the catalog that produced it. This is a small, uneven sample, not the whole music catalog.

  2. Turn a playlist into a preference profile.

    Match each input song to independent genre evidence. If a recording has no usable tags, an unambiguous artist match can provide a lower-weight estimate. Unknown and ambiguous matches stay visible. Our first saved input covered only 25 songs from a 715-song playlist; 23 had usable profiles, mostly from artist tags. That is limited evidence, not a complete picture of the listener.

  3. Connect genres in a graph.

    The initial map has 30 genres. Links have editable costs, and the model measures the shortest path through those links. A playlist keeps a mix of genre weights instead of becoming one label. The positions on the drawing do not affect the result. The connections are assumptions we can change, not a universal map of music.

    House → deep house Closer
    House → disco → funk → acid jazz Further

  4. Choose a distance, then build the list.

    The exploration control sets a target distance. Candidates score well when their genre distance falls near that target. A variety setting reduces repeated genre combinations. We remove known input songs, limit repeated artists, and return fewer songs if the catalog cannot fill the request. Each result shows the genre path that helped select it.

  5. Listen, compare, and adjust.

    The notebook compares exploration settings on the same catalog and exports the results, settings, and a feedback sheet. Mark whether a song was familiar, fit the request, and was worth keeping. Tune with one set of ratings, then check a separate set. A working distance control alone does not prove better recommendations.

What “song analysis” means here.

This version analyzes metadata and genre relationships. It does not listen to audio or measure tempo, instruments, mood, emotional changes, or Spotify stream counts. Artist tags can miss what makes an individual song different. A distant genre is not necessarily niche, and a song outside the input playlist can still be familiar.

The model has optional inputs for tempo, instruments, and audience counts, but their weights stay at zero without real evidence. Those are future data additions. We have not trained an audio model or shown that this method outperforms Spotify.

Why the connected app stays small

Spotify access has a separate limit.

As checked on 23 September 2026, new development apps allow five authenticated users added to an allowlist, and the owner needs Premium. Existing apps can retain users above that limit. See Spotify's quota rules and 2026 migration guide.

Extended access currently requires an organization with a launched service and at least 250,000 monthly active users, among other conditions. That is application eligibility, not automatic approval. My reading is that the service must already have that audience; the development app is not expected to grow its allowlist to 250,000.

For this experiment, the practical split is a small private trial plus a public explanation and source repository. Running your own copy uses your own app and its limits. It does not grant extended access or remove Spotify's developer policy requirements.

Open source / Run it yourself

Start with the notebook.

Read the notebook and supporting code on GitHub before running anything. Open it in Google Colab to try it in your browser, or clone the repository to run it locally. The original code is supplied under the MIT License and uses the same recommendation model as the local interface.

  1. Open the notebook in Colab and read the setup cell. It loads the supporting files from the public repository, installs the plotting packages, and fetches a MusicBrainz research catalog. No GPU is needed.
  2. Run the remaining cells. Start with a genre; Spotify is optional for this first run. Save a copy to Drive to keep edits, and save wanted results before the temporary runtime ends.
  3. To use your own playlist, create your own Spotify developer app, allowlist your account, and obtain a user access token through Spotify's PKCE flow. The README explains how to supply the token locally and select playlist input. Use a playlist you own or collaborate on.
  4. Run the notebook, inspect unresolved songs, and adjust the graph and controls. Export recommendations and record listening feedback.

The repository starts in genre mode and does not include our playlist snapshot, research catalog, saved outputs, or credentials. You fetch your own data. The notebook returns a recommendation list and CSV; direct saving to Spotify is part of the separate connected interface. If you use Spotify input in Colab, the token and input run in your Google-hosted runtime. The README also covers local setup.

Code licensing and data licensing are separate. MusicBrainz core metadata is CC0; community tags use CC BY-NC-SA 3.0. The supplied collector is for local research with those tags. A public or commercial service needs suitable data rights. Spotify access also remains subject to its policy, including restrictions on content analysis and profiling; this experiment is not a claim of Spotify approval.

For invited testers

The private trial.

Spotify connection is for accounts on the app's allowlist once the connection is enabled. It is not an open signup. Everyone can read the method and open the notebook above.

In the connected trial, import a playlist, generate recommendations, then select Save to Spotify. The tool checks recording matches and creates a new private playlist. Review missing matches before saving the rest. Disconnecting removes imported preferences and their generated lists here; playlists already saved in Spotify remain. See the privacy notes.