DEV Community

Discussion on: Your Memory API Is Lying to Your Agent

Collapse
 
kenwalger profile image
Ken W Alger •

I think you're putting this at the right boundary, and this is actually where my thinking has moved since writing the piece. A proposed durable write shouldn't necessarily be treated as an isolated insert. Part of admission should be asking what existing knowledge this write might supersede, correct, contradict, or invalidate.

I wouldn't make that an unconditional full retrieval call for every write, though. I'd treat it as part of Write-Side Custody and let the proposed claim determine the lookup scope. If the write has a stable subject, claim type, authority domain, or other addressable identity, the custody layer should be able to narrow the candidate set considerably before doing semantic comparison.

The explicit nothing found is important too, with one qualification: I'd want to preserve what was actually searched. Otherwise "no predecessor found" can mean either "there wasn't one" or "we looked in the wrong place." That's the negative-space problem that has come up in another thread.

So I think the invariant is stronger than "look before every write": a consequential durable write should establish its relationship to the relevant existing knowledge before admission, or explicitly record that the relationship could not be established.

And yes, there is a cost. But I'd rather pay some of that cost once at the admission boundary than repeatedly ask every future retrieval to rediscover relationships the system could have established when the new knowledge arrived.