Skip to content

Lexical/semantic similarity clustering for memory roll-up (contingent on the semantic memory module) #382

Description

@StarshipSuperjam

The engine opened this item itself — you didn't create it.

What this is. A second cross-session relatedness signal for memory roll-up — grouping old notes by the SIMILARITY of their wording (lexical), and eventually their meaning (semantic) — deferred until the syntactic/semantic memory module exists. Issue #235 asked for a richer relatedness signal beyond same-session grouping; that is DELIVERED, via cross-session shared-topic-tag clustering (Slices A and B). A lexical text-similarity clustering signal was explored as a second, complementary signal and deliberately shelved here.

  • Why it was shelved: the reuse-first mechanism (bm25 relevance via the existing scent lookup) collapses on short memory notes — a topic's defining words are not rare within a topic-heavy corpus, so bm25 gives genuinely-similar notes near-zero scores while unrelated notes pick up spurious signal from common words (there is no stopword filtering). No fixed bm25 threshold separates them.
  • Why not a stopword-list fix: a content-term-overlap metric separates cleanly in testing, but it needs a hardcoded stopword list — a perpetual tweak-list to maintain, the wrong shape for the engine's floor.
  • Where it belongs: the design splits memory into a lexical floor plus a separate, deferred SEMANTIC module (decision D-030). Lexical and semantic similarity clustering are that module's job — it is planned to retain chat verbatim, the substrate a real similarity signal needs — not a bm25 bolt-on to roll-up.

What happens next. This is CONTINGENT on the syntactic/semantic memory module being built; it is not actionable until then.

  • When that module exists, add a cross-session lexical- (and semantic-) similarity clustering signal to roll-up's grouping, alongside the shared-topic-tag clustering already shipped.
  • The roll-up grouping already carries the scaffold for it: a fixed-precedence grouping pass in detect_rollup_candidates, and a reserved sim:<id8> cross-session cluster sentinel (records.SIM_SESSION_PREFIX, already recognized by the erasure-veto credit in forget.earned_consolidated_raw). A future slice fills in the similarity metric and the pass.
  • No engine behavior changes until then; shared-tag clustering remains the richer relatedness signal in v1.

More detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineOpened by the engine about its own health (not your product).

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions