Why Your AI Agent Repeats Mistakes: Negative Memory
Agents remember what worked and forget what failed, so they hit the same wall twice. Here's the negative-memory fix builders are converging on.


Your agent keeps repeating its mistakes because almost every memory system is built to remember success and throw away failure. Retrieval finds what looks similar to the current situation; it does not find we tried this and it died, here is why. So the agent walks back into the same wall — politely, confidently, and at your expense.
This is the most-argued-about unsolved problem among people actually running agents, and the useful part is that the diagnosis is now specific enough to fix.
The problem, stated precisely
An agent's memory is usually a pile of notes plus a similarity search. Ask what worked for a similar task and you get a decent answer. Ask what failed for a similar task and you often get nothing, because failures were never written down in the first place — they were just an error message that scrolled past.
One widely-read thread in r/AI_Agents, from a builder who asked the community how they handle agent memory, landed on the same name for the missing piece: negative memory — "the agent never preserves 'we tried this route and it died because X,' so it cheerfully walks back into the same wall."
Two structural reasons make this worse than it sounds:
- Failures are more informative than successes. A success tells you one path worked. A failure eliminates a path permanently — if you write it down.
- Retrieval is biased toward resemblance. Embeddings are good at "what looks similar." They are not good at "what should I not do again," which is a different question entirely.
The second symptom: drift, not stupidity
There is a companion failure people describe in the same conversations. An agent that is sharp on step one is confidently wrong by step ten — not because the model got worse, but because the goal got diluted.
As one r/AI_Agents thread puts it, in a discussion of why agents feel solid at first and then slowly get worse, the working fix people report is splitting context into three parts: a constitution that rarely changes, project state that changes often, and verified facts you should not have to rediscover.
And in a thread on what is still hard to do reliably with agents in 2026, the complaint is blunt: after about ten steps the agent forgets what the original goal even was and starts hallucinating details from step two.
Meanwhile the engineering literature is converging on the same conclusion from the other direction. A practitioner write-up on why agents keep making the same mistakes argues the model's intelligence is not the bottleneck — the system around it, meaning rules, memory and verification, decides whether it is useful daily or merely impressive in a demo.
The fix: a failure log, and three layers
The pattern that keeps working is unglamorous. Keep two memories, not one, and keep them outside the model's chat history.
Layer 1 — Constitution. Goals, constraints, permissions, the things that should never change. Read at the start of every task. This is the antidote to drift: the goal is re-injected rather than hoped for.
Layer 2 — State. What is true about the current project right now: what has been done, what is in progress, what is blocked. Rewritten often, discarded when stale.
Layer 3 — Verified facts. Things you should not rediscover: the account number that works, the API that actually responds, the file paths, the quirks. Facts get in only when they were checked.
(The missing fourth) — Failure log. One entry per dead end, in the form: what we tried → what happened → why → do not retry unless X changes. This is the piece most systems lack. It is also the cheapest layer to build, because you already have the failures; you simply are not storing them.
Two rules keep the log from becoming noise:
- A failure entry expires. Write "fails as of 2026-09-18, retry after the provider updates" rather than a permanent ban. Stale negative memory is just a different bug.
- Write the reason, not the symptom. "Timeout" is a symptom; "this endpoint caps at 100 records per page, so requesting 500 silently truncates" is a reason the agent can generalize from.
What this looks like day to day
- When a task fails twice in the same way, that is a memory write, not a retry.
- When you correct the agent, the correction goes in the constitution, not just in the chat.
- When a fact is verified — an ID, a working command — it gets promoted out of the transcript.
- When you start a long task, the goal is restated from scratch rather than inherited from a drifting conversation.
If you want the mechanics of layering memory properly, we wrote a longer walkthrough in how to give your AI agent a memory that lasts, and the storage model lives in our memory documentation. The related cost problem — how much of your context is spent re-reading your own history — is covered in the agent context tax.
Start small if this feels like overhead. One file, four headers, and a rule that every repeat failure gets a line. That single habit is the difference between an agent that gets better with use and one that resets to clever every morning.
The takeaway
Agents do not improve by being smarter; they improve by remembering what did not work. Add a failure log with a reason and an expiry, keep your goals and permissions in a layer that is re-read every task, and promote verified facts out of the chat. Do that and the same task stops costing you the same three mistakes.
