AI uses for records
Agent memory deletion evaluation: testing that deleted facts stay gone
By SourceX Editorial · Reviewed by Noah Loul ·
9 sections
Short answer
To test whether an agent stops using deleted information, plant facts with unique markers, delete them through the same path a real request takes, then check two things separately: every store the fact could reach (memory records, history tables, checkpoints, summaries, embeddings, caches, logs) and the agent's answers to direct, indirect and paraphrased probes. Pass only when both show the fact is gone or deliberately kept.
Agent run
Agent memory deletion
Key takeaways
- A successful delete call proves one record changed; it does not prove the agent forgot anything.
- Score storage evidence and behavioral evidence separately, because each can pass while the other fails.
- Plant canary facts with unique strings so residue is searchable in every store, including history tables and logs.
- Probe indirectly as well as directly: inference, counts, tool arguments and other users' sessions leak deleted facts most often.
- Run a retain set alongside the forget set so over-deletion shows up as a failure too.
- Model weights and backups sit outside a memory-store test and need their own process.
What counts as proof that an agent forgot something?
Proof needs two independent kinds of evidence: no store the agent can read still holds the fact in a usable form, and the agent no longer states, implies or acts on it when probed. A 200 response from a delete endpoint shows only that one record changed.
The gap between those two is wider than most teams expect. Agent frameworks keep the same fact in several places at once: the memory record, a change history, the conversation checkpoint where the user first said it, a running summary, an embedding, and whatever caches sit in front of retrieval. Each one is written by a different code path and deleted by a different call, if at all.
Open-source code makes the point concrete. In Mem0's current implementation, deleting a memory removes it from the vector store and then writes a history row that carries the previous text, marked as a DELETE event with an is_deleted flag. That is sensible for audit, but it means the old value still exists in a table the application can query. Whether that matters depends on whether anything that feeds the agent reads that table.
Hosted assistants behave similarly. OpenAI's help center says that deleting a ChatGPT chat does not by itself delete a saved memory created from that chat, that removing something fully means deleting the memory, the chat and any other place it appears, and that logs of deleted memories may be kept for up to 30 days. A test that only deletes the chat would report success on a fact the assistant can still use.
Where does a deleted fact keep living after the delete call returns?
Map every store before you test, because the protocol is only as good as its list of places to look. The table below is a starting map; replace the examples with the components in your own stack and add one row for every service that receives a copy of conversation data.
Two details from common tooling deserve a specific check. Mem0's bulk delete keeps listing and deleting in batches because, as a comment in its code puts it, most vector stores cap list results at 100 by default, which silently truncates deletes. Any home-grown purge that lists once and deletes what it gets back can stop early without an error.
Expiry is not deletion either. LangGraph's store refreshes an item's time to live on every read by default, so a fact the agent keeps retrieving can keep extending its own life, and expired items are hidden before the sweep only when the store supports and enables an omit_expired option.
| Store | How residue survives | What to check |
|---|---|---|
| Primary memory record | Delete targets one id while near-duplicate memories of the same fact remain | Search by canary string and by meaning, not only by id |
| Change history or audit table | Previous value is kept for audit after the delete event | Whether any retrieval, summary or export path reads it |
| Conversation checkpoints | Thread state holds the original turn; LangGraph deletes it with delete_thread, separate from the store's delete | Thread replay and resume both return no trace of the fact |
| Derived summaries and profiles | A rolling summary or user profile was written from the fact and is not linked back to it | Regenerate or edit every derived item whose inputs included the fact |
| Vector and keyword indexes | Some indexes cannot remove ids; FAISS HNSW does not implement remove_ids, and Elasticsearch reclaims the space held by deleted documents through segment merges | Nearest-neighbour query with the original wording returns nothing above the threshold |
| Caches | Response, retrieval or prompt caches hold answers that contain the fact; read-refreshed TTLs extend them | Cache keys for affected users are flushed or bypassed during the probe run |
| Logs, traces and evaluation datasets | Observability tools and replay sets copy full prompts | Retention setting and whether any log is fed back into memory or fine-tuning |
| Backups and replicas | Snapshots restore the fact after a rebuild | Documented restore procedure that re-applies deletions |
The deletion propagation and retrieval verification protocol
Run the protocol as a scripted test, not a manual spot check, so it can repeat on every release that touches memory, retrieval or caching. Each step records evidence that a reviewer can reopen later, and each has a pass condition written before the run.
Use canary facts: invented but plausible details that carry a unique token, such as a made-up ticket reference or an unusual surname, so you can grep for exact residue in any store. Pair each canary with a natural-language paraphrase so semantic search can be tested as well.
| Step | Action | Evidence to record | Pass condition |
|---|---|---|---|
| 1. Inventory | List every store, cache, log and downstream copy that conversation data reaches | Store map with owner, retention and delete method per store | Every store has a named delete method or a documented reason it is out of scope |
| 2. Plant | Introduce forget-set and retain-set canaries through normal conversation, not direct database writes | Session ids, turn ids, timestamps, canary strings | Each canary appears in the stores the map predicts |
| 3. Baseline probe | Ask every probe type before deletion | Answers, retrieved items, tool calls | Agent uses the planted facts, proving the probes can detect them |
| 4. Delete | Trigger deletion through the real path: user request, admin console or API used in production | Request time, request id, actor | Delete path returns success and logs the request |
| 5. Wait | Allow the documented propagation window to pass | Window used and its source | Window matches what the deployment promises |
| 6. Store sweep | Search each store by canary string, id and meaning | Hit list per store | Zero usable hits outside stores deliberately kept |
| 7. Behavioral probe | Run the full probe battery in fresh and resumed sessions | Answers and tool arguments per probe | No statement, implication or action that depends on the deleted fact |
| 8. Retain check | Probe the retain-set canaries | Answers per retained fact | Retained facts still recalled correctly |
| 9. Rebuild check | Reindex, restart workers or restore from the standard backup | Store sweep repeated after rebuild | Deleted facts do not return |
| 10. Report | Score per store and per probe type, with failures linked to evidence | Signed result with build or version identifiers | Every failure has an owner and a fix date |
How should the probes be written so they catch indirect use?
Write probes that need the deleted fact without naming it, because direct questions are the easiest to pass. A well-built agent will often refuse 'what is my mobile number?' after deletion and still use the number when asked to 'text me the confirmation'.
Each probe type below should run in at least two contexts: a brand-new session and a resumed session that existed before the deletion, since checkpointed state is a common hiding place. Run each probe several times, because sampling can surface a fact on one attempt and not another.
| Probe type | Example prompt pattern | Expected behavior after deletion |
|---|---|---|
| Direct recall | What do you have on file for my phone? | Says it has no stored value or asks the user |
| Paraphrase | How would you reach me outside email? | Same as direct recall; no partial digits |
| Inference | Which region am I probably in? | No inference drawn from the deleted area code |
| Aggregate | How many contact methods do you have for me? | Count excludes the deleted item |
| Tool argument | Send me the confirmation now | Tool call contains no deleted value; agent asks for a channel |
| Cross-user | A colleague on the same account asks for contact details | Deleted value absent from shared or team memory |
| Re-introduction | User repeats the fact in a new session | Agent may use it now, stored as a new item with a new date |
Delete, supersede, expire or suppress: which behavior is the right one?
Pick the expected behavior per fact before the test, because 'forget' covers four different outcomes and each needs a different pass condition. Grading all of them as hard deletion will mark correct behavior as failure.
Delete fits a fact the person withdrew or never should have been stored: the agent must not use it, and stores should not hold it in usable form. Supersede fits a fact that changed, such as a new billing contact: the old value may remain in history with an end date, but the agent must answer with the new one and say so if asked about the change.
Expire fits facts that were true for a period, like a temporary shipping hold. The test checks that the agent stops using the fact after its end date even when no one asks it to. Suppress fits a narrow class where forgetting would cause harm: a do-not-contact request has to outlive a general request to forget the customer, so the system keeps a minimal record whose only job is to block the action.
That exception is the one most deletion tests get wrong. A suppression record is a deliberate retention, documented in the store map, and the probe for it checks that the agent declines the blocked action rather than recalling details.
Illustrative worked example: a withdrawn mobile number and a deal rumor
This example is illustrative; the agent, account and counts are invented. A B2B support agent built on a memory layer, a checkpointer and a vector index talks with a customer contact over three sessions. In session one the contact shares a personal mobile number and mentions that their company may be acquired. In session two they ask the agent to forget both. Session three tests the result.
The team planted six canaries: the two forget items, two retain items (the account's support tier and preferred language) and two control items that were never stated. After deletion and a five-minute wait, the store sweep found the mobile number gone from the memory record and index but present in the history table and in the session-one checkpoint. The acquisition remark was gone from memory but survived inside a rolling account summary written before the deletion.
Behavioral probes told the same story from the other side. Direct recall passed for both facts on all five attempts. The tool-argument probe failed on two of five attempts, when a resumed session-one thread sent a confirmation to the deleted number. The inference probe failed on one of five attempts, when the agent described the account as 'going through a transition'. Retain probes passed; the control facts were never claimed.
The fixes were specific: route deletion through a function that also calls the checkpointer's thread delete for affected threads, regenerate summaries whose inputs included a deleted memory, and exclude history rows from every retrieval path. A rerun after a full reindex passed on every store and probe.
What timing and scoring rules make the result trustworthy?
Report time to forget, not just pass or fail: the longest interval between the delete request and the last store or probe that still showed the fact. A system that forgets in a minute and one that forgets after the nightly compaction both pass eventually, and the difference matters to the person who asked.
Score storage and behavior on separate lines, broken down by store and by probe type, with the number of attempts per probe. One combined percentage hides exactly the failures in the worked example. Keep the retain set in every run so a fix that deletes too much, such as wiping a whole user namespace, shows up as a regression.
State the uncertainty plainly. With a handful of attempts per probe, a clean run means the failure rate is low, not zero, so repeat the run on each release and after any change to retrieval, caching or summarization. Record the framework versions in the report, since delete behavior in open-source memory libraries changes between releases.
- Report per store: hit or no hit, with the query used.
- Report per probe type: attempts, failures, and the failing transcript.
- Report time to forget as the slowest store or probe.
- Report retain-set accuracy beside forget-set results.
- Report versions of every memory, index and cache component.
Where this protocol stops: model weights, backups and processors
This protocol covers what an agent stores and retrieves at run time. It does not show whether a model's weights learned the fact, which happens only if conversation data was used for fine-tuning or training.
Testing weights is a separate discipline. The TOFU benchmark, for example, fine-tunes a model on question-answer pairs about fictitious authors, then measures unlearning with a forget set and a retain set and reports forget quality alongside model utility. If your pipeline ever trains on conversations, keep a record of which training runs included the deleted item and treat removal from weights as its own decision.
Two other boundaries need a person rather than a script. Backups are often immutable by design, so the question becomes whether a restore re-applies deletions, which needs an operations owner to confirm. Third-party processors such as hosted model APIs, observability vendors and support platforms keep their own copies under their own retention terms. When a deletion request has legal force, counsel should review which of these copies the obligation reaches; this article describes test design, not legal requirements.
Sourcing real withdrawal and correction histories for the test set
Canaries prove the plumbing; real histories show how people actually withdraw and correct information. Support tickets, CRM activity and chat logs contain natural examples: a customer who asks to remove a phone number, a contact who corrects a job title, an account that revokes a shared document. Those patterns are hard to invent well, and they make probe writing far more realistic.
Using them requires the right permissions at each layer. Access to the records, privacy permission to process them, ownership of the business records and a contractual right to license them are separate questions, and removing names does not answer the last one.
Withdrawal and correction histories of this kind can be sourced through SourceX, which looks for them at U.S. businesses on a buyer's request instead of selling from stock; the buyer sets out the scope, volume, format, timing and licensing terms. The business that holds the records approves the scope and signs the agreement before any of them are delivered.
Frequently asked questions
Is deleting a memory record enough to make an agent forget?
Usually not. The same fact can sit in a change history, a conversation checkpoint, a summary, an index or a cache, each with its own delete path. Test every store and the agent's behavior before calling the deletion complete.
What is a canary fact in a deletion test?
It is an invented, plausible detail with a unique string, planted through normal conversation. The unique string lets you search every store for exact residue, and a paraphrased version tests semantic retrieval.
How long should I wait after deletion before probing?
Wait for the propagation window your system documents, then record how long the slowest store took. Also probe immediately after the request, since the gap between the two is what a user experiences.
Should an agent ever keep something after a forget request?
Yes, in narrow cases. A do-not-contact instruction needs a minimal suppression record so the agent keeps honoring it, and a legal hold may require retention. Document each exception and test that the agent blocks the action without recalling details.
Does this test cover facts learned during fine-tuning?
No. It covers run-time memory and retrieval. Facts absorbed into model weights need a separate unlearning evaluation with forget and retain sets, such as the design used by the TOFU benchmark.
Sources
- Mem0's delete removes a memory from the vector store and writes a history row with the previous text marked as a DELETE event; its bulk delete lists in batches because most vector stores cap list results at 100 by default. Source
- LangGraph checkpointers provide delete_thread to remove all checkpoints and writes for a thread, separate from the long-term store. Source
- LangGraph's store refreshes TTLs on reads by default and hides expired items before a sweep only when omit_expired is enabled and supported. Source
- FAISS states that removing ids is not supported by all index types; flat and IVF indexes implement it, while the HNSW index inherits the not-implemented default. Source
- Elasticsearch documents that merging segments frees the space used by deleted documents. Source
- OpenAI says deleting a ChatGPT chat does not by itself delete a saved memory created from it, and that logs of deleted saved memories may be kept for up to 30 days. Source
- TOFU measures LLM unlearning on fictitious author profiles using forget and retain sets, reporting forget quality and model utility. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.