Systems and records
Agent memory provenance drift: when a memory outlives its source
By SourceX Editorial · Reviewed by Noah Loul ·
10 sections
Short answer
When the document behind a remembered fact is removed, the agent should stop treating that fact as current until it learns why. A superseded source means refresh from the new version; a restorable deletion means suspend; a permanent deletion, revoked access or erasure request means expire or purge. That only works if every memory stores its source, version, valid time, authority and permission scope.
Agent run
Agent memory provenance
Key takeaways
- A memory whose source is removed should stop being presented as current until the reason for removal is known.
- Restorable deletion means suspend, permanent deletion or withdrawal means expire, and an erasure duty means purge.
- Every memory needs a source ID, version, valid time, authority, permission scope and derivation to be expirable.
- Change feeds and protocol notifications beat clock-based expiry; use revalidation intervals only where no signal exists.
- Event memories can outlive their source, but they keep its permission scope and never stand in for current state.
How should agent memory respond when its supporting document is removed?
It should stop presenting the fact as current and route it by the reason for removal. A document that was replaced by a newer version calls for a refresh from the replacement. A document moved to a recycle bin calls for suspension, because it may come back. A document that was permanently deleted, withdrawn as wrong, or put out of the user's reach calls for expiry, and a deletion made to honor a privacy request calls for purging the memory and anything derived from it.
This is what agent memory provenance drift means in practice: the remembered fact stays fixed while the record that justified it moves, changes or disappears. Nothing in the memory looks wrong. The agent keeps quoting a discount, a contact or a policy that no longer has a source, and it does so with the same confidence it had on the day it learned it.
The response policy below treats every memory as a dated, sourced and permission-bound claim. It cannot be applied to memories that were stored as free text with no link back to the document, which is why the first decision is what each memory must carry.
Why remembered facts drift away from their sources
Most memory layers update from conversation, not from source systems. The Mem0 paper describes an update phase in which a language model compares a newly extracted fact with similar stored memories and chooses one of four operations: add, update, delete or leave unchanged. That keeps the store consistent with what the agent has been told, but a document deleted in SharePoint or a record merged in a CRM never enters the conversation, so the memory is never asked to change.
Drift has three common shapes. The source changes and the memory keeps the old value. The source disappears and the memory keeps a value nobody can now verify. Or the user's permission to the source is withdrawn and the memory keeps exposing content the user could no longer open directly. The third is the most serious, because the agent becomes a side door around access control.
Summaries make all three worse. A memory that merges facts from several documents cannot be expired cleanly when one of them goes away unless the merge recorded which document contributed which part.
What a remembered fact must carry before it can expire
Each memory needs enough provenance to answer four questions later: where did this come from, which version, when was it true, and who may still see it. Without those, the only safe responses to a source change are to keep everything or delete everything.
The W3C PROV ontology gives useful vocabulary. It records which entity a thing was derived from and attributed to, and it defines invalidation as the start of an entity's destruction, cessation or expiry, after which the entity is no longer available for use, with a time at which it was invalidated. Treating a memory as an entity derived from a source document lets you record its invalidation explicitly instead of deleting it without trace.
Some memory engines already work this way. The Graphiti project describes facts with validity windows that are invalidated rather than deleted when information changes, and says every entity and relationship traces back to the episodes, meaning the raw data, that produced it.
- Source identifier: a stable URI or record ID, not a file path a user can rename.
- Source version: a version number, ETag or last-modified timestamp captured when the fact was read.
- Event time and valid time: when the underlying event happened and the period the fact is true for, kept separate from when the memory was written.
- Authority: whether the source is the system of record for this fact or a copy, note or email that mentions it.
- Permission scope: the users, groups or roles that could read the source when the fact was extracted.
- Derivation: whether the memory is a direct quote, an extraction or a summary across several sources, with each contributing source listed.
- Correction history: prior values, who corrected them and why, kept rather than overwritten.
- Sensitivity flag: whether the fact contains personal data that a deletion or erasure duty could reach.
How does the agent find out that a source changed or vanished?
Subscribe where the source system offers change signals, and fall back to scheduled revalidation where it does not. The Model Context Protocol specification lets servers announce that their list of resources changed, notify subscribed clients when a specific resource is updated, and annotate resources with a last-modified timestamp. An agent that stored the timestamp with each memory can compare it on the next read.
Change feeds tell you more than that something changed. Microsoft Graph delta queries return removed items with an @removed object whose reason is changed or deleted; for directory objects the documentation explains that changed means the item can still be restored from deleted items, while deleted means it cannot. That distinction maps directly onto suspend versus expire.
Where neither exists, revalidate by fetching the source with the stored version identifier before the memory is used in a consequential answer, and on a schedule for everything else. A failed fetch is a signal in itself: record whether it failed because the item is gone, because the user lost access, or because the system was unreachable, and treat only the first two as removal.
The provenance expiry and refresh policy
Apply one row per source event. The memory action changes what is stored; the agent behavior changes what the user sees. Both are logged against the memory's provenance record so a reviewer can reconstruct why an answer changed.
| Source event | Signal | Memory action | Agent behavior until resolved |
|---|---|---|---|
| New version of the source | Updated notification, newer timestamp or ETag | Re-extract from the new version; keep the old value in correction history | Answer from the new value and say when it changed if asked |
| Source soft-deleted or moved to recycle bin | Removal marked restorable | Suspend: keep the memory but mark it unusable | Do not state the fact; say the source is currently unavailable |
| Source permanently deleted | Removal marked permanent, or fetch returns not found after a grace period | Expire: record invalidation time and cause | Treat the fact as unknown; ask or look up an authoritative source |
| Source withdrawn as wrong | Correction or retraction record | Expire and link the correction; flag derived memories | Do not repeat the old value; offer the corrected one if it exists |
| User lost access to the source | Permission change or access-denied fetch | Restrict the memory to the permission scope that still applies | Never disclose the fact to that user |
| Personal data erasure or retention end | Erasure request or retention rule | Purge the memory and its derivatives; keep only a non-identifying deletion log | Behave as if the fact was never known |
| Source unchanged but old | Age past the fact type's revalidation interval | Mark stale and queue revalidation | Use with a stated date, or revalidate before a consequential action |
Setting revalidation intervals by fact type
Different facts go stale at different rates, so a single expiry clock either refreshes too much or trusts too long. Set an interval per fact type, record who owns the authoritative source, and let a source event override the clock in either direction.
The intervals below are illustrative starting points, not measured values. A records owner for each source system should replace them with the system's real update patterns, such as how often price books, org charts or contract amendments actually change.
| Fact type | Authoritative source | Illustrative revalidation interval | Refresh trigger |
|---|---|---|---|
| Contact role or reporting line | HR system or directory | 30 days | Directory change feed |
| Pricing exception or discount | Signed contract or amendment | At each use in a quote | New amendment or contract status change |
| Policy or procedure text | Published policy library | 90 days | New policy version |
| Account status (active, churned, on hold) | Billing or CRM system of record | 7 days | Status field change |
| User preference stated in chat | The user | 180 days | User restates or contradicts it |
| Historical event (what was decided and when) | Ticket, email or meeting record | No expiry while the record exists | Source deletion or erasure request |
Update, suspend, forget or purge: choosing what happens to a stale fact
Update when an authoritative source offers a newer value. Stop using, without forgetting, when the source is temporarily unavailable or its status is unclear. Forget, meaning expire with a record, when the source is permanently gone or was withdrawn as wrong. Purge, meaning remove without a readable trace, when the fact is personal data under an erasure or retention duty.
Two tie-breakers settle most conflicts. A system of record outranks a note, email or chat statement about the same fact, even if the note is newer, unless the system of record is known to lag. And a later valid time outranks an earlier one only when both come from sources of equal authority; a newer chat message saying a contract was extended does not override the contract system until the amendment appears there.
Make every one of these transitions visible to the people who own the source. A weekly list of suspended and expired memories, grouped by source system, shows records owners where documents are being deleted or locked down faster than expected, and shows agent teams which memories are failing revalidation most often. A memory that keeps cycling between suspended and restored is usually pointing at a source that is being edited in place rather than versioned.
Finally, decide what the agent says in each state before it ships. Users accept 'I had this from a draft amendment that is no longer available' far more readily than a confident answer that turns out to rest on nothing, and the wording forces the team to define the states precisely.
Worked example (illustrative): a pricing exception after its amendment is withdrawn
In this illustrative case a sales assistant agent remembers that one customer has a 12-month price hold, extracted from a draft contract amendment stored in a shared folder. The memory records the folder item ID, the version timestamp, valid time from the amendment's effective date, authority as draft amendment, and the sales team's group as permission scope.
Six weeks later the legal team deletes the draft because the amendment was never signed. The change feed reports the item as removed and restorable. Under the policy, the memory is suspended: when a rep asks about the customer's pricing, the agent says the earlier source is unavailable and points to the contract system instead of quoting the hold.
After the recycle bin retention ends, the removal becomes permanent. The memory is expired with the cause recorded, and two derived memories, a renewal reminder and a summary line in the account brief, are flagged for review because their derivation lists the same source. A reviewer confirms the contract system shows no price hold and closes all three.
Without provenance, the agent would have kept offering the hold indefinitely, and nobody could have traced which summary sentences rested on an unsigned draft.
Memories that outlive their source, and removals that are legal events
A memory of an event can remain true after its source is gone. 'The customer was told on a given date that shipping would be delayed' is a historical fact about a conversation, and it stays true even if the shipping notice is later revised. Expiring it would erase the reason a later complaint makes sense.
Keep event memories separate from state memories. State memories describe how things are now and must follow their source. Event memories describe what happened and keep their value, but they still inherit the source's permission scope and any erasure duty, and they should never be repeated as a current fact.
The limit of the policy is the quality of its signals. If a source system offers no change feed and revalidation is expensive, the policy degrades to clock-based expiry, which will sometimes serve stale facts inside the interval. Say so in the agent's behavior by attaching dates to remembered facts in answers.
Some removals are legal events, not data events. Under Article 17 of the EU General Data Protection Regulation, a data subject can obtain erasure of personal data without undue delay where a listed ground applies, such as the data no longer being necessary for its purpose, subject to exceptions. A memory store that keeps an extracted copy of that data, or a summary that contains it, is part of the same processing, so purge decisions belong with the privacy owner and counsel, who review the specific facts.
Access withdrawal is similar. When a user leaves a team, the agent should apply the source system's current permissions, not the scope captured at extraction. Bring in the business records owner before setting retention for event memories, and before any memory store is exported, shared or used to build training data, since access to a record, permission under privacy law and the right to license it are separate questions.
Sourcing records with change history for memory evaluation
Testing a refresh policy needs records in which sources really change: amended contracts, superseded policies, merged accounts and deleted items, each with timestamps. Synthetic histories rarely reproduce the messy order in which these events reach downstream systems.
Through SourceX, a company can license chosen operational records as an AI dataset, with SourceX doing the rights review, contracting, preparation and delivery. Teams that need versioned records for memory evaluation can describe the scope, volume, format and timing they need in a data request; datasets come from U.S. businesses and are sourced on request.
Frequently asked questions
What is agent memory provenance drift?
It is the gap that opens when a remembered fact stays fixed while the document or record that supported it changes, disappears or becomes inaccessible. The memory looks valid, but nothing current backs it, so the agent repeats stale or unauthorized information.
Should an agent delete a memory when the source document is deleted?
Not automatically. If the deletion is restorable, suspend the memory; if it is permanent or the source was withdrawn as wrong, expire it with a record of why. Purge it outright when the fact is personal data subject to an erasure or retention duty.
What metadata does a memory need to support expiry?
At minimum a stable source identifier, the source version or last-modified time, the valid time of the fact, the source's authority, the permission scope at extraction and the derivation if several sources were merged. A correction history lets reviewers see what changed and why.
How often should agent memories be revalidated?
It depends on the fact type. Fast-changing state such as account status needs short intervals or change feeds, while historical event records can stand until their source is deleted. Set intervals per fact type with the owner of each source system.
Does removing a user's access to a document affect the agent's memory?
Yes. The agent should apply the source's current permissions at answer time, so a fact extracted when the user had access must not be disclosed after that access is withdrawn. Otherwise memory becomes a way around access control.
Sources
- The Mem0 memory layer's update phase has a language model choose among add, update, delete and no-operation for each newly extracted fact compared with similar stored memories. Source
- W3C PROV defines derivation and attribution, and invalidation as the start of an entity's destruction, cessation or expiry, recorded with the time it was invalidated. Source
- Graphiti gives facts validity windows, invalidates rather than deletes old facts when information changes, and traces every entity and relationship to its source episodes. Source
- The Model Context Protocol lets servers send resource list-changed and resource-updated notifications and annotate resources with a lastModified timestamp. Source
- Microsoft Graph delta queries mark removed items with an @removed object whose reason is changed (restorable directory object) or deleted (not restorable). Source
- GDPR Article 17 gives data subjects a right to erasure of personal data without undue delay on listed grounds, such as data no longer being necessary, subject to exceptions. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.