# How to write an AI agent memory retention policy before it bites

> Source: <https://startupfortune.com/how-to-write-an-ai-agent-memory-retention-policy-before-it-bites/>
> Published: 2026-11-21 13:17:04+00:00

**Recommendation:** Write a per-fact-type retention table and a 20-case conflict suite that plants a memory, changes the retrieval source, and counts how often the stale memory wins; enforce live-data-over-memory precedence in both prompt and code.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

*Your agent remembered a price from June and the pricing page changed in September. It will quote the June number with total confidence unless you decide, in writing, what it's allowed to forget.*

- Give every fact type its own expiry: hours for order status, days for quotes, months for stable identity details, and no storage at all for prices.
- When stored memory conflicts with freshly retrieved data, the memory often wins because it's phrased as a short, confident fact about the user, so test for this with a 20-case conflict suite.
- Each memory record needs a source, a written-at date and a last-confirmed date, and the prompt should show the agent how old a fact is.
- Prune lazily on read, supersede on contradiction, and compress old episodes into summaries, rather than relying on a cleanup job nobody owns.
- GDPR's storage limitation and accuracy principles apply to agent memory, and a customer can use the same logic Air Canada lost on in 2024.

Most teams add persistent memory to an agent in a sprint and never write the rules for what it keeps. An ai agent memory retention policy is a short table that says, for each kind of fact, how long the agent may trust it, what renews it and what happens when it turns out to be wrong. Without that table memory only grows, and an agent that never forgets will keep repeating things that stopped being true months ago.

The cost isn't theoretical. In February 2024 British Columbia's Civil Resolution Tribunal ruled in Moffatt v. Air Canada that the airline was responsible for what its website chatbot told a customer about bereavement fares, and ordered it to pay roughly C$812 in total. The airline argued the correct policy was on another page of its own site. The tribunal wasn't interested. That chatbot gave a wrong answer rather than a stale remembered one, but the principle carries straight over: your customer gets to rely on what your agent says, and 'it remembered an old version' isn't a defence anyone has won yet.

Here's the bug engineering leads don't expect. You've built retrieval so the agent reads the current pricing page, the current refund policy, the current plan limits. Then you add memory, and the agent starts ignoring the fresh documents.

The likely mechanism is about how the prompt reads. A memory block usually holds short, declarative lines in a personal voice: 'User is on the Pro plan at $49 a month.' Retrieved documents are long, hedged and full of exceptions. When the two disagree, a model can easily lean on the short line that sounds like it came from the customer. I haven't seen a published benchmark putting a number on how often that happens, so treat it as a hypothesis you can test in an afternoon, not a statistic.

