Skip to content

fix(feed): make for-you feed more track-favored#949

Merged
dylanjeffers merged 1 commit into
mainfrom
feed-for-you-track-ratio
Jun 12, 2026
Merged

fix(feed): make for-you feed more track-favored#949
dylanjeffers merged 1 commit into
mainfrom
feed-for-you-track-ratio

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

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

  • Add a content_type_weight multiplier to the final score: tracks 1.0, playlists/albums 0.6, applied alongside the existing source_weight and social_boost. Collections stay in the feed but rank below comparably-scored tracks.
  • Trim playlist candidate caps: in-network 50→30, trending 50→30, underground 25→15.

Target mix is roughly 1 collection per 5-6 tracks.

Testing

  • go build ./... passes
  • All TestV1FeedForYou_* tests pass, including IncludesCollections which asserts playlists still surface in the feed

🤖 Generated with Claude Code

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 dylanjeffers merged commit 6ffabec into main Jun 12, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the feed-for-you-track-ratio branch June 12, 2026 03:05
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant