The easiest way to make an agent look smart is to give it a longer context window. Paste in the documents, the history, and the tool outputs, and let the model sort them out. That approach works until one of three things happens: the conversation outgrows the window, the cost per turn becomes painful, or the model silently forgets the one constraint that mattered three messages ago.
Context is what the model can see right now. Memory is what the model chooses to carry forward. We keep treating these as the same thing, and the confusion is expensive. A bigger window is a bigger desk. It is not a filing system. The interesting engineering happens in the gap between prompts, and that engineering is what makes an agent feel reliable rather than merely capable.
Three kinds of remembering
It helps to stop treating “memory” as one thing. An agent needs at least three kinds, and each one fails differently.
Working memory is the scratchpad for the current task. It is cheap to build and easy to overflow.
Episodic memory is a record of what happened and when. This is what lets an agent say “we already tried that.”
Semantic memory holds durable facts about the user and the world, distilled from many episodes.
Most complaints that “the agent has no memory” are really about a missing episodic layer. The model can reason perfectly well. It simply has no record of its own past, so it loops, repeats itself, and apologizes for the same thing twice.
An agent without episodic memory is not forgetful. It is amnesiac. Every turn is its first day on the job.
Write less, decide more
The naive approach is to log everything and embed it. But retrieval quality collapses once the store fills with near-duplicates and dead ends. The real work is choosing what to remember, in a small and opinionated write step that runs after each task:
// after each completed task
const note = await summarize(episode, {
keep: ["decisions", "failures", "user prefs"],
drop: ["raw tool output"],
});
if (note.salience > 0.6) memory.write(note);
A salience threshold is a crude filter. It is still the right first move, because a crude filter that runs on every turn is worth more than a perfect one that never ships. The store stays small, retrieval stays sharp, and the agent stops drowning in its own transcript. You can raise the threshold later. You cannot clean up a polluted memory store after the fact.
The honest version
None of this makes the model smarter. It makes the system coherent, and from the outside those two look identical. A user does not care whether continuity comes from a 200k window or a 2kb note. The user cares that the thing remembered. Build for that, and everything else is plumbing worth getting right.