← All work

Music · Spotify · Prototype

Monolith Ultra: an AI planner for a messy Spotify library

It reads a large Spotify library in stages, lets me set firm limits first, then has Claude plan new combined playlists, without ever deleting an original.

Diagram of Monolith Ultra’s five stages, from quick scan to creating new playlists
The five stages

The idea

Years of playlists pile up. Monolith Ultra reads the whole library and proposes a smaller set of “master stacks”: new playlists that combine related ones, each with a reason. I review every proposal before anything is created.

How it works

  1. 1A quick scan lists playlists and sizes, without fetching every track.
  2. 2I set the limits: which playlists are off-limits and how much new music to mix in.
  3. 3A deep scan reads the tracks in the playlists I approved, and keeps them so later runs don’t start over.
  4. 4Claude plans the stacks and explains each one; I can open any card to see exactly which playlists and tracks it draws on.
  5. 5Approved stacks are created as new playlists. The originals are never touched.

The stack

Backend

  • PythonThe service that talks to Spotify and runs the jobs
  • FastAPIThe API, background jobs and live progress over server-sent events
  • PydanticRequest and response schemas
  • SQLAlchemyModels for sessions, scans, plans and runs
  • SupabaseHosted Postgres, used as a plain database
  • Spotify Web APIReading the library and creating playlists, through Spotipy
  • pytestTests for the scanner, planner and execution

Frontend

  • React
  • TypeScriptShared types for the API’s contracts
  • Vite
  • TanStack QueryFetching, caching and polling the job state
  • VitestTests for session behavior and layout

AI and building

  • Anthropic APIClaude plans the stacks and explains each one
  • OpenAI CodexWrote the code, one prompt at a time in my code editor

Technical decisions

  1. 1No deleting, enforced in the backend rather than promised in the interface. The server only creates playlists, and deleting an original isn’t a setting that could be switched on by mistake.
  2. 2Resumable sessions instead of one scan-and-plan run. One big run was too fragile for a real library and too hard to resume, so each stage is a separate saved job. Spotify limits requests, so later runs reuse the cached scan unless I ask for a fresh one.
  3. 3Limits before analysis. Off-limits playlists are set after a quick scan and before the expensive deep scan, so the planner only sees what it’s allowed to use.
  4. 4Show the AI’s working. Recommendations need their sources visible to earn trust, so each proposed stack lists the playlists and tracks it draws on, and any one stack can be reworked without re-planning the rest.
  5. 5Managed Postgres instead of a local-only database. It’s free at this size, has room to grow, and suits structured workflow state alongside large JSON planning results. It’s used as a database only, not for sign-in.
  6. 6Build the backend wider than the interface. The mix of new music can be anywhere from 0% to 100% in the data model, while the screen caps it for now, so the interface can change without a backend redesign.

How it was built

I built it in April 2026 with OpenAI’s Codex inside my code editor, one prompt at a time on my laptop. It has written product rules, a decision log with the reasoning behind each choice, a change log, and tests for the scanner and the planner. But it went into GitHub in one go, with no automated checks or preview builds, which is what my later projects added.

Where it stands

A working prototype: a Python service for Spotify, a React front end, and Claude for the planning. The full scan needs more work before it handles very large libraries. I plan to finish it, with a new design, so I can actually use it.

Why I built it

My own library had grown past the point where I could find anything, and sorting it by hand was never going to happen. It was also a good test of letting an AI make suggestions where a mistake would be expensive, with the guardrails built into the server rather than promised on screen.

How it gets built

The pipeline I build with, and the rules behind it, are on How I build with AI.