You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Memory store: return near-duplicate id on warn so the writing agent can adjudicate immediately #721
At store time the jaccard ≥0.4 warn path (memory-server/src/memory.js:555) silently enqueues a review row and tells the caller nothing. The writing agent is already an LLM — let it adjudicate on the spot, Mem0-style, without any extra model call.
memory_store's success response includes nearDuplicate: {id, title, jaccard} when the warn path fires.
MCP tool description for memory_store updated: on nearDuplicate, either supersede the existing entry (merge bodies), store with force: true if genuinely distinct, or do nothing if the existing entry already covers it.
Same for the semantic ≥0.9 enqueue path if the vector is already available synchronously (it is not today — embed is fire-and-forget; out of scope, janitor auto-resolution #TBD covers those).
Tests: memory-server/test/dedup.test.js — warn response shape; store with force still works.
Priority bump from research (#719 addendum 2): A-MEM's ablation (arXiv:2502.12110) shows write-time "evolution" — updating existing entries when a related new one lands — is the single highest-value curation mechanism (2x the contribution of linking on multi-hop F1). Our zero-cost implementation: the writing agent is already the LLM, so the store response should give it everything needed to evolve the existing entry on the spot:
return nearDuplicate: {id, title, jaccard, excerpt} (excerpt matters — the agent shouldn't need a second memory_get round-trip to decide)
tool description: prefer superseding the existing entry with a merged body when the new fact refines it; force: true only when genuinely distinct; nothing when already covered
per arXiv:2606.01435, the freshness rule is deterministic (newer wins) — the agent composes the merged body, but never has to judge which version is current
Implemented on coder/fork-memory-store-return-near-duplicate--5eeb34.
Store success (Memory.store, MCP memory_store, POST /api/store): when the Jaccard warn path fires (>= 0.4, including force: true bypass of the >= 0.7 block), the payload is now { id, nearDuplicate: { id, title, jaccard, excerpt } }. Distinct writes still return { id } only. Excerpt is the existing neighbor's body (capped at 240 chars) so the writing agent can adjudicate without a second memory_get.
MCP description tells the agent: on nearDuplicate, prefer memory_supersede with a merged body, force: true only if genuinely distinct, or do nothing if already covered.
Semantic cosine >= 0.9 enqueue is still fire-and-forget embed (out of scope, as specified).
Tests: memory-server/test/dedup.test.js (warn shape, force still works, distinct omits the field). server.test.js matches the tool description. node --test test/dedup.test.js — 11 pass.
Activity
currentbits commentedon Aug 26, 2026
Priority bump from research (#719 addendum 2): A-MEM's ablation (arXiv:2502.12110) shows write-time "evolution" — updating existing entries when a related new one lands — is the single highest-value curation mechanism (2x the contribution of linking on multi-hop F1). Our zero-cost implementation: the writing agent is already the LLM, so the store response should give it everything needed to evolve the existing entry on the spot:
nearDuplicate: {id, title, jaccard, excerpt}(excerpt matters — the agent shouldn't need a secondmemory_getround-trip to decide)force: trueonly when genuinely distinct; nothing when already coveredcurrentbits commentedon Aug 27, 2026
Implemented on
coder/fork-memory-store-return-near-duplicate--5eeb34.Store success (
Memory.store, MCPmemory_store,POST /api/store): when the Jaccard warn path fires (>= 0.4, includingforce: truebypass of the>= 0.7block), the payload is now{ id, nearDuplicate: { id, title, jaccard, excerpt } }. Distinct writes still return{ id }only. Excerpt is the existing neighbor's body (capped at 240 chars) so the writing agent can adjudicate without a secondmemory_get.MCP description tells the agent: on
nearDuplicate, prefermemory_supersedewith a merged body,force: trueonly if genuinely distinct, or do nothing if already covered.Semantic cosine
>= 0.9enqueue is still fire-and-forget embed (out of scope, as specified).Tests:
memory-server/test/dedup.test.js(warn shape, force still works, distinct omits the field).server.test.jsmatches the tool description.node --test test/dedup.test.js— 11 pass.