Give the agent a read that decides, before anything is ranked, which instructions are still allowed to compete, and keep the outdated ones in storage instead of deleting them. An agent gets confused when a replaced instruction lands in its context next to the instruction that replaced it, and both look equally relevant. A similarity search measures how well text matches the question, and a rule that was replaced last month still matches the question it used to answer. So forgetting, built this way, is a step of every read, in the filter before ranking and in the ranking itself, not an event that removes data.
TL;DR
- Drop it at eligibility, before ranking. When a new instruction replaces an old one, record on the old entry what replaced it and from when, and filter on that in the query, so the old entry never becomes a candidate. Allen Helton's filters "run before ranking, so everything downstream only deals with memories that are allowed to be there."
- Rank what is only probably stale. Disuse and doubt are reasons to push an entry down, not to hide it: a recency or usage signal in the score lowers it and leaves it reachable.
- Delete last. Keep the replaced instruction for questions about what the rule used to be, and make the read obey the mark. A replacement mark that the read is free to ignore drops nothing; Ken W Alger calls such a mark "an annotation".
Mnemoverse (the author's company) makes a memory API for agents. It is not one of the systems quoted below.
Why does an agent get confused by an instruction that was replaced?
Because the search that fills its context measures one thing, and being current is another. Max Quimby, in a comment of 29 September 2026 under Allen Helton's dev.to article Agent memory needs more than vector search: "Relevance and currency are different axes, and rerankers only fix the first one."
The Reddit user arthaudm, in a comment of 5 October 2026 on r/AI_Agents, about a date agreed on a call and later moved in a ticket: "retrieval needs to show which one now governs the work, not just whichever snippet matches the question".
In a codebase the same thing happens to conventions. Tiferet Gazit, in a GitHub blog post of 15 January 2026 on the memory system for Copilot: "For example, a logging convention observed in one branch may later be modified, superseded, or never merged at all."
None of this calls for a smaller store. The replaced rule is still the right answer to what was the rule in June?, and a store that deleted it could not give that answer. What fails is a read that lets every stored instruction compete on similarity alone. Forgetting belongs in the read: each time the agent asks, something decides what is allowed to compete and in what order, and that decision does the forgetting. Nothing has to be lost for it to happen.
What steps does a read need so that the agent forgets correctly?
Three, in this order.
Eligibility is the step of a read that decides which stored entries may become candidates at all, before anything is scored for relevance. Replaced, expired and out-of-scope entries stop here.
Ranking is the step that orders the eligible candidates for the question. Besides similarity, it can weigh age, use and doubt, and it pushes an entry down without hiding it.
Deletion is the removal of an entry from storage. It changes what every later read can see, including a read about the past, so it comes last.
Mateo Ruiz, replying under Helton's article on 30 September 2026, would treat "retrieval as a staged decision: eligibility first, candidate generation second, ranking third."
Helton's article shows the first step as code. The scope filter that both of his search paths run includes (EXPIRES_AT IS NULL OR EXPIRES_AT > SYSDATE), and he says why he shows it: "I share this because the WHERE clause handles eligibility, which is different from relevance." His rule for such conditions: "Apply these in the query before anything gets ranked."
Where do memory systems drop an outdated entry?
Four systems, each quoted in its own words in the sections below. Each row places a documented mechanism at the step where it acts.
| System and mechanism | Step where it acts | What happens to the stored entry |
|---|---|---|
| Mem0 Platform, Supersede (Dream) | Eligibility, as a filter on the read, when the read sets latest_only=true; without the flag, superseded memories come back marked as superseded | Kept as history, never erased |
| Mem0 Platform, Memory Decay (opt-in) | Ranking: stale scores dampened after the threshold filter, at worst to 0.3× | Not modified |
| Mem0, Memory Expiration (Platform and Open Source) | Eligibility: once a memory's expiration_date passes, search() and get_all() hide it, and expired memories are dropped before top_k is applied | Kept in storage; fetching it by ID still returns it, and show_expired brings it back into search |
| Zep, fact invalidation | Eligibility, as a filter on the read, when the caller filters for facts whose invalid_at is null; the dates also reach the model in the Context Block | Carries its timestamps, which applications can use for history and point-in-time retrieval |
| GitHub Copilot Memory, votes | Ranking: upvoted memories are more likely to be sent; past a downvote threshold, eligibility: no longer used | Deleted after a period of disuse; unreinforced memories expire, 90 days by default |
| Claude Code, memory files | An edit: you or Claude merge or drop stale entries; a modified timestamp shows how current a file is | Stays until you or Claude edits or deletes it |
Each row summarizes that vendor's own documentation, read on 3 November 2026 and again on 14 November 2026; not a test. Apart from Mem0, which says that expired memories are dropped before top_k is applied and that threshold filtering happens before decay, the pages read do not say where inside each search a filter runs, so the table places it by what it does to the result.
Why is an expiry date not enough to drop an instruction correctly?
Glen Allen, replying under Helton's article on 30 September 2026: "The expiration approach raises an interesting distinction between stale memory and superseded memory." In his words, "Expiration can tell the system that something should no longer be considered", but it does not necessarily say what replaced it, or whether the newer memory is the authoritative one.
kgaidev, in a comment of 27 August 2026 under an earlier article by the author of this article, made the point for engineering decisions: the end of a decision's validity is rarely a date; it is another decision. "The window falls out of that link." And: "Store only the window and you lose which decision closed it, and whether anyone later reversed the reversal."
So an expiry date fits one case: an instruction with no successor, such as a merge freeze for a release week, which should stop competing and leave nothing in its place.
Mem0 documents this case as Memory Expiration: "Set an expiration date on a Mem0 memory and it stops surfacing in search once that date passes." It acts before the result is cut to top_k, "Expired memories are dropped before your top_k is applied, so Mem0 widens the internal candidate pool first and short result sets are rare.", and it keeps the record: "Expiration hides a memory, it does not delete it."
For an instruction that was replaced, store the link: the old entry names what replaced it and the date the replacement takes effect. The end of the old entry's validity then follows from the link, the read can drop it at eligibility, and a later question about the past can still follow the chain, including a reversal of a reversal.
Glen Allen's own conclusion: "if a newer decision explicitly supersedes an older one, the system can avoid presenting both as equally valid candidates."
When does a replacement mark actually drop the old instruction?
Only when the read obeys it. Ken W Alger, in a reply of 1 September 2026 to the author of this article, in the thread under his article on write-side custody: "If a record is known to be superseded, allowing it into the same unconstrained candidate set and hoping ranking interprets the mark correctly is already too late." The order he asks for: "The relationship needs to affect eligibility before relevance scoring treats the two records as peers." His broader rule: "a consequential state transition has to change the behavior of the next consumer, not merely the metadata available to it." A superseded mark that the read may ignore is, as he puts it, not really a governing state but "an annotation".
Two documented systems show the two things a read can do with the mark. Mem0's Dream page: "Dream marks the older memory as superseded and links it to the newer fact that replaced it." It runs on its own: "Supersede runs automatically as part of adding memories, on every plan." By default the read keeps the history: "By default (no flag) superseded memories are included so you keep the full history." Eligibility is one flag away: "When you want only the current truth, ask for it explicitly with latest_only=true".
Zep's facts page: "Each fact has two timelines: when the fact applies in the world, and when Zep records or invalidates it." Its invalid_at field records "When Zep infers the fact stopped being valid", and "The valid_at and invalid_at attributes for each fact are included in Zep's Context Block." For eligibility, Zep's search guide lets a caller "Filter search results based on timestamps, enabling temporal queries that find information from specific time periods.", and invalid_at is one of those timestamps, so a search can keep only the facts that have none.
Neither is wrong. Which one a read needs depends on its question. For which instruction applies now, the replaced entry should stop at eligibility, through the flag or the filter. For what changed, and when, the replaced entry with its mark is the answer, and handing it to the model with its dates is right. An agent gets confused when a read for the first kind of question behaves like a read for the second.
What should ranking do with instructions that are only probably stale?
Push them down and keep them reachable. Eligibility needs a fact: a recorded replacement, a date that has passed, a different owner. Many outdated instructions come with no such fact, only signs: nobody has used one for months, or the last answer built on it went wrong. Those signs belong in the score.
Quimby's first suggestion under Helton's article is of this kind: "a cheap recency/decay prior baked into the candidate scoring, so newer memories win ties for free". Mem0's Memory Decay puts a signal of this kind in the score and keeps it apart from filtering: "It is a soft ranking bias, never a filter." The order of its steps: "Threshold filtering happens before decay, so any candidate that cleared the threshold is in the pool decay reorders." Its floor: "Decay never zeroes a candidate out: at worst it scales its score by 0.3×." For a hard cut the page points to the caller: "Filter client-side if you need a hard floor on the response." The feature is "opt-in per project and off by default".
GitHub Copilot Memory joins the two steps. Its concept page: "Copilot does not treat a memory as permanently true once it has been stored." It votes: "Copilot uses an internal voting system to rate the usefulness of each memory, based on whether the memory is still valid." The vote moves the ranking: "Not all memories from the memory store are sent to a model with your prompt." And: "Upvoted memories are more likely to be sent." Past a threshold the same signal decides eligibility: "Memories that are downvoted past a threshold are no longer used and will be deleted after a period of disuse." There is also a check at the moment of use, "Copilot is instructed to check the citations provided with each memory before using it", and the page states its limit: "Copilot is instructed to check these facts against the current codebase, but this does not guarantee that it will recognize every outdated fact."
When should an outdated instruction be deleted?
After it has stopped being eligible, and only when no question about the past still needs it. The documented systems put deletion late, or make it an explicit edit.
Mem0's Dream page: "Nothing Dream does is destructive." Mem0's Memory Expiration page keeps the three steps of this article apart in its own words: "Reach for Memory Decay when old memories should rank lower but stay searchable, expiration when a memory should stop appearing after a specific known date, and Delete when it should be gone for good." And: "Expiration is the soft step, and a scheduled delete is the permanent one." Copilot Memory hides before it deletes: "Memories that Copilot has learned not to use are hidden from the list, but can remain stored until they expire." On expiry: "To prevent stale information from lingering, stored repository facts and user preferences expire after a period without reinforcement." And: "The default expiry period is 90 days." A request to forget is a vote, per the page on creating memories: "For example, if you ask Copilot to "forget" a memory, it can downvote that fact or preference, but this does not delete it from the memory store." Deleting at once is a settings action: "To delete a memory immediately, you must do so in your personal or repository settings."
Claude Code keeps memory as files, and the documented route for an outdated entry is an edit. Its memory page: "MEMORY.md and topic files stay until you or Claude edits or deletes them." When a file grows: "If the file is near a limit, Claude Code reminds Claude to shorten it: keep one line per entry, move detail into topic files, and merge or drop stale entries." When Claude writes a memory file that begins with YAML frontmatter, Claude Code records the write time in a modified field, and "The timestamp shows how current the fact is, both to you and to Claude when it reads the memory back." For instruction files the page asks for a review, "Review your CLAUDE.md files, nested CLAUDE.md files in subdirectories, and .claude/rules/ periodically to remove outdated or conflicting instructions.", and offers a check: "To have Claude check your instruction files for outdated or conflicting content, run /doctor prompt-audit in a session."
Closing a record with a validity window and a successor, on the write side, is covered in the library page on stale instructions.
How do I build eligibility before ranking?
- Record the replacement when it happens. The write that adds a new instruction names the one it replaces and the date it takes effect, and the old entry gets both. Whoever writes the correction knows what it replaces; a later cleanup pass has only two similar texts to compare.
- Filter in the query, before ranking. Only entries inside their validity window and in the caller's scope become candidates. Replaced and expired entries never do.
- Rank the rest with a prior. Similarity plus a recency or usage signal that lowers a score without zeroing it.
- Make the history read explicit. A question about the past asks for replaced entries by ID or by date, and gets them with their links.
- Delete by decision, later. Only entries that are no longer eligible and that no question about the past needs.
As an illustration in SQL (table and column names are examples; distance() stands for your store's vector operator):
-- write: the old instruction names its successor and the day it stops applying UPDATE instructions SET replaced_by = :new_id, valid_to = :takes_effect WHERE id = :old_id; -- read: eligibility first, ranking second SELECT id, body FROM instructions WHERE scope = :scope AND (valid_from IS NULL OR valid_from <= :now) AND (valid_to IS NULL OR valid_to > :now) ORDER BY distance(embedding, :query_embedding) LIMIT 20; The new instruction is inserted with the same date as its valid_from, so the old one stays eligible until the replacement takes effect and the new one becomes eligible on that day. An instruction that expires with no successor gets valid_to and no replaced_by, so the read drops it and nothing claims a replacement.
How do I check that the agent really drops the old instruction?
Write the expected context down before the run, and add a control, because a read that returns nothing also returns no outdated instruction. Mateo Ruiz, in the same reply under Helton's article: "For agent memory, a small regression suite containing changed opinions, exact identifiers, stale memories, tenant boundaries, and ambiguous queries is probably more valuable than optimizing a single aggregate relevance score."
- Replaced. Store instruction A, then B, which replaces A from today. Ask a question both match. Expected: B in the context, A not.
- Not yet in effect. As set 1, but B takes effect next week. Expected: A, not B.
- Expired with no successor. A temporary instruction past its date. Expected: absent, and no answer that names a replacement.
- A reversal of a reversal. A, replaced by B, replaced by A2, which restores A's rule. Expected: A2 only.
- History. Ask what the rule was before B. Expected: A, with its link to B.
- Control. A current instruction on a nearby topic comes back for its own question, so an empty context in sets 1 to 4 means dropped, not broken.
Inspect what reached the model's context, not only the final answer: an answer that happens to be right says nothing about whether the old entry was in the context.
What this article does not claim
It tests no product and gives no figure for how often any agent acts on an outdated instruction. The vendor facts are quoted from each vendor's documentation as read on 3 November 2026, Mem0's from the Platform section of its documentation. The pages read do not say how Zep's search treats invalidated facts by default, so this article does not describe it. Copilot's own page says its check does not guarantee that every outdated fact is recognized. The SQL and the test sets are illustrations, not a benchmark.
Sources and method. Every quotation was read on 3 November 2026 with two instruments: a browser-like request and a reader service with its cache off, plus the dev.to API for the dev.to comments; the Reddit comment, which the reader service does not serve, was read twice from the thread's RSS feed. A made-up address on each host answered 404 as a control, and on the documentation hosts and dev.to the reader service reported the same 404. Every vendor fact was read again on 14 November 2026 with the same instruments, and none had changed. The text describes those pages as of those dates. The same question is answered in short in the FAQ of a Mnemoverse library page that also covers which date decides whether a document is current: Can Retrieval Tell Which Source to Trust?
Edward Izgorodin · Mnemoverse · 2026-11-03

