Clapham Digital · Case study

A memory for AI agents that has to show its evidence

anneal-memory is the open-source memory my AI work for clients sits on. Most memory for AI agents stores what it’s given and hands it back. anneal makes every pattern it promotes cite the record it came from, and puts the call on what’s true in front of a person.


What it is

A Python library that gives an AI agent a memory that lasts between sessions. While the agent works it writes episodes into a local SQLite file. At the end of a session it compresses them into a short summary it reads at the start of the next one. A pattern only moves up a level in that summary when it cites real episodes as evidence.

It’s MIT-licensed, has no dependencies beyond Python itself, and runs as a library, a command line or an MCP server. There are integration guides for twelve agent frameworks. Install it from PyPI; the code and the benchmarks are on GitHub.


The hard part

  • What it promotes has to show its evidence.A pattern climbs a level only if the episodes it cites exist and its explanation shares at least two meaningful words with them. A citation that doesn’t check out demotes the pattern one level, unless it was grounded recently, in which case it’s held and flagged. The check is plain word overlap by design: fast, repeatable, and with no second AI in the loop that you’d then have to trust.
  • I attacked it the way a bad actor would.Five fabricated claims, each citing a different pair of real episodes, built to get past both the word check and the detector that watches for one episode being cited too often. They got past both, and all five still landed on the operator’s review list, because anneal puts every pattern it promotes in front of a person, whatever the detectors said. Whether a claim is true is a human call, and the design makes sure a human gets to make it. The repo’s test runner replays the attack with no API key.
  • I measured what recall actually uses, and rebuilt it around that.anneal also links episodes that get cited together, loosely like Hebbian learning. On my own memory store, the one I run every day, across 15,774 recalls over about three months, recall surfaced a crystallized pattern 788 times: 744 through the evidence the pattern cites, 44 by keyword, none through a link. So recall stopped following the links and runs on the evidence, and the README shows the numbers.
  • An update that names what it replaces, replaces it.Record “I live in Seattle,” then later “I moved to Austin,” and plain keyword recall serves both: in a probe with 16 planted fact-and-update pairs, it returned the stale fact 16 times out of 16. When the update names what it replaces, the stale fact came back 0 times out of 16. I tested letting a model infer those links on its own and it didn’t find the right pairs, so anneal never infers the link itself: it takes it from whoever records the update, and checks that it’s well formed.
  • Recall as good as the full transcript, and every promoted pattern sourced.136 synthetic scenarios: a fact stated once among 80 unrelated sessions, then a request that depends on it. With no memory, the reader applied the fact 15% of the time. With the full transcript, 81%, on about 34,000 characters of context. With anneal’s summary, 82%, on about 3,100. A plain rolling summary landed in the same range (78%) on even less, so compression alone isn’t the edge. What anneal adds is that the patterns it promotes cite their evidence, at the same recall. The benchmark is in the GitHub repo and runs on your own API key.

What it means for your project

If an AI system is going to touch your business, I build it so you can check it. By default that means three things. What it remembers points back to evidence. What it’s been tested against, and where its limits are, is written down. A person decides what it’s allowed to keep. And the tests behind the attack, the update probe and the benchmark are published, so you can run them yourself.

Related: AI and automation for Columbus businesses.


Have something that needs building, fixing or checking? Email [email protected] or call or text (614) 835-7163.

All case studies → Blog →