The biggest surprise from a year of running production agents: memory is where they rot. Not models, not prompts. Memory. Every agent we have had to rebuild had drowned in its own notes, retrieving stale context and applying dead rules with total confidence.
The entire persistent memory across our seven production agents is now about 11,000 words, smaller than this blog publishes in a month. Output quality went up when we cut the store down, not when we grew it.
The discipline is three lists: what to persist, what to forget on a timer, and what must never be written at all.
Memory is a filing decision, not a feature
Agent memory fails as a diary and works as a filing cabinet. Retrieval is a search problem, so every entry you keep is competing for the agent's attention on every future task, and stale or redundant entries are noise wearing the uniform of signal. An agent that recalls three contradictory notes about one client writes a muddled email. The design question is never how much the agent can remember. It is what deserves to be found.
Our worst incident made this concrete. A reporting agent kept citing a client KPI that had been retired for two months, because the old definition sat in memory next to the new one, undated.
Nothing was wrong with the model. The filing was wrong.
Since then every memory entry carries a date, a source, and an expiry class. Boring, and it ended the incidents.
Persist: decisions, rules, and outcomes
Three categories earn permanent storage. Decisions with rationale: we publish four posts a week, decided June 2026, because daily cadence added no citations. Standing rules: brand voice, client preferences, tier boundaries, formatting standards. And measured outcomes: title rewrites cut citation mentions 22%, reverted. Everything permanent is a compact, dated, sourced statement that future tasks can apply without rereading history.
The test for persistence is simple: will this still be true and useful in 90 days? Facts about how the business works pass. Facts about last Tuesday do not.
Stable entity facts qualify too: who the client's audience is, what their offer costs, which topics they will not touch.
Roughly 60% of our store is rules, 25% outcomes, 15% entity facts. Decisions live inside the rules they produced.
Forget: transcripts, drafts, and anything with a shelf life
Everything episodic expires on a timer. Raw conversation transcripts keep for 14 days, then a summarizer distills anything durable into a rule and deletes the rest. Intermediate drafts keep seven days. Task context, the notes an agent takes while working, dies with the task. Metrics snapshots expire after 90 days because the trend lives in the analytics store, not in memory. If information has a shelf life, it gets a timer the day it is written.
The instinct to keep everything feels safe and costs accuracy. Every expired transcript is one less chance for the agent to quote a stale plan as if it were current.
Deletion is not loss. The durable 2% gets promoted to a rule before the purge. The other 98% was exhaust.
When an agent needs history, it queries the system of record: the CMS, the ledger, the analytics store. Memory is not an archive.
Never store: secrets, client data, and one-off exceptions
Three things never enter memory under any circumstances. Credentials and API keys, which live in a secret manager the agent calls at runtime. Client-confidential material, financials, personal data beyond business contact context, and anything we could not show the client on request. And one-off exceptions, because an exception written to memory quietly becomes a precedent. We learned that one the embarrassing way: a single approved discount got noted, and the proposal agent offered it to the next prospect unasked.
The exception rule is the least obvious and the most valuable. Agents generalize. That is their job. Feed one special case into memory and it will be applied to cases that are not special.
If an exception must be remembered, write the boundary with it: this applied to client A in June 2026 only, never offer unprompted.
The confidentiality rule has a clean test: could you export the memory file and email it to the client? If not, something in it does not belong.
Regulated businesses should treat agent memory as a data store in scope for compliance, because that is what it is.
Write memory as rules, not stories
A 40-word rule beats a 4,000-word transcript every time it matters. Retrieval surfaces chunks, and a chunk from a long narrative arrives without its context: who decided, whether it stuck, what came after. A rule arrives whole. Compare pulling paragraph 30 of a client call against pulling one line that reads: client prefers case studies over feature lists in all proposals, decided March 2026, source call notes.
The rule format forces a decision at write time about what the episode actually meant. That is exactly the thinking you want done once, not re-derived badly on every future retrieval.
Our format: one sentence of rule, one date, one source link, one expiry class. Nothing else.
If a lesson cannot be stated in a sentence or two, it is not a memory yet. It is still an open question.
The weekly compaction pass
Every Friday a compaction job spends about 20 minutes of agent time and five of ours. It expires everything past its timer, deduplicates rules that have converged, flags contradictions for a human call, and promotes repeated episodes into rules, because the third time something recurs it is a pattern. The store shrinks or holds steady most weeks. Growth without new scope is a smell.
The contradiction queue is the valuable part. Two rules disagreeing about one client means something changed and only one memory noticed. A human settles it in a minute.
Compaction is also when boundaries get checked: anything that smells like a secret or an unbounded exception gets quarantined for review.
Total cost, five human minutes a week. Total effect, agents that stay sharp instead of aging into confusion.
Audit what the agent actually recalls
Once a month we run a ten-question recall test per agent: questions whose answers definitely live in memory, like what cadence do we publish at, or what did the title experiment conclude. Score it. When we started, agents averaged five of ten, retrieving something adjacent instead of the answer. After six months of compaction discipline the average is nine of ten, and the misses point at filing problems we can fix that day.
The audit takes 15 minutes and turns memory from a hope into a measured system.
A failed recall is never the model being dumb. It is a duplicate, a missing date, or a rule buried in narrative. All fixable.
Store less, date everything, and make forgetting a scheduled job. The agents remember better when they are allowed to forget.