Skip to content

[FEATURE] Optional LLM post-processing to refine sonic clusters by cultural context #666

Description

@iChenchus

Related to: the "Centralized DB for similar song suggestion" item in the Feature & Improvement Tracker (#17). This proposes a complementary, lighter approach aimed at a specific, recurring problem with automatic playlists.

Is your feature request related to a problem? Please describe.

On a culturally mixed library, the sonic clustering produces playlists that are acoustically coherent but unlistenable as a single session.

Concrete example from my own library. An auto-generated playlist grouped early Delta blues (Charley Patton, Skip James, Blind Willie Johnson, Geeshie Wiley) together with traditional Spanish copla and Asturian folk (Juanito Valderrama, José González "El Presi"). Sonically the model is right: both share bare upfront vocals, acoustic guitar, sparse recording, slow tempo. But no human would play Mississippi Delta blues and Andalusian copla back to back — they belong to completely different listening contexts.

The clustering groups by how it sounds, not by when/why/for whom you would listen to it. The more culturally diverse the library, the worse this gets (the same would happen to a Japanese user mixing city pop, enka and Western music, etc.).

Describe the solution you'd like

An optional LLM pass that runs after clustering and refines/subdivides the resulting clusters using the artist, album and year metadata already stored in the database.

The LLM doesn't need to be powerful for this — even a small model reliably knows that "El Presi" is Asturian folk and Charley Patton is Delta blues, as long as it's fed the artist/album metadata. It would split a mixed sonic cluster into culturally consistent sub-playlists (e.g. "Delta Blues" and "Copla & Asturian folk") instead of one unplayable blend.

This reuses the LLM integration already present for Instant Playlist, so the plumbing largely exists. It would be opt-in (off by default), so users who like the current pure-sonic behaviour are unaffected.

Describe alternatives you've considered

  • Cultural metadata as a clustering input dimension (region/genre/era inferred via LLM, fed before clustering). More powerful but far more invasive to the core clustering — proposed only as a possible future evolution.
  • Manual refinement outside the app (export the playlist, ask an LLM to reorganize it). Works today but is fully manual and doesn't scale.

Additional context

This is purely about contextual refinement using metadata the DB already has — it is independent from, and does not require, any audio reanalysis.

Out of scope here: lyrics matching for non-Latin scripts (Japanese, Arabic, etc.) is a separate embeddings-level problem and not something this LLM pass would address.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions