feat(reco): time-windowed taste embedding + stronger semantic signal - #79
Merged
Conversation
Replace fixed last-5 `lastMediaIds` with a 7-day event window query against `user_events` (configurable via TASTE_WINDOW_DAYS). Expands taste sample up to 40 items with timestamps rather than a stale profile snapshot. Increase semantic signal multiplier from 10 → 18, making it competitive with genre signals for users with high cosine similarity (max ~14.4 pts at cinephile=1 vs ~9 pts before). https://claude.ai/code/session_01XcJo4UywxcJC2XmiRSy1Wm
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.
Summary
lastMediaIds(max 5 IDs, no timestamps) with a live query againstuser_events— all distinctmedia_idvalues the user interacted with in the last 7 days. The window is controlled byTASTE_WINDOW_DAYS = 7(easy to tune later). Taste sample expands from ~10 to up to 40 items.ratedRows(rating = 1) are still included alongside the event window, so explicit likes always anchor the taste vector regardless of age.10→18(sim × 18 × (0.5 + 0.5 × cinephile)), giving a max of ~14.4 pts at cinephile=1 — now competitive with genre signals rather than just a tiebreaker.Test plan
youMightAlsoLikefor a user who has watched films in the last 7 days → confirm semantic similarity badge appears more oftenrecentIds→ only liked films used, graceful fallback)TASTE_WINDOW_DAYScan be changed without other code changeshttps://claude.ai/code/session_01XcJo4UywxcJC2XmiRSy1Wm
Generated by Claude Code