Skip to main content

sonagram

Ask your AI assistant for a playlist from your own music collection — and get a file any music app can play.

sonagram listens to every track you own (tempo, energy, mood, key, how songs feel), organizes what it learns into a fast, searchable map of your library, and lets an AI agent translate your sentence into a typed request. Sonagram's deterministic library engine—not the agent—then selects, orders, audits, and explains the playlist:

"Make me a deep-focus work playlist." "A party mix for Saturday that builds." "Songs like Teardrop, but calmer."

Your music files are never modified, moved, or uploaded — everything happens on your machine.

For AI agents

You are an AI agent and a user asked you to work with their music library — start here:

  1. Installpip install sonagram. Prebuilt wheels cover macOS (Apple Silicon + Intel), Linux x86_64, and Windows x86_64 on Python ≥ 3.9 — no toolchain needed. Only on other platforms does pip fall back to the sdist, which compiles the native core and needs a Rust toolchain (rustup).
  2. Install the skillsonagram skill install. This writes the sonagram-playlist skill to ~/.claude/skills/ (pass --dir <skills_root> for a non-default skills location).
  3. Read the installed SKILL.md and follow it now. It covers library detection, scanning, the optional Last.fm walkthrough, and playlist delivery. A skill only auto-loads at the next session start, so act on it immediately in this one.

Use it through your agent (no code)

This is the main way to use sonagram. One-time setup:

  1. Install itpip install sonagram. That's it on Mac, Windows, and regular Linux — prebuilt packages, nothing to compile. (On unusual platforms pip builds from source, which needs the free Rust toolchain — your agent can sort that out.)
  2. Point it at your musicsonagram sources add ~/Music (repeat for other folders).
  3. Give your agent the skillsonagram skill install.

That's it. From now on, just ask:

  • "make me a deep-focus work playlist"
  • "a party mix for Saturday that builds"
  • "songs like Teardrop but calmer"
  • "which songs do I have multiple versions of? pair them"
  • "what's even in my library?"

The first request analyzes your whole collection (about an hour for ~10,000 songs — your agent will tell you and can let it run in the background). Every request after that takes seconds: sonagram notices what changed, re-reads only that, and keeps the map current — including songs you've added or deleted.

Each playlist is saved with its name, your original request, and the full track list, so you can always ask for it again later (sonagram playlists). The .m3u8 files point straight at your own music files and open in any player.

Optional: better picks with Last.fm. A free Last.fm API key adds richer genre info, song popularity, and "fans also like" connections. Your agent can walk you through getting one — just ask.

CLI (scriptable)

pip install sonagram also gives you the standalone sonagram command (the same shared code path the agent uses, so the two can't drift). Once a source is registered, commands need no path arguments:

sonagram sources add ~/Music     # register a library folder (repeatable)
sonagram status                  # is everything up to date? (exit 0/1/2)
sonagram scan                    # analyze new/changed files → local cache
sonagram enrich                  # optional: fold in Last.fm metadata (needs a key)
sonagram build                   # merge all sources → the central graph
sonagram profile --format json   # curation-relevant coverage/distributions
sonagram curate --preset focus --tracks 25 \
    --name "Deep Focus" --description "a calm work playlist" --format json
sonagram playlists               # list stored playlists (newest first)
sonagram mcp install             # native kglite manifest + revealed music skills

sonagram config shows where everything lives (defaults under ~/.sonagram/) and whether a Last.fm key is set up. Explicit-path forms (sonagram scan ~/Music, sonagram status ~/Music --format json, …) still work for scripting a single library without touching the config, and sonagram playlist ... --copy-to <dir> produces a portable folder — the tracks copied next to the playlist file, ready for a USB stick or another device.

Everything is incremental: a rescan of an unchanged library analyzes nothing and finishes in well under a second.

For building your own agents / integrations

Install Sonagram's safe kglite manifest/revealed skills, then use the absolute launch command it prints—or drive the same library contract from Python:

sonagram mcp install
# RUN: '/absolute/path/sonagram-mcp-server' --graph '/.../music.kgl'

The thin Sonagram frontend embeds KGLite 0.16.7's server and registers typed profile/policy/curate/audit/explain/store tools against its live graph. KGLite still owns MCP, Cypher, graph lifecycle, and generic tools; Sonagram owns only the music-domain handlers.

import sonagram
sonagram.scan("~/Music")
g = sonagram.build("~/Music", out_path="music.kgl")   # a live kglite graph
brief = {"preset": "focus", "target_tracks": 25,
         "target_duration_sec": None, "seed_ids": [],
         "seed_role": "pinned", "unsupported_intents": []}
result = sonagram.curate_playlist("music.kgl", brief)
assert result["exportable"] and result["audit"]["passed"]

Agents get a full manual (AGENT-GUIDE.md: the schema, a query cookbook, and a typed curation contract) plus live-gated kglite skills. Both route final selection/order/audit through the library rather than agent-authored heuristics.

How it works (the short version)

  • sonara does the listening: tempo, key, energy, mood, loudness, structure, and an audio "fingerprint of feel" for every track.
  • kglite stores the map: a graph database with search, similarity, and an agent-friendly query interface.
  • sonagram is the part in between: it decides what the map contains — every song with all its signals, connected to artists, genres, decades, moods, detected styles, and its 10 most similar tracks — and keeps the map exactly reproducible, byte for byte, no matter how often you rescan.

Full documentation (CLI reference, Python API, the graph's schema, and the engineering details) lives on Read the Docs — see docs/.

License: MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sonagram-0.2.7.tar.gz (930.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

sonagram-0.2.7-cp39-abi3-win_amd64.whl (10.8 MB view details)

Uploaded CPython 3.9+Windows x86-64

sonagram-0.2.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.1 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

sonagram-0.2.7-cp39-abi3-macosx_11_0_arm64.whl (9.9 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

sonagram-0.2.7-cp39-abi3-macosx_10_12_x86_64.whl (10.8 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file sonagram-0.2.7.tar.gz.

File metadata

  • Download URL: sonagram-0.2.7.tar.gz
  • Upload date:
  • Size: 930.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sonagram-0.2.7.tar.gz
Algorithm Hash digest
SHA256 e1b63ee44ec561601fa1b7963715999c66e0bccb97fede2d0767b486d8f82356
MD5 09b08510006f4d24a2e4185df9727da9
BLAKE2b-256 1743df3b2e8f8c60a51b80c95cdb518e755b7921071b9876d5b97515bc4fe11d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonagram-0.2.7.tar.gz:

Publisher: release.yml on kkollsga/sonagram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sonagram-0.2.7-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: sonagram-0.2.7-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 10.8 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sonagram-0.2.7-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 71ec2d6f29cfdd9d93c5b50cdb0133242629cf8d0f446d71bbe348b3b73158e2
MD5 1816b347769080d2305f851cceba8120
BLAKE2b-256 98392f4ae48b59f1eb7ab46ead7f168a73e183868be1d17165d58e7cb1f4ae7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonagram-0.2.7-cp39-abi3-win_amd64.whl:

Publisher: release.yml on kkollsga/sonagram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sonagram-0.2.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for sonagram-0.2.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f27b0c6ffaec9dad584274bdd3231d19f4c6c2d9a3058b21ec7fc57584acb3cd
MD5 a33e2cc4fa1451d45a3e78c4cfac39b4
BLAKE2b-256 e4d79f165bded62110f819c86aaf8834c7adc9ac93a8348a78aee75d5ca8fe69

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonagram-0.2.7-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on kkollsga/sonagram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sonagram-0.2.7-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for sonagram-0.2.7-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 064cf26f9031661dcfa867b95c5eb6040f3409566d9315b1f17ec967db3bd76c
MD5 bea8c496c10dbd268bc62f95f88f5029
BLAKE2b-256 2250c594998c030df21bc8f7fb1282b2c33a86db61d2800c5501a3a43e316645

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonagram-0.2.7-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on kkollsga/sonagram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sonagram-0.2.7-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for sonagram-0.2.7-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5b156f22b492e38ee78dd39d9c9d0e658f8d6c9b1a8beff72a91f6cd073bde19
MD5 3f2b7c227b5ae17390a7b3106a110488
BLAKE2b-256 36aa4eaa39226ddb5647b04be7222b1ec9b4780b4299b1b8d80a97c32e0b2188

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonagram-0.2.7-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on kkollsga/sonagram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.7 This release

5 files

0.2.6

5 files

0.2.5

5 files

0.2.4

5 files

0.2.3

5 files

0.2.2

5 files

0.2.1

5 files

0.2.0

5 files

0.1.0

5 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page