Resonate is a full-stack SvelteKit app that powers personalized music-artist discovery using a LightGCN-style recommender trained on the Last.fm 360K dataset. It stores artist and user embeddings in PostgreSQL using pgvector, then serves recommendations and “Similar Artists” with fast vector similarity queries.
Demo-friendly: sign in with seeded dataset profiles (no manual user setup required).
SvelteKitbetter-auth (email/password + dataset-profile impersonation)PostgreSQL + pgvector + Drizzle ORMTailwind CSS, bits-ui, lucide-svelte, embla-carousel-sveltemodel/ (training, data prep, and DB seeding with uv)
package.json)vector extension (pgvector)Copy the example environment file:
cp .env.example .env
Then set:
BETTER_AUTH_SECRET (min 32 chars)BETTER_AUTH_URL (typically http://localhost:5173)RESONATE_IMPERSONATE_PASSWORD (min 8 chars; used server-side for demo dataset sign-in)LASTFM_API_KEY (used for Last.fm artist images)Optional:
WIKIPEDIA_USER_AGENT (recommended; useful for Wikimedia throttling rules)This repo includes a docker-compose.yml that provisions pgvector/pgvector:pg16 and enables the vector extension:
docker compose up -d
bun run db:migrate
All ML training work lives in model/. For app development you typically just need to seed embeddings and graph edges into Postgres:
cd model
uv sync
uv run python scripts/seed_db.py --reset
Then populate optional profile fields for the top users:
uv run python scripts/seed_user_profiles.py
bun install
bun run dev
For newly created / low-activity accounts, the UI shows an onboarding modal to “Pick a few artists you like”.
3 and 5 artistsPOST /api/me/onboarding with either:{"mbids": string[]} (MusicBrainz artist IDs), or{"item_idx": number[]} (catalog indices in the DB)On success, the app refreshes recommendations (like/embed blending updates).
64artists.embedding (artist/item vectors)users.embedding (dataset user vectors)train_edges (already present in training/listened graph), anduser_artist_likes (explicit likes)“Similar Artists” uses cosine/c-distance style similarity in embedding space and excludes the queried item itself.
See .env.example. Key variables:
DATABASE_URL (Postgres connection string)BETTER_AUTH_SECRET, BETTER_AUTH_URLRESONATE_IMPERSONATE_PASSWORD (demo sign-in)LASTFM_API_KEY (artist imagery)WIKIPEDIA_USER_AGENTThis project is licensed under the MIT License. See LICENSE for details.