r/openclaw • u/haderach_ram • 11d ago
Discussion Should an agent's persistent memory ever forget on purpose?
I run an assistant with long term memory, and the problem I keep hitting isn't storing facts, it's old facts that were true last month and quietly aren't anymore. A mail setup changes, a server moves, and the stale entry still sounds confident. I've tried marking facts as superseded and attaching dates, but retrieval often surfaces the old one anyway. How do you handle it? Do you expire memories after a set time, keep the full history and rank by recency, or have the agent check live state before trusting anything it stored? Curious what's held up for people running this for months.
2
u/username8914 Active 10d ago
I use mempalace MCP. It has a decay feature and a way in it's knowledge graph for the strength to diminish over time. It's not perfect but I don't have issues when everything is working properly. Memories don't disappear but they go from a strength of 5 down to .05.
2
u/RE-call 9d ago
The reason retrieval keeps surfacing the old one is that it is the best match. The superseded fact and the current one say almost the same thing, so similarity ranks them side by side, and a date or a recency boost only nudges the order.
In my setup the filter runs before ranking, not after: a superseded fact is left out of normal search entirely and only comes back when the question is about history ("what was the mail setup before?"). The supersede step has to name what replaced it, so nothing gets hidden without a successor.
Then test it the boring way: change one fact, open a fresh session, ask the question. If the old value ever comes back as current, the filter is not in the search path.
1
u/ldrx New User 11d ago
one of my lead agents has stored over 2k memories in 6 months. i added expiry dates. past that date they still load, but flagged as expired so it verifies before applying
1
u/Complex-Home9615 11d ago
Just have your agent attach dates to anything that might change and tell them to verify old info
1
u/kaijurules 11d ago
We split it by what kind of fact it is. Where things stand right now (a server, a setup, what's in progress) lives in one short state note per agent that gets replaced each session, never appended, so last month's version is gone by design. Durable facts go on the page of the thing they're about, so when the mail setup changes the agent edits that page, and if two sources disagree it leaves a visible conflict note there instead of quietly picking one.
1
u/macromind Member 11d ago
Yes, but I would distinguish deletion from loss of retrieval priority. Keep the original event in an auditable log, then expire or down-rank derived claims when they have not been reconfirmed, conflict with newer evidence, or belong only to a completed task. Give each memory a source, timestamp, scope, confidence, and supersedes pointer. At retrieval time, prefer current records and surface contradictions instead of silently choosing one. For sensitive personal data, actual deletion should remain available. A practical test is to replay old sessions and check whether the system can explain why a fact was recalled, ignored, or replaced.
1
u/Ok-Form1598 New User 11d ago
what bit me most was facts it could have just looked up. which server, which mail setup, what's in the config. i stopped letting those into memory at all and had it check the live thing every time, it's one tool call. what's left in memory is mostly stuff only i know, preferences and who people are, and that goes stale way slower. dates on everything still help for the rest.
1
u/Smart-Oil-1882 New User 11d ago
The comments here have already found most of the pieces — live-lookup instead of storage, supersede-instead-of-delete, the auditable log. I run a setup that formalizes those into one pipeline, and what makes it hold together is separating the kinds of memory so each has exactly one job.
The contract layer (DOX + the agent's own wiki). Every folder/domain in the environment carries an AGENTS.md — a contract that says how that area works, where its facts live, and what the agent may do there. The agent reads the contract chain before touching that area. Above it sits the agent's wiki: its self-documentation — architecture decisions, skill catalog, plans. The rule that keeps it navigable: procedures live in skills, facts live in the wiki, relationships live in the graph. Nothing sits in the prompt by default; everything is reachable.
The fact store (Mem0). One memory = one discrete fact — never a paragraph. Every memory carries its source, two timestamps (when it applied / when it was learned), a verification state, and a supersedes pointer. Its purpose is injection: small, high-precision facts pulled into context when relevant. If a memory is a blob, retrieval returns noise and stale blobs win.
The verbatim archive (MemPalace). Every transcript, mined into searchable chunks. This is the piece people skip: verification is theater unless there's a verbatim record to cross-reference against. Stale-sounding facts stop being scary when the original conversation is one search away.
The relationship graph (Graphify). Entities and relations across the wiki and the sessions — which sessions ran in parallel, what referenced what. The graph is what connects the memories.
The pipeline. Capture is automatic: a session-end hook dumps extracted facts marked reported — saved, retrievable, untrusted. A weekly pass with a cheap model proposes confirm/correct/supersede (never deletes). A midweek pass with a strong model reviews the proposals against the verbatim record. Only the human deletes. Every mutation lands in a change log — which is also the replay test someone mentioned: ask why a fact was recalled, ignored, or replaced, and the system shows the log entry and the transcript that justified it.
The rules, distilled: two timestamps per fact; supersede is a relation, not recency; anything with a live source gets checked, never stored; capture automatic, trust manual; nothing deleted, only demoted — except sensitive personal data, where real deletion stays on the table.
Two tools shape why the ontology looks like this. witr ("why is this running") traces any process, port, or file back through its causal ancestry — the causation axis of the agent's own history. And Philosophy of Time (Sean Enda Power, Routledge, 2021) lays out the A-series/B-series distinction — a fact's position in time versus its position in the record — which is exactly why every memory carries applied-time and learned-time separately. An agent that can answer "when was this true?" and "why did this get recorded?" is an agent whose memory stops lying to it.
Links: DOX · Mem0 · MemPalace · Graphify · witr