feat(personal): cross-turn relationship linking (#1, part 1 — offline)#65
Merged
Conversation
#1, part 1) Relations only formed between facts in the SAME turn, so concepts learned in different turns never connected (the custard <-> caramel gap). distillTurn now links this turn's primary new fact to PRIOR entities the user re-mentions, with a weak 'mentioned with' edge. Conservative + offline (no model cost, no noise): a whole-word match on a significant (>=4-char, non-stopword) token of the prior entity's name, deduped against existing edges and capped at 3 per turn. Verified: 'I love premium custard' then 'I love caramel on custard' now links the two across turns; an unrelated follow-up ('I use Rust') creates no edge. 84 personal tests pass (2 new); tsc clean. (Part 2: opt-in model extraction toggle.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mlcyclops
added a commit
that referenced
this pull request
Jun 24, 2026
…part 2) (#66) Adds a Settings toggle 'Richer graph (uses the model)' (default OFF) under Personalization. When on, live learning uses the MODEL extractor instead of the offline heuristic, pulling semantic facts + relationships (so related ideas connect across turns, e.g. custard~caramel) at the cost of one extra model call per turn. Wiring: new personalAiExtract setting (+ setter); learnFromTurn takes an optional model-call and uses modelExtractor when the flag is on; acp_backend passes its existing complete() util (the same one the import path already uses); personalStatus exposes aiExtract; bridge + /api/personal/ai-extract route + UI toggle (only shown when the store is unlocked, since that's when learning runs). Off by default → zero cost; the offline cross-turn linker (part 1, #65) still runs underneath either way. Verified: API round-trips the flag false->true->false; tsc clean; 332 desktop + personal tests pass. Co-authored-by: mlcyclops <mlcyclops@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <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.
Part 1 of the chosen 'Both' approach for the KG relationship gap (custard <-> caramel).
Problem
Relations only formed between facts extracted in the same turn, so concepts from different turns never connected.
Fix (offline, always-on, no model cost)
distillTurnnow links this turn's primary new fact to prior entities the user re-mentions, with a weakmentioned withedge. Conservative to avoid noise: whole-word match on a significant (>=4-char, non-stopword) token of the prior entity's name, deduped against existing edges, capped at 3 per turn.Verified
I love premium custardthenI love caramel on custardnow links the two across turns; an unrelatedI use Rustfollow-up creates no edge. 84 personal tests pass (2 new incl. a negative test); tsc clean.Part 2 (opt-in model extraction toggle for richer semantic linking) is next.
🤖 Generated with Claude Code