Files
romm/backend/handler/database
Sam Dornan 399aec5c8b feat(backend): add a library-aware recommendations engine
Recommendations came straight from IGDB's `similar_games`, which mostly
names titles the server does not hold and is absent entirely for anything
IGDB never matched.

`rom_similarity` holds a precomputed item-item graph blending four signals:
IDF-weighted metadata overlap, the IGDB prior resolved against the library,
collection co-membership and co-play. Scores are library-relative, so a
shelf full of arcade games learns on its own that "Action" says nothing
while "Metroidvania" says a great deal, with no tuning.

Each edge stores the facets that produced it, so the UI can explain a
recommendation rather than showing an unattributed row of covers.

Candidate generation runs off an inverted index with a document-frequency
cap, avoiding the all-pairs comparison. The graph is rebuilt wholesale by a
scheduled task because the IDF weighting shifts as the library grows, and
writes commit in batches so a task that dies leaves stale edges rather than
an empty table.

The personalised feed is ranked on demand from those edges plus live play
history, since a nightly feed would ignore the game played an hour ago.
Ratings below the scale midpoint act as negative seeds, results are
diversified per franchise and platform, and owned-but-unplayed games are
boosted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-07 20:12:19 -05:00
..
2025-09-04 11:17:00 -03:00
2026-03-12 23:02:12 -04:00
2026-08-01 14:49:58 -04:00
2026-04-06 22:29:55 -04:00
2026-07-19 22:59:37 -04:00