Where does an agent keep short-term state during a single task?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
The agent's per-task working state (conversation, tool results, plans, scratchpad). It lives in the prompt or runtime state, is bounded by the context window, and resets at task end.
Imagine someone solving a puzzle at a table. They keep a little notepad next to them with arrows and crossed-out guesses, the picture of the box, and a few tiles already placed. When the puzzle is done, they throw the notepad away and the next puzzle starts with a fresh notepad. Short-term memory is that notepad for an agent. It holds everything the agent needs to remember while working on this one task: what was said earlier in the conversation, what the last tool returned, what the agent is planning to do next. When the task ends, the notepad is gone.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
Define short-term memory as the per-task working state of the agent. Explain that the model is stateless and the runtime carries the state, materialised into the prompt each call. Name the contents: conversation, tool calls and results, plans, scratchpad. State the capacity bound (context window) and the effective bound (attention). Close with the contrast against long-term memory.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Believing short-term memory is something the model 'has' the way humans have working memory. The model is stateless; short-term memory is just the prompt and runtime state assembled fresh on every call.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.