Scratchpad
also known as Working Notes, Thinking Tool, Notepad
Give the agent a writable scratch space for intermediate notes that informs later turns but does not pollute the response.
Context
An agent is working on a long task where it benefits from writing things down as it goes — intermediate computations, plans, lists of unresolved questions, candidate options it is considering. None of this scratch work is something the user should see; it is the agent's internal working surface, the equivalent of notes on a whiteboard.
Problem
Without a dedicated scratchpad, the intermediate work has nowhere appropriate to live. Either it pollutes the user-visible response, so the user sees half-finished computations and the agent's running commentary, or it is held only in the conversation history and is lost the moment that history gets trimmed. Either way the agent loses the artifact that was supposed to support its own reasoning, and the user is forced to read through clutter that was never meant for them.
Forces
- Scratchpad content adds tokens to subsequent turns.
- What stays in the scratchpad vs the response is a UX choice.
- Scratchpad content can leak via traces.
Example
A research agent that has to read ten papers and answer one question keeps repeating itself in the visible response because every intermediate note is also output to the user. The team adds a scratchpad tool: the agent writes intermediate notes to a private buffer it can reread on later turns; the user-visible response is composed at the end. Responses become tight while the agent's working memory stays rich.
Diagram
Solution
Therefore:
Provide a tool or convention for writing to a scratchpad (a section of the prompt, a tool call, a file). The agent reads from and writes to it across turns. The user-visible response is separate. The scratchpad is purged at task completion or expires with the session.
What this pattern forbids. Scratchpad contents are visible only to the agent loop; user-facing output draws from the response slot.
The smaller patterns that complete this one —
- usesChain of Thought★★— Elicit multi-step reasoning by prompting the model to produce intermediate steps before its final answer.
- generalisesTodo-List-Driven Autonomous Agent★— Have the agent author a plan file (e.g. todo.md) early in the run, tick items as it completes them, and re-inject the remaining plan into context; the file is durable plan and working memory.
And the patterns that stand alongside it, or against it —
- complementsShort-Term Thread Memory★★— Carry the relevant slice of conversation context across turns within a session.
- complementsExtended Thinking★★— Spend a configurable budget of internal reasoning tokens before producing a user-visible answer.
- alternative-toPreoccupation Tracking★— Maintain a small set of mid-term, affect-tagged concerns that persist across days and surface in every prompt, distinct from the single-item working focus and from long-term insights.
- alternative-toBDI Agent★★— Agent maintains explicit Beliefs about the world, Desires (goals), and Intentions (committed plans), and reasons by reconciling the three.
Neighbourhood
Click any neighbour to follow the language. Scroll to zoom, drag to pan.