Agent Memory for Internal Workflows: What an Agent Should Remember, and What Belongs in the System of Record
Agent memory is now a checkbox in most agent platforms, and that makes it easy to switch on before anyone has decided what the agent is allowed to remember. The usual result, a few months in, is an agent that confidently repeats an approval limit that changed in June, treats a customer as a pilot account after they signed, or keeps a preference that the person who stated it has since reversed. Nobody can say where the agent learned it or how to make it stop.
This guide is for the operations lead, AI program owner, or engineering lead who is specifying or reviewing an internal agent that should carry something from one run to the next. It covers what belongs in memory, what belongs somewhere else, how to keep memory correct when facts conflict, and how deletion has to work. Securing a memory store against poisoning and cross-user leaks is a separate topic, covered in our guide to securing long-term memory in AI agents.
The short answer
- Split what the agent "remembers" into three kinds: session state for the current run, facts that already live in a system of record, and true memory.
- Keep only true memory in the memory store: conventions, corrections, preferences, and lessons that no other system holds.
- For facts that change, store a pointer to the record, not a copy of the value.
- Give every memory a source, a provenance tier, an owner, and a last-confirmed date.
- When two memories conflict, let a person's decision beat a verified source, and a verified source beat the agent's own inference. Use recency only to break ties.
- Revoke superseded memories instead of overwriting them, so you can still see what the agent believed and when.
- Make deletion and leaver handling reach the memory store directly, because deleting conversations does not remove what was distilled from them.
What the platforms mean by memory
The vendor documentation is consistent on the basic split. LangChain's memory overview separates short-term, thread-scoped memory, which is saved as part of the agent's state with a checkpointer, from long-term memory, which is saved in namespaces and can be recalled from any conversation. Its stores documentation describes long-term memory as key-value data that lives outside any one thread.
Databricks draws the same line with different words. In its agent memory and sessions documentation, a session is scoped to one interaction and holds the working transcript, while a memory is scoped to a subject, such as a user's stable preferences, a past decision, or an ongoing project. Anthropic's memory tool is a directory of files the model can read and write between conversations, and because it runs client-side, your application decides where that directory actually lives.
Most explainers then add the semantic, episodic, and procedural taxonomy, as Redis does (Dataiku covers the first two). That helps engineers choose storage. It does not answer the owner's first question: what this agent should be allowed to keep, given the systems your company already runs.
Three kinds of information an agent seems to remember
A typical "remember" list mixes three different things. Sorting them is the most useful hour you can spend before turning memory on.
Session state
This is everything the agent needs to finish the current run: the conversation so far, tool results, retrieved documents, intermediate drafts, and where it is in a multi-step task. It should survive a crash or a pause for approval, which is what checkpointers and session stores are for. It should not survive the end of the task as a general-purpose memory. LangChain's own memory guidance says that most trace data should remain history, and that only a small subset should become durable context.
Facts that already live in a system of record
Customer tier, contract renewal date, open tickets, a supplier's payment terms, an employee's manager, the current approval limit for refunds. Your CRM, ticketing system, ERP, or HR system already holds these, and someone is accountable for keeping them correct there.
True memory
Things no other system holds: how the finance team wants exception summaries formatted, that a particular carrier's invoices always put the PO number in the footer, that a regional manager prefers to be asked before the agent emails their accounts, that a certain classification rule produced wrong results last quarter and was changed. These are conventions, corrections, preferences, and lessons. They are what memory is for.
Keep system-of-record facts out of memory
Most facts an internal agent seems to need already live in a system of record, so memory should point to the record instead of copying a value that will go stale. Most memory guides skip this, and it is where internal workflows go wrong most often. The tutorials are written for assistants that learn about a single user from chat. An internal workflow is different: most of what it appears to need to remember is already stored, with an owner, in a system that changes without telling the agent.
If the agent writes "Acme is on the Silver plan" into memory during a run in May, and Acme upgrades in July, the CRM is correct and the memory is wrong. Nothing connects the two. The agent now has two answers to the same question, and the memory version is often the one it sees first, because it was put in front of the model by the memory layer before any tool was called. On Hacker News, a commenter on a memory health-check project separates append-only curated facts from ephemeral, compacted context in their own system, which they say makes health checks easier.
Our recommendation for internal workflows, as a design rule rather than an external finding:
- If a fact has an owner and a home in an existing system, the agent reads it from there at the time it needs it.
- Memory may store a pointer ("refund approvals: read the current limit from the finance policy table") or a stable identifier, never the value itself.
- If a run discovers that the system of record is wrong, the agent raises it with the record's owner. It does not write the correction into its own memory, because then only the agent knows.
For each item on the "remember" list, ask who would be blamed if it were wrong. If the answer is the owner of another system, it does not belong in agent memory.
The rule also shrinks the store: fewer conflicts, fewer items to review, and less to delete.
Decide who may write memory
A memory write changes future behaviour, so it is closer to a configuration change than a log entry. Each of the three common write paths needs a different level of review.
| Write path | Example | Review needed |
|---|---|---|
| A person states it directly | "Always copy the account owner on renewal emails." | Record who said it and when; no further approval. |
| A verified source confirms it | The agent reads a policy document and stores the rule with a link. | Record the source; recheck when the source changes. |
| The agent infers it | After three corrections, it concludes a supplier's invoices use a different date format. | Hold as a candidate until a person or a source confirms it. |
LangChain's overview distinguishes memory written on the hot path, during a run, from memory written by a background process after the run. Databricks offers memory pipelines that distill sessions into memories on a schedule. Either is fine. What matters for an owner is that inferred memories are labelled as inferred, and that the team can see them before they shape many runs.
Anthropic's Managed Agents memory stores can be mounted read-only or read-write, and every change creates an immutable memory version attributed to the session that wrote it. That is a useful pattern even if you use a different platform: a shared team memory that most agents can read but only a reviewed process can write.
Resolve conflicts by provenance before recency
Every memory store eventually holds two statements that cannot both be true. The default in many implementations is that the newest one wins. That sounds sensible and fails quietly. Resolve conflicting memories by provenance before recency, and revoke superseded entries instead of overwriting them, because last-write-wins lets a wrong new observation replace a correct old one.
Practitioners report the same failure. One post on X argues that staleness is about contradiction, not age: a six-month-old preference can be stale on day one if the user changed their mind, while a two-year-old fact can still be valid. Another practitioner says they stopped treating a vector database as agent memory because it kept stale facts and could not resolve conflicts. These are author reports, not measurements, but they match what research is now finding.
A 2026 paper on revoking stale memories tested memory stores where the underlying facts reversed. In the authors' controlled drift experiment, append-only and last-write-wins memory both scored 0.210, below the 0.309 scored with no memory at all, while a store that explicitly revoked superseded entries scored 0.950. Treat the exact numbers as the authors' benchmark. What carries over is that badly managed memory can leave an agent worse off than having none.
A separate preprint on provenance-tiered conflict resolution proposes attaching a tier to every fact when it is written (human-decided, then source-verified, then agent-asserted) and resolving conflicts by tier rather than by time. It also argues that the agent must not be able to promote its own assertion to the top tier.
For an internal workflow, that translates into a rule you can write into the specification:
- A memory a named person stated or approved beats one confirmed from a document or system.
- A memory confirmed from a source beats one the agent inferred.
- Within the same tier, the more recently confirmed memory wins.
- When two memories in the top tier conflict, the agent asks a person rather than picking one.
Without a tier, the agent's own guesses compete on equal terms with what your team told it, and guesses are written far more often.
Revoke instead of overwrite
When a memory is wrong or out of date, the instinct is to edit or delete it. For a workflow that takes actions, keep the old entry and mark it revoked instead, with a pointer to what replaced it and who decided.
When someone asks why the agent did something in August, you need to know what it believed in August. The revocation paper above makes the same argument: revoked history is kept for audit while retrieval draws only on current entries.
A practitioner post on X adds the step most teams miss: pruning a shared lesson only fixes future retrieval. If a wrong memory guided past decisions, someone should check which decisions relied on it. For a refund agent that remembered the wrong approval limit, that means pulling the refunds it approved while the entry was active.
A memory record that supports all of this
You do not need a special product for these rules, only enough fields on each memory to check them. A minimal record:
memory_id: mem-0412
subject: "supplier:northline-freight"
statement: "Invoices put the PO number in the footer, not the header."
kind: convention # convention | correction | preference | lesson
provenance: source_verified # human_decided | source_verified | agent_asserted
source: "AP team review of 12 invoices, 2026-09-03"
written_by: "invoice-exceptions-agent (background pipeline)"
owner: "accounts-payable-lead"
created: 2026-09-03
last_confirmed: 2026-10-01
status: active # candidate | active | revoked
superseded_by: null
Three fields do most of the work. provenance drives conflict resolution. owner tells you who to ask when it is questioned. status lets you revoke without losing history. If your platform stores memory as plain files, as Anthropic's memory tool does, the same fields can sit at the top of each file.
These fields also make expiry sensible. Instead of one window for everything, recheck by kind: conventions when the supplier or system changes, preferences when the person changes role, and lessons when the underlying rule is updated.
Deletion has to reach the memory store
Deleting a conversation or session does not delete the memories distilled from it, so deletion requests, leaver handling, and corrections must target the memory store directly.
Databricks states it plainly in its memory documentation: sessions and memory stores are independent, so deleting a session, or an entire session store, does not delete memory that was distilled into a memory store. A practitioner on X pointed out the same line when the beta launched. For an internal workflow, that has three consequences:
- Deletion requests. If someone asks for their data to be removed, deleting their chat history is not enough. You need to find memories whose subject is that person, and memories whose source was a conversation with them, and remove or redact those too. That is only possible if
subjectandsourcewere recorded when the memory was written. - Leavers. When an employee leaves, their preferences may no longer apply, and anything they stated as a human-decided rule now has no owner. Add a line to the leaver checklist: reassign or revoke memories owned by the person, and review rules they set that other agents still follow.
- Corrections. When a fact turns out to be wrong at the source, fixing the source does not fix a memory that copied it. This is one more reason to keep system-of-record facts out of memory.
Treat a memory change like a configuration change
Memory changes behaviour without a code change. LangChain's memory post warns that a cached runtime may never read a stored update, and recommends evals for any behaviour important enough to store as memory. A lightweight practice:
- Show the team a weekly diff of active memories added, revoked, or reconfirmed, grouped by agent.
- Require a person to promote inferred candidates to active for any agent that takes external actions.
- Keep a small set of test cases that exercise the most important memories, and run them when memory changes.
- Review the memory store as part of the regular access review for the agent, alongside its identity and permissions.
Where memory is the wrong tool
Some requests for memory are better solved elsewhere:
- Company knowledge such as policies, product documentation, and process guides belongs in a retrieval index with its own freshness rules, not in agent memory. Our guide to RAG data freshness covers keeping that index current.
- Long tasks that outgrow the context window need better context handling within the run, not long-term memory. See LLM context window management.
A worked example
The following is an illustrative example, not a client case. A 300-person distributor runs an invoice-exceptions agent that reads supplier invoices, matches them to purchase orders, and drafts exception notes for the accounts payable team. The team wants it to "remember suppliers".
Sorting the request produces three lists. Payment terms, supplier bank details, and the current PO for each delivery live in the ERP, so the agent reads them there every time and memory stores nothing about them. The run's working notes stay in the session and are cleared when the exception is resolved. What remains for memory is short: where each supplier puts the PO number, which suppliers send credit notes as separate PDFs, and the AP lead's preferred wording for disputes.
Two months later, the agent infers that a carrier has changed its invoice layout and writes an agent-asserted candidate. The AP lead's older human-decided entry says the opposite. Under the tier rule, the agent keeps using the older entry and flags the conflict. The lead checks three invoices, confirms the change, and the old entry is revoked with a pointer to the new one. When the lead later moves to another role, the leaver checklist reassigns their twelve memories to the new AP lead, who reconfirms nine and revokes three.
What to do next
Take one agent you already run or are about to commission, and write its "remember" list on one page. Mark each item as session state, system-of-record fact, or true memory, and name the owner of each true memory. If more than a third of the list turns out to be system-of-record facts, fix that before you turn memory on.
If you want help with that review, our AI audit covers memory alongside identity, permissions, and logging for the agents you already have. When we build a workflow through AI workflow automation, the memory specification, conflict rule, and deletion path are part of the handover.