Skip to content
agentsmemorycost

Agent Amnesia and the Second Bill

Every agent session starts by rebuilding context the last one already paid for. What a persistent, growable forest memory changes about agent workflows, and the skills file that makes agents actually use it.

MonkeyLLM Team4 min read

An agent finishes a productive session on Tuesday. On Wednesday its successor starts from zero: re-reading the same files, re-deriving the same decisions, re-summarizing the same documents. You already paid for that context once. This post is about the second bill, and what a memory that survives the session does to it.

The second bill

The first bill is the one on the invoice: tokens in, tokens out. The second bill is quieter. Every cold session spends its opening minutes and thousands of tokens rebuilding state a previous session already had: which services exist, what the team decided about the migration, where the flaky test is tracked. Multiply by every session, every agent, every day, and reconstruction becomes a standing tax on the whole workflow.

The usual patches do not hold. Pinning history into the system prompt grows until it crowds out the actual task. Scratchpad files work for one agent until the file outgrows a single read, or until a second agent needs the same memory. What is missing is not a bigger context window. It is a place for knowledge to live between sessions.

A memory that outlives the session

MonkeyLLM's answer is a knowledge forest: a self-hosted graph of small curated notes, each carrying a passport (a title, a summary held to sixty tokens, tags), that agents reach over MCP. Agents work it through three moves. Navigate: enter through search and walk, reading labels and opening only what is needed. Plant: commit new knowledge as new nodes. Pheromone: successful hunts deposit traces and mint shortcut links, which in plain English means routes that produced answers get marked so the next hunt is shorter.

Plant is the move that kills the second bill. When a session learns something durable, that payments-v2 owns refunds now, or that the staging outage traced back to a DNS TTL, it commits the fact as a node before it exits. Wednesday's session does not rebuild it. It searches, walks two or three budgeted hops, and stands on the node Tuesday planted. And because recurring questions lay pheromone, the walks your team does weekly get shorter over time. A brain your AIs can grow.

The skills file

A memory nobody consults is a diary. What turns the forest into working memory is a small instruction file, surfaced in the Studio's Skills screen, that any MCP-capable agent loads: recall from the forest before answering anything in its domain, plant durable knowledge before finishing, cite the node ids you stood on.

The Skills screen: the instruction file that makes the forest an agent's memory
The Skills screen: the instruction file that makes the forest an agent's memory

That one file changes the session lifecycle from cold start to recall, work, plant. It also makes memory shared: five agents with five scratchpads hold five partial views, five agents with one forest hold one.

What it does to the numbers

We have measured the retrieval side of this. Against an iterative-RAG baseline on strictly multi-hop questions, budgeted navigation spends 0.58x the tokens per correct answer, at 8.4 s p95 versus the baseline's 17.5 s. Per correct answer is the honest denominator: a pipeline that fails cheaply still bills you, and failing cheaply is not economy. The full measurement is in agentic RAG vs budgeted navigation.

Tokens per correct answer: iterative-RAG baseline at 1.00x, navigator at 0.58x
Tokens per correct answer: iterative-RAG baseline at 1.00x, navigator at 0.58x

The minutes are harder to benchmark, and we have not tried to put a number on them. Run a forest next to your agents for a week and watch where the opening ten minutes of each session stop going.

Stop paying twice

A forest is private by design: engine Apache-2.0, apps AGPL, self-hosted, data never leaves your infra. Four commands stand one up (deploy docs) and the MCP docs wire it into your agents. Deploy one at https://github.com/JimmyWesley/MonkeyLLM if agent amnesia is a bill you recognize, and find the rest at https://monkeyllm.com.

Want the long version?

The paper carries the full architecture, the benchmark tables and the findings that failed their criteria.