No description
  • Rust 87.7%
  • Nix 6.7%
  • Hurl 4.4%
  • Shell 1.2%
Find a file
2026-12-05 17:24:56 +03:00
api api: wrong endpoint 2026-11-25 14:55:59 +03:00
nix Daily Mix: include more familiar songs and shuffle 2026-12-03 01:32:38 +03:00
sandbox test: configure dev environment to test plugin 2026-12-04 23:46:50 +03:00
src Daily Mix: take more songs for better clustering 2026-12-05 17:24:56 +03:00
.envrc Add boilerplate 2026-11-15 17:06:56 +03:00
.gitignore test: configure dev environment to test plugin 2026-12-04 23:46:50 +03:00
Cargo.lock Daily Mix: include more familiar songs and shuffle 2026-12-03 01:32:38 +03:00
Cargo.toml Daily Mix: include more familiar songs and shuffle 2026-12-03 01:32:38 +03:00
flake.lock Configure pre-commit hook 2026-11-27 17:07:59 +03:00
flake.nix test: configure dev environment to test plugin 2026-12-04 23:46:50 +03:00
LICENSE Add LICENSE 2026-11-23 00:20:07 +03:00
manifest.json Perform analysis in the task queue 2026-12-01 14:19:45 +03:00
README.md docs: add dev guide and fix grammar errors 2026-12-05 13:15:19 +03:00

Navidrome Smart Plugin

Analyze listening activity of the user and build personalized mixes with AudioMuse AI.

Requirements

  • Navidrome
  • AudioMuse AI

Algorithm

My Vibe

TODO: Design a better solution. The current implementation is too simple and produces overly random results.

Takes the last 15 songs, estimates the average mood, and seeds Alchemy with it.

Daily Mixes

  1. Build a weighted listening profile

Fetch listening history from the last 6 months.

For each song, calculate a preference weight:

w = ln(1 + sum(e^(-decay_rate * age)))

Use a half-life of 45 days:

decay_rate = ln(2) / 45

  1. Cluster the songs

Fetch the embedding for each song and build 6 clusters using the K-Means algorithm.

  1. Find similar tracks

Filter out unwanted tracks from the clusters.

For each cluster:

  1. Take N = min(top_songs, 17) songs (sorted by preference weight)
  2. Run Alchemy on these songs to get similar tracks
  3. Apply filters to similar tracks
  4. Take 50 - N similar tracks and add them to the mix.
  5. Save the playlist as Daily Mix #N

Roadmap

  • My Vibe
  • Daily Mixes
  • Your Artist Mixes

Development

This project uses Nix as the primary build and development environment. Enter the development shell with:

nix develop

If you don't use Nix, inspect flake.nix to find the required build tools.

Build the plugin with Cargo:

cargo build --target wasm32-wasip1

Navidrome expects an .ndp file containing plugin.wasm and manifest.json. Use the sandbox/build.sh script (available as build-plugin for Nix users) to generate one:

build-plugin

The plugin is saved to sandbox/data/plugins/smart-plugin.ndp. You can copy it to your server, but I recommend using sandbox/compose.yaml as a test environment instead.

First, create a backup of your server:

navidrome backup create [-d <folder>]

Copy the backup to sandbox/data so Docker can access it:

cp ~/Downloads/navidrome_backup_*.db sandbox/data

Restore the backup:

docker compose -f sandbox/compose.yaml run --rm navidrome \
  backup restore --backup-file /data/navidrome_backup_*.db

Start the dev server:

docker compose -f sandbox/compose.yaml up -d

Open localhost:4533, go to Plugins, and enable smart-plugin.

After each change, run build-plugin. Navidrome detects the update, but you must re-enable the plugin manually.