fix(feed): make for-you feed more track-favored#949
Merged
Conversation
The for-you feed surfaced albums/playlists too often relative to tracks (~1 collection per 2-3 tracks). Shift the mix toward roughly 1 collection per 5-6 tracks while keeping collections present: - Add a content_type_weight multiplier to the ranking formula (tracks 1.0, playlists/albums 0.6), applied alongside the existing source_weight and social_boost. - Trim playlist candidate caps: in-network 50->30, trending 50->30, underground 25->15. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dylanjeffers
added a commit
that referenced
this pull request
Jun 12, 2026
Item 3 of the for-you feed improvement queue (follows #949 content-type weighting and #950 repeat suppression). ## What Adds a **genre_affinity** multiplier to final_score, built from the genre mix of the viewer's recent listening: - New \`my_genre_affinity\` CTE: joins the viewer's most recent plays (bounded to the last 1000, same pattern as the other play sub-selects) to \`tracks.genre\` and computes each genre's share of plays. - Multiplier: \`0.85 + 0.45 * min(genre_share / 0.30, 1)\` — a genre at >=30% of recent listening gets the full **1.30x**, genres the viewer never plays get **0.85x**. - Neutral 1.00x for playlists (no single genre), genre-less tracks, and cold-start users with no play history (no penalty when we know nothing). ## Tests - \`TestV1FeedForYou_GenreAffinityBoostsFavoredGenre\`: an all-Electronic listener sees the Electronic sibling outrank the naturally-stronger Rock sibling, while the Rock track stays in the feed. - \`TestV1FeedForYou_GenreAffinityNeutralOnColdStart\`: no play history → natural ranking unchanged. \`go build ./...\` and the full \`go test ./...\` suite pass locally. 🤖 Opened by the automated feed-algorithm-improvement-loop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The For You feed (
GET /v1/users/{id}/feed/for-you) returns too many albums/playlists relative to tracks — roughly 1 collection per 2-3 tracks. Tracks and collections were ranked with an identical formula and the playlist candidate pool (~125) was large relative to tracks (~350), so collections crowded the top of the feed.Change
content_type_weightmultiplier to the final score: tracks 1.0, playlists/albums 0.6, applied alongside the existingsource_weightandsocial_boost. Collections stay in the feed but rank below comparably-scored tracks.Target mix is roughly 1 collection per 5-6 tracks.
Testing
go build ./...passesTestV1FeedForYou_*tests pass, includingIncludesCollectionswhich asserts playlists still surface in the feed🤖 Generated with Claude Code