feat: tag-affinity recommendation engine#1803
Draft
MrDirkelz wants to merge 1 commit into
Draft
Conversation
Adds a per-user recommendation profile built on existing FTS/tag infra instead of a new ML system or second database. A client-authoritative affinity map (tag id -> decayed score) drives a hybridQuery over parentTags, ranked by tag-overlap with a seam for FTS+RRF fusion later. Cross-device sync of a per-user-private doc has no home in Luminary's group-only permission model, so UserAffinity is delivered out-of-band: authIdentity attaches the caller's own doc to JwtUserDetails, shipped via the existing clientConfig socket payload (like accessMap). It is excluded from /query and the socket update fan-out (same containment as the internal Crypto doctype) and never gets a sync design doc, so it scales by doc count with zero fan-out. Writes are owner-only (id derived from userId) and ride the existing localChanges -> /changerequest drain, with the working copy kept in localStorage (not Dexie docs) so deleteRevoked can't purge it. Signal weighting distinguishes a passive open from stronger, more deliberate engagement: bookmarking, finishing a video/audio track, and highlighting a passage all weight the profile more than merely opening content. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Adds a per-user recommendation profile built on existing FTS/tag infra instead of a new ML system or second database. A client-authoritative affinity map (tag id -> decayed score) drives a hybridQuery over parentTags, ranked by tag-overlap with a seam for FTS+RRF fusion later.
Cross-device sync of a per-user-private doc has no home in Luminary's group-only permission model, so UserAffinity is delivered out-of-band: authIdentity attaches the caller's own doc to JwtUserDetails, shipped via the existing clientConfig socket payload (like accessMap). It is excluded from /query and the socket update fan-out (same containment as the internal Crypto doctype) and never gets a sync design doc, so it scales by doc count with zero fan-out. Writes are owner-only (id derived from userId) and ride the existing localChanges -> /changerequest drain, with the working copy kept in localStorage (not Dexie docs) so deleteRevoked can't purge it.
Signal weighting distinguishes a passive open from stronger, more deliberate engagement: bookmarking, finishing a video/audio track, and highlighting a passage all weight the profile more than merely opening content.