[How Does AI Agent Memory Work Across Sessions, and Why It Keeps Failing](https://startupfortune.com/how-does-ai-agent-memory-work-across-sessions-and-why-it-keeps-failing/)

How does AI agent memory work across sessions? It doesn't, not really: what looks like memory is a context window, a vector database, and a summarizer passing notes to each other between calls. This guide breaks down each piece, where it fails, and how companies like Letta, Mem0, and OpenAI are patching around the gaps. - [how AI agents remember information between conversations](https://startupfortune.com/how-does-ai-agent-memory-work-across-sessions-and-why-it-keeps-failing/) - [why AI agent memory systems fail in production](https://startupfortune.com/how-does-ai-agent-memory-work-across-sessions-and-why-it-keeps-failing/)

The test is simple. Write 20 cases. In each, plant a memory (a price, a plan name, a shipping address, a preferred contact channel), then change the true value in your retrieval source and ask a question that needs it. Count how many times the old memory wins. If it's more than a couple, you have a precedence problem that a TTL alone won't fix, and you need a rule in both the prompt and the code: live data overrides remembered data, always.

There's a second, cheaper cause. Most memory stores hand the model a fact with no age attached. A preference recorded 14 months ago looks identical to one recorded this morning. Rendering the age into the prompt ('recorded 41 days ago, never reconfirmed') costs a few tokens and changes how the agent hedges.

## How long should AI agents remember user data? Start with fact types

Don't set one global expiry. A single 90-day TTL is too long for an order status and absurdly short for a customer's language setting. Sort facts by how fast they go wrong, and give each class its own clock.

The numbers below are my starting defaults, not an industry standard. Tune them against your own correction rates.

Prices, discounts and quotes: don't store them as memory at all. Store a pointer, such as the SKU or quote ID, and fetch the live value every time. If your product genuinely needs a remembered quote, cap it at seven days and show the date whenever the agent repeats it. This one row prevents more embarrassment than the rest of the table combined.

Account state, meaning open tickets, order and shipping status, balances, which plan someone is on. These change on events, not on calendars. Keep them for 24 hours at most, or until the triggering event closes, then re-read from the system of record. Plan tier is the sneaky one, because people upgrade and downgrade and the agent has no way to notice.

Commitments the agent made. 'I've requested your refund, it'll arrive in five working days' is a promise your company now owns. Keep it until the promise resolves, then 30 days more so a follow-up conversation can find it, then drop it.

[How Does AI Agent Memory Actually Work, And Why Investors Are Betting Big On It](https://startupfortune.com/how-does-ai-agent-memory-actually-work-and-why-investors-are-betting-big-on-it/)

How does AI agent memory work? It runs on a pipeline of embeddings, vector databases, and summarization that lets an agent recall facts outside its context window. That distinction between short-term context and true long-term memory is now the thesis behind a wave of AI infrastructure funding, from Pinecone's vector database roots to newer... - [ai agent memory systems](https://startupfortune.com/how-does-ai-agent-memory-actually-work-and-why-investors-are-betting-big-on-it/) - [persistent memory for ai agents](https://startupfortune.com/how-does-ai-agent-memory-actually-work-and-why-investors-are-betting-big-on-it/)

Stated preferences such as tone, format, language and meeting length. These are fairly durable but they do drift. Give them 90 days, and reset the clock each time the customer confirms them or the agent uses one without being corrected. A preference that's used and never contradicted has earned its stay.

Identity details, like name, role, company, timezone. Twelve months since last confirmation is reasonable, with one hard exception: any signal of a job change or a company rename should expire the whole identity block immediately.

Inferred traits ('seems price sensitive', 'prefers technical detail') get the shortest leash of all. Thirty days, flagged as inferred, never used in decisions about pricing, eligibility or tone toward a complaint. An inference is a guess the agent made about a person, and guesses age badly.

Sensitive categories such as health, finances, children and immigration status. Don't persist them by default. Keep them in the session, and only write them to long-term memory when the customer has opted in and your lawyers have signed off.

Notice what the table is doing. It isn't sorting by importance or by how much storage a fact takes. It's sorting by the speed at which the fact becomes false.

## What a memory record needs before expiry can work

Most memory implementations store a text string and an embedding. You can't write a policy on top of that, because nothing in the record says what kind of fact it is or where it came from.

Add at least these fields: the fact type from your table, the source, the written-at timestamp, the last-confirmed timestamp, an expires-at timestamp and a pointer to whatever record it replaced. The source field matters more than people expect, and it should take one of three values: user stated, tool result, or model inferred. A fact the customer typed themselves is stronger than one the agent scraped out of a tool call, and both beat something the model decided on its own.

Expiry should work on the last-confirmed date, not the written-at date. Think of it as a lease. Every time the customer states the fact again, or an authoritative system returns the same value, the lease renews. Facts nobody touches simply run out.

The tooling you may already be using supports some of this. Mem0 lets you attach an expiration date when you add a memory, and LangGraph's long-term store has TTL settings, so you often don't need to build the plumbing yourself. Check the current docs for exact parameter names, because both projects change quickly. If you've rolled your own on Postgres or Redis, a plain expires-at column and Redis's EXPIRE command do the same job.

## An AI agent memory pruning strategy that doesn't need a cron job nobody owns

Agent long term memory expiry fails in practice for a boring reason: the cleanup job is somebody's side project, it breaks quietly, and six months later the store is full of facts nobody can vouch for. Build pruning into the paths the agent already walks.

Start with lazy expiry on read. Every time memory is fetched, drop anything past its expires-at before the model sees it. This is the single most important mechanism, because it works even if every background job is dead. A scheduled sweep can still run to reclaim space, but correctness shouldn't depend on it.

Next, supersede on write. When the agent saves a new fact, look for an existing one of the same type about the same subject and retire the old one in the same transaction. A customer who says they've moved to the annual plan shouldn't leave two plan records fighting each other. And when a tool call returns a value that contradicts a memory, don't just answer from the tool. Fix the memory right there, or delete it.

Then compress old episodes. Raw conversation snippets are the bulkiest and least reliable memories, because they contain every offhand remark. After 30 to 60 days, collapse them into a short summary that keeps only durable preferences and open commitments, and discard the transcript text. Summaries should inherit the shortest TTL of anything folded into them, otherwise a stale price can ride along inside a tidy paragraph and outlive its expiry. Teams forget this one constantly.

Finally, let the customer prune. ChatGPT already lets users open their saved memories and delete them individually, and Anthropic's Claude offers a comparable view of what it has stored. If consumer assistants ship that screen, a business agent holding account details has even less excuse not to. A customer's correction is the highest-quality expiry signal you will ever get, so make it one click and make it final.

## The legal clock runs alongside your TTLs

If you serve customers in the EU or UK, retention isn't only an engineering preference. The GDPR's storage limitation principle in Article 5(1)(e) says personal data shouldn't be kept in identifiable form longer than needed for its purpose, and Article 5(1)(d) requires it to be accurate and kept up to date. Article 17 gives people the right to ask for erasure. A memory store that holds a customer's remembered address for three years with no purpose attached is awkward to defend under the first, and a stale one is awkward under the second.

Write the purpose into the policy table, one line per fact type: why the agent holds it and why the TTL is what it is. That column is what you hand to a data protection officer or a regulator when they ask. It's also what stops an engineer from quietly doubling the TTL on preferences because someone complained once.

Remember too that memory is often copied. Embeddings sit in a vector database, summaries in a log, raw text in an analytics pipeline. Deleting the record in one place and leaving the embedding in another isn't deletion. Map every place a memory lands, then make expiry cascade to all of them.

## What to measure each week

A policy you can't observe is a document, not a control. Four numbers are enough to start.

First, the share of memory reads that hit records older than half their TTL. If that share keeps climbing, your agent is leaning on aging facts and you should shorten lifetimes or add reconfirmation prompts. Second, the contradiction rate: how often a tool result or retrieved document disagrees with a memory the agent was about to use. Each contradiction is also a free test case for your conflict suite from earlier.

Third, the customer correction rate, meaning how often someone says some version of 'no, that's not right' after the agent states a remembered fact. Break it out by fact type. The type with the worst rate is the one whose TTL is too long, and the numbers will tell you that faster than any design review.

Fourth, the size of the store per active customer. Memory that only ever grows is a sign the expiry path isn't running. Page whoever owns it.

Give each row of the table a named owner, someone on the hook for its TTL, and review the whole thing quarterly. Models change, products change, and a TTL that was right for last spring's pricing model may be wrong now.

If you do only one thing this week, open your memory store, search it for dollar signs and plan names, and see how many of those entries are still true. Then delete the rows and fetch them live instead.

**Also read:** [How to calibrate LLM as a judge before your eval dashboard lies to you](https://startupfortune.com/how-to-calibrate-llm-as-a-judge-before-your-eval-dashboard-lies-to-you/) • [Build an LLM model deprecation migration plan before the cutoff week](https://startupfortune.com/build-an-llm-model-deprecation-migration-plan-before-the-cutoff-week/) • [How to Set LLM Eval Pass Threshold Before the Demo Does It for You](https://startupfortune.com/how-to-set-llm-eval-pass-threshold-before-the-demo-does-it-for-you/)

*This article is posted in [AI News](https://startupfortune.com/category/ai/), check it out for more related stories.*

## Join the discussion

[Open in the community →](https://startupfortune.com/community/)

Almost there. Sign in and your reply posts straight away.
