mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 20:58:37 +07:00
[GH-ISSUE #1027] [Issue]: Prevent repeated LTM memories across subject variants and incomplete existing-note retrieval #526
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#526
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Sep 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1027
Originally assigned to: @Promansis on GitHub.
Summary
Long-Term Memory extraction can create repeated memories for the same fact or event. Deduplication only compares candidates that already resolve to the same note ID and only against the existing notes selected for the extraction, so equivalent memories can bypass deduplication when subject surface forms differ or retrieval does not return the older note.
Affected package
long-term-memory(server-side extraction, existing-note selection, and evidence-unit deduplication)Expected behavior
Before compiling a new mutation, an extracted candidate should be compared with the relevant existing memory after subject identity has been canonicalized. Equivalent facts/events with materially different wording should be recognized as duplicates within the documented similarity policy. Existing-note comparison should not depend solely on ranked recall returning the old memory.
The fix must preserve distinct facts, separate scopes, and additive sections where a new contribution is genuinely different.
Actual behavior
deduplicateUnitskeys candidates bynoteId + sectionKey, then checks exact text or an 0.85 lexical Jaccard threshold. A short/full-name identity split creates different note IDs, so the memories are never compared. In addition, extraction buildsexistingTypedNotesfrom retrieval results plus identity notes; an older equivalent memory that is not selected by retrieval is absent from the deduplication set.The supplied trace shows multiple extractions with existing notes loaded but
deduplications: 0, while repeated memory content was observed.Steps to reproduce
existingTypedNotes.Environment
stagingcompatibility rangelong-term-memorystaging buildLogs, screenshots, or video
The investigation used
scratch/ltm-debug-log.jsonl; it contains private extraction identifiers and is not attached. Regression fixtures should be synthetic and contain no private chat data.Additional context
Subject canonicalization is tracked separately in #1026 and should be treated as an upstream contract for this issue. Historical related work includes #756 and #913, but this report concerns runtime memory deduplication and existing-note coverage, not test assertion cleanup or extraction fingerprint freshness. The focused regression owners are
tests/long-term-memory-extraction-graph.regression.tsand the relevant source-processing/storage regression suites.Template check