Skip to content

Deleting a memory can also strip derived data from a similar, current memory #456

Closed

Description

@itsskofficial

Found while testing #453. The cascading delete from #436 (erase() in sentient/memory/facts.py, text matching around lines 994 and 1025) finds related data (MEMORY.md/USER.md lines, journal lines, summaries, user-model insight evidence) by loose word overlap: three in five of the deleted memory's words.

When a similar memory still exists, that removes the other memory's data too. In a live test, erasing "drives a red Honda City" also removed:

  • the MEMORY.md line of the current memory "sold her red Honda City and now rides a blue Ather…";
  • the insight evidence pointing at that current memory (by fact id);
  • message evidence of an unrelated insight.

It happens whenever a user deletes a memory that has a close sibling, not only in #453's expiry path.

Fix:

  • Remove fact evidence only by fact id, never by quote.
  • For text derived data (MEMORY.md/USER.md lines, journal, summaries), skip any line that also matches a remaining current memory better than the deleted one, or that names the other memory's id.
  • Add tests with near-duplicate wording, such as "lives in Pune" deleted while "moved from Pune to Bengaluru" stays.

Done when: deleting one of two similar memories leaves the other's MEMORY.md line and insight evidence intact, checked in a real run.

Activity

  1. added
    bugSomething isn't working
    area: memoryFacts, user model, nightly consolidation
    priority: P1Next: high-value feature
    size: SSmall: a few days
    on Oct 18, 2026
  2. itsskofficial commented on Oct 18, 2026

    @itsskofficial
    ContributorAuthor

    On it: fixing on branch fix/456-erase-siblings.

  3. added a commit that references this issue on Oct 18, 2026
    fa5720f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: memoryFacts, user model, nightly consolidationbugSomething isn't workingpriority: P1Next: high-value featuresize: SSmall: a few days

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions