A few weeks ago I wrote a post here arguing that my cheap models weren't dumb, they were missing a world model. It was 90% hypothesis and 10% hope. I had read about a third of a paper and built nothing.
This is the report from actually building it.
It does not end with a benchmark. It ends with two memory systems, one week of work I walked out of early, and a measurement problem I didn't see coming.
The setup, quickly
I build Mocu, an open-source, local-first desktop AI colleague. You bring your own OpenAI-compatible endpoint, which means I spend most of my time running it on cheap models, because that's the whole point of the thing.
And cheap models repeat themselves.
They try the same failing command twice. They read a wrong path, notice the path was wrong, and then read the wrong path again five minutes later with total confidence. Every tool I used before this explained the mistake to me beautifully, in detail, afterwards. Thanks. I already knew it broke.
What I wanted was the opposite: tell the model no, don't do that before the command runs. Not a post-mortem. A prediction.
The paper that gave me a shape for this is Self-Evolving World Models for LLM Agent Planning (EMNLP 2026 Findings). The short version: keep the agent frozen, and let a world model improve by evolving its context instead of its weights. Episodic memory of real action→outcome transitions, semantic memory that turns a bad prediction into a written rule, and a confidence filter that drops predictions the system doesn't believe.
No gradients. No training run. The improvement lives in text files.
That last part is why it fit my constraints at all. Mocu is Apache 2.0 and everything lives in local files you can read and edit. There's no server collecting traces and no pipeline to rent. Text is the only kind of learning I can actually ship.
Day one and two: I built a pipe
Day one went into finishing the paper. No code.
Day two I built exactly one thing: I routed every tool call the agent makes through the world-model code. Now the system physically sits between the agent and its tools. The agent cannot act without passing through it.
That felt great for about ten minutes.
Then I realized I had built a pipe and had no idea what was supposed to flow through it. How does a prediction get made? How does the agent even understand one when it arrives? Is it a warning, a rewritten plan, a blocked call? I had no answer, and the paper didn't hand me one I could wire into a real running system.
So I did what I usually do: left the question open and built the part I could build.
Day three: the "simple" one
Episodic memory. Store what the agent did, read it back, warn before it repeats a failure. In the paper this is half a page. It looked trivial.
It took a full day and forced me to reverse two things I felt strongly about.
One: where the data lives. Mocu already keeps every tool call in the project folder. My instinct was not to duplicate it. I tested that and it didn't hold. It had to go into the global folder as well.
Two: how much to store. I did not want to write every single tool call into a memory database. It felt wasteful and messy.
I now write every single tool call into it.
Both decisions came out against my instinct and I'm still not sure either one is final. "Simple" should come with a health warning.
The mechanism, plainly:
- Every tool call gets stored with its outcome.
- Before an action, a BM25 search pulls the closest past calls, and a small decision model picks the one that's genuinely closest.
- The system checks how that past call turned out.
- If it worked: silence, nothing happens.
- If it failed: the model gets one line. This is very close to something that failed before.
Before, not after. That's the entire feature.
And then it worked better than I expected. Noticeably better. Fewer repeated mistakes, in early tests the difference wasn't subtle.
Which should have been the happy ending, and instead gave me a small alarm. Everything I know about this project says the real world ruins your nice plan. Here, the piece I thought would eat half a day behaved better than the paper promised and better than I designed it to. So something underneath might be wrong and just hasn't shown up yet.
I went into the next day more worried than I was before the win.
Day four: the tired one
Semantic memory is the part that was supposed to do the actual thinking.
The theory: a tool fails. First question, was it that tool's fault? A bad command, a wrong path, a malformed argument? Then it belongs to episodic memory and it's already handled. If not, the real cause is further back. So you walk backwards through the earlier calls, find the tool that actually caused the failure, and turn that into a warning so the agent doesn't repeat it.
The tool that fails is often not the tool that caused it. That's the whole reason this layer needs to exist.
That was the plan. It is not what I built.
I started that day exhausted. The hardest piece of the system, and I was running on empty. So I did the thing this project keeps making possible and probably shouldn't: I let Mocu write a large part of it.
The code runs. It exists. I don't trust it, because I didn't write most of it and I haven't reviewed it properly. My honest note to myself that evening was one sentence: I don't think it turned out well.
It also diverged from the paper. The paper's version is about cause and effect, actual reasoning about how one step produced the next outcome. That didn't make it in. What made it in is a much lighter mechanism that borrowed the name and very little else.
The paper called it semantic memory. So I call it semantic memory. The name stuck. The idea didn't.
Then the test, and the joke
I built the two memories in the wrong order, and that turned out to be a trap.
In the entire test session, there was exactly one failure that the second system could legitimately catch and fix.
One.
Everything else was either already caught by episodic memory or wasn't in semantic memory's category at all. The first memory guarded the door so well that the second one never got a customer.
No bug to fix. No proof of success either. Not broken, not proven. Just unmeasured.
Why I stopped at one week
I could keep going. I could write scenarios designed specifically to feed the second memory.
But the entire premise is that it learns from real mistakes, from real work, not incidents I invented to make my own test look good. Which means the honest test isn't a test. It's weeks of using Mocu normally, waiting for enough real failures to pile up that the system has something to study.
Weeks, not days. And I don't have weeks for this right now.
So the build is finished. Not because it's proven, but because it's finished. I'm walking away and letting reality do the testing. That's how it ended: one week out of the two I gave myself, two memories, one visibly working, one I can't see yet.
The actual lesson, which isn't about memory
I spent a week building something whose entire job is to prevent mistakes, and found out that prevention is a terrible thing to measure.
Every mistake it stops is a mistake that never appears in your logs. So you end up trusting a system based on the absence of evidence, which is the exact thing you're told never to do.
Three times in this project reality argued with my plan. I thought the architecture would be easy and the magic would be hard. It was backwards. I thought the simple memory would take half a day. It took the whole day. I thought a working memory would prove itself. It didn't. It just made the second one invisible.
Maybe that's the real shape of self-improving systems. Not a moment where it gets smart. Just a slow pile of mistakes that stop happening.
What's next, and what I want to know
Two failure modes are on my short list and both are embarrassing:
- Self-confirming memory. If the agent retrieves its own past predictions instead of past outcomes, it will happily agree with itself forever. The store has to be outcomes only.
- Rules that breed superstition. Enough one-off heuristics and your context window becomes a collection of coincidences. Requiring a pattern to recur before promoting it is probably the fix, and it means the system learns slower, maybe not at all in a session.
If you've built something in this direction (externalized prediction, memory that writes its own rules, agents that are allowed to say "no idea"), I'd like to hear what broke. Especially the part where the memory poisoned itself.
And if you think the whole premise is wrong, that's useful too. Tell me which of those two gets me first.
I'll come back with numbers either way, including the ones that make me look bad. Mocu is open source at github.com/kharchangai/Mocu if you want to read the code before I've reviewed it.

