cachly← All posts
Agent memory

My AI remembered three true things. Each broke something.

In the last part I asked what your AI had remembered wrong. Sixteen of you answered with real cases, and I expected a pile of stale notes. Most of the cases taught me something else: the notes were true, and they still sent the agent the wrong way.

Your cases sorted themselves into three kinds. Each kind needs its own fix, which also explains why a single "freshness" score never worked for me.

1. True once, then replaced

This is where I started. My agent kept quoting "four to one" after I had measured "two to one".

@paullovelace had the same with a renamed API endpoint. The correction happened in chat, and for weeks the agent used the old name, because the correction never reached the memory file. Paul's case sits one step earlier than where I had been looking. Before a correction can win, it has to arrive in the store at all.

Then it has to win. Mine lets a new note name the one it replaces, so the old one stays readable but stops winning. When I counted, 2 of 735 notes carried that link. The mechanism works; agents just rarely use it.

@gimalay (Dmytro) does it differently, and I think that's right. In Dmytro's tool, a note marked as replaced can't be saved without naming its replacement, and sessions load only current notes. Asking nicely gave me 2 of 735, so I'll try it that way: the question becomes part of the write.

@opschainx goes further and deletes the old note outright, and named an honest gap in that, too: the same fact relearned in different words survives the delete. zhang jimmy and @salparvez landed in between, with in-place replacement and a "void" stamp. Side by side, it made sense to me: the old note should stay as history for a human and go quiet for the agent.

2. True for its case, used for another

@galadev had a case I hadn't thought about. Gala's agent keeps a file of corrections. One said never to link a certain subdomain, because that app has its own domain. Eight days later the agent applied the rule to a different site that has no domain of its own. The note was right. It had lost the case it came from.

A replace link can't help, because nothing replaced the note. What helped was writing the scope into the note: which site, which service, which environment. Gala found it by asking the agent where the rule came from, and the pointer led to the wrong site. I'll do that too. A rule that can say where it came from can also say where it stops.

3. True for its data, read without it

@izgorodin (Edward) pointed out that my own two numbers were both honest. "Four to one" and "two to one" were each true of the data they were computed on; the second just rested on more. I think Edward is right: stale facts need a replacement link, stale measurements mostly need their denominator.

So a number now goes into memory with its window and its count next to it: "two to one, N articles, June to August". The agent can then see that a new reading is due once the site has grown, instead of choosing between two equally sure figures.

Two lessons that cut across all three

@kitwisestudio described the workaround for a bug that has since been fixed. It never looks stale, and it keeps getting written back into new code. I checked my own store: it can attach a version range to a note, and recall pushes the note down once the project is past the range. It only helps when someone writes the range at the time, the same weak spot as the link.

@maame-codes, @quantumtechcoder and @halfcycle arrived at the same rule from three directions: for anything that can change, read the live source first. Ports, IDs, versions, config. QuantumTechCoder's migrations ran cleanly against a dead database for 25 minutes; Halfcycle's agents kept hedging about features that had shipped. Memory brings the context; the file on disk brings the value.

What I'm changing

I'll report the replace-link count again in a few weeks. 2 of 735 is the baseline.

Thank you also to Ayush Dhanani, OneLifeVibe, Kevin Hall, Mudassir Khan and everyone else who added a case. Every case helped.

Which of the three have you run into most: the replaced note, the note used outside its case, or the number without its denominator?

cachly.dev

For solo developers, teams and whole companies

Explain it once. Every AI knows it.

cachly keeps what you explain to your AI in every session. Claude Code, Cursor, Copilot and Windsurf read your rules, decisions and solved bugs: for you alone, for your whole team and for every team in your company. Servers in Germany, with SSO and a DPA for companies.

Servers in the EU · one command, restart your editor, done · 1 project free

Four ways to install

Claude Code
/plugin marketplace add cachly-dev/cachly-mcp
/plugin install cachly-brain@cachly

Then turn on auto-update once: /plugin → Marketplaces → cachly → Enable auto-update

Any MCP editor
npx @cachly-dev/mcp-server@latest autopilot