How it works

Why your agent forgets and how to fix it

Context is finite, and a week-long conversation turns a smart agent into a dull one. How long-term memory works and what it changes.

Why your agent forgets and how to fix it
Photo: CC0 1.0 · source

A familiar story: in the first week the agent answers precisely and fast, and a month later it is dull, confused and vague. The cause is almost never the model — it is how memory is arranged.

Why a long conversation makes an agent worse

Every model has a context window — how much text it sees at once. One endless dialogue gradually fills that window with both important agreements and random remarks from a month ago. The important sinks into the noise and answers become generic.

The second effect is money and time. On every turn the model re-reads the whole window. A four-hundred-thousand-token conversation means a simple «what time is it» costs as much as a serious task, and takes as long.

How it is fixed

  • The conversation is cut on a schedule or when the window fills, instead of running for weeks.
  • Before the cut a short summary is produced: what was discussed and what was decided. That travels into the new conversation instead of the whole history.
  • Long-term facts go into memory files: who is who, which rules apply, which decisions were made. That is knowledge, not chat history.
  • The new conversation receives not entire memory files but only the parts relevant to the current task.

Why the last point matters

This is the most underrated part. If you inline all memory on every start, the agent hits the same ceiling again — except now it is clogged by its own notes rather than chatter. Relevance-based selection removes the problem: only what is needed now reaches the context.

How to recognise this particular illness

The signs are simple: answers got slower, the agent re-asks what it used to know, and it turns vague where it used to be specific. If that is your case, the cure is not a different model but cutting the conversation and giving it proper memory.