Short-term Memory (Agent)
Everything an agent currently knows about the task in front of it sits in one place: the text it carries into the next model call. Short-term memory is that working set — the goal, the steps taken so far, the tool results that came back, the last few turns of conversation — and it is bounded by the context window.
What it holds, and how it is kept
It is not a database; it is the prompt. On each iteration the agent assembles the system instructions, the goal, and the running trace of reasoning, actions and observations. Because the window has a hard limit, something must manage what stays: dropping the oldest turns, truncating bulky tool output, or compacting the middle of the trace into a summary. Every one of those choices loses something. Agents built to survive long runs push the detail out to long-term stores and keep only pointers in the working set.
Why it matters
Short-term memory is what makes a loop coherent rather than a series of unrelated calls — it is how step nine knows what step two discovered. Its limits produce the most recognisable agent failures. A plan drifts because the constraint that shaped it scrolled out of the window. An identifier is plausibly invented rather than looked up, because the result containing it was truncated. A task loops forever because the record of three identical earlier attempts has already been dropped. Step budgets, summarisation memory and durable stores all exist because this one resource is finite.
Short-term memory is the working state an agent carries into each model call — the goal, the steps taken, recent tool results and conversation turns — held in the prompt and bounded by the context window. It is managed by dropping, truncating or summarising as the window fills. It matters because it is what makes step nine aware of step two; when it overflows, plans drift, identifiers get invented and attempts repeat.
Short-term memory is like what you hold in your head while cooking a meal: which pan is on, what you already added, what comes next. You don't need any of it tomorrow, but losing it mid-recipe ruins the dish. For software working on a task, it is the same thing — the running account of the goal, what it has tried, and what it found out.
The catch is that there is only so much room. When a task runs long, the earliest part gets squeezed out, and that is when a program forgets a condition you set at the start and quietly goes off course.