Repository navigation
fix(memory): preserve symbol-distinct facts during deduplication - #6924
Conversation
|
Verdict: Request changes This PR fixes a real bug: memory dedup merged facts that differ only by a sign or a language suffix, such as
Real-world evidenceN/A: no evidence bundle was produced for this run. This is an internal memory-matching change with no CLI, API or UI surface to exercise here, so the verdict rests on static review. I also ran the old and new tokenizers side by side on edge-case strings (described below). The test suite could not run on this runner because its dependencies aren't installed. The PR reports 426 passing. 🔍 Technical details🟡 Number tokens now span The number alternatives
With this, 🟢 Gate regex duplicated inline ( Strengths
|
|
Addressed the review findings in
Validation on D: |
|
Addressed the cross-platform CI failures in The tokenizer correctly keeps signs and language suffixes meaningful, while Validation on D: 429 targeted tests passed with external pytest plugins disabled; Black, compileall, and |
|
Addressed the remaining Code Quality failure in Local checks on the D: worktree: |
… match The fact/preference cross-category dedup compared memories with a punctuation-stripping tokenizer, so "User knows C++" and "User knows C" (or -5 and 5) still merged even after the overlap gate kept them apart.
|
Thanks for this fix, @huong8373tt-beep, and for working through the review rounds. I pushed a small change so 🔍 Technical details
|
… by id (amd#7212) Asking GAIA to remember a sensitive fact ("I am allergic to mango") saved it twice: once marked sensitive by the remember tool, and again a few seconds later, unmarked, by the turn's own extraction. Forgetting it by id then removed only the first copy, so the Memory page still listed it and a new chat still answered with it. Now the second save merges into the first and stays sensitive, and forgetting by id removes every copy. Closes amd#7175 ## Test plan - [x] `python -m pytest tests/unit/test_memory_sensitive_copy.py`: runs the real remember tool, then extraction's save, then forget by id, then recall. 11 of 12 fail without the fix, 12 pass with it - [x] Memory unit and integration suites, including the distinct-facts tests from amd#6924 and amd#6902: 2225 passed, 6 skipped - [ ] Replay in the app on the next RC (the agent ships as a downloaded binary): remember a sensitive fact, check Memory shows one entry, forget it, ask in a new chat - [ ] Eval categories to watch on the next RC: `memory`, `gaia_memory`, `context_retention` <details> <summary>🔍 Technical details</summary> - Duplicate detection compared only rows with the same entity tag. The tool tags the fact and extraction does not, so the copies never met. No tag, a bare label (`user`, `health`) and a `user:` tag now count as the user; any other `type:name` tag (`person:`, `app:`, `project:`) is its own subject. - A merged row's source still changes from `tool` to `llm_extract`, as it already did when the tags matched, so the Memory page labels it "Picked up in a chat". - Forgetting, by id or by words and from the tool or the Memory page, also erases copies with the same words bar filler about the same subject; if any copy is sensitive, all are recorded as stems only. </details> --------- Co-authored-by: Kalin Ovtcharov <[email protected]>
Summary
-5,+1,C++, andC#when comparing memoriesFixes #6918
Validation
python -m pytest tests/unit/test_memory_store.py tests/unit/test_memory_forget_sticks.py -q— 426 passeduvx black --check— passedpython -m compileall— passedgit diff --check— passedAll worktree and validation work was performed on D:.
Disclosure and authorization
Slai Agent Runtime performed the investigation, implementation, and test execution. The account owner authorized this contribution and is responsible for its content.