← Back to concept explainers

Concept Fable

Draft area

Conclusion first:A scratchpad is a temporary workspace used by an Agent during the current task to record intermediate observations, calculations, plans, tool results and execution notes. It helps the Agent maintain task state, but usually should not enter long-term memory or user output without filtering. Enterprise systems need to manage the scratchpad's lifecycle, isolation scope, visibility and cleanup policy to avoid context contamination and sensitive information leakage.

Scratchpad · Agent state / reasoning workspace

Read the story first. There is no rush to give a definition here; let the question grow on its own first.

Fable

The temporary plank on the boat repairer's table

The harbor repair shop took on many small jobs every day. The master used to rely entirely on his memory: which plank had been measured, which nail needed replacing, which boat owner wanted to set sail tomorrow morning. Simple repairs could still be handled.

Later, a large ship entered the port. There were three leak points, the bill was split between two parties, and materials could only be confirmed after the tide receded. The master checked while forgetting, and nearly mistook old measurements for new results.

The apprentice proposed writing all findings into the official ship log. The file became very thick, stuffed with temporary guesses, mis-measured dimensions and already-voided to-dos. The next lookup was actually harder.

Another apprentice suggested leaving nothing behind and simply having the master recheck. That is clean, but it makes every step start from scratch, and tool results cannot be reused.

The master finally brought out a temporary wooden board. The current ship's measurements, doubts, tool results, and next-step plan were all written on it; after the repair, only the final conclusion and necessary evidence were copied into the formal archive.

The board is not a diary, nor a permanent archive. It allows erasing, circling, and temporary placement, but serves only the task at hand.

Once an apprentice wrote the dimensions of another ship onto this board and nearly cut the wrong material. The master immediately laid down a rule: each board belongs to only one task, and its source and time must be clearly marked.

From then on, the boatyard no longer relied on memory alone, nor did it stuff every intermediate scrap into the permanent records. The current task has its own work surface. The master said: complex work needs a place where you can make a mess. As long as the boundary is clear, temporary traces actually make the final result cleaner. Later the boatyard set a cleanup moment for each plank: when the task ends, wipe away the temporary traces and file only the reliable conclusions. The dirty place exists so the official archive does not get contaminated. The apprentices also learned that the writing on the plank cannot replace the final delivery. It helps people think, troubleshoot and stash findings temporarily; what truly answers to the shipowner is still the ship's file after acceptance. The desktop may be temporarily messy, but the delivery cannot be. The desktop may be temporarily messy, but the delivery cannot be; precisely because this plank exists, the official records stay clear.

Reveal

This story is about: the draft area

A scratchpad is a temporary workspace used by an Agent during the current task to record intermediate observations, calculations, plans, tool results and execution notes. It helps the Agent maintain task state, but usually should not enter long-term memory or user output without filtering. Enterprise systems need to manage the scratchpad's lifecycle, isolation scope, visibility and cleanup policy to avoid context contamination and sensitive information leakage.

What matters is that it is not just a term, but a structural problem that repeatedly appears in real AI / Agent systems. Understanding it lets you judge when to add a model, when to change a process, and when to add governance.

Metaphor mapping

  • Master's memory: no explicit temporary state
  • Official ship records: long-term memory or audit records
  • Temporary wooden board: Scratchpad
  • Measurements, doubts, tool results: intermediate states and observations
  • After repair, copy only the necessary conclusions: filtering into long-term records
  • One plank belongs to only one ship: task-level isolation
  • A place where you can get dirty: scratchpad allows temporary, mutable, imperfect information
  • Final insight: Scratchpad provides the Agent with a temporary workspace for the current task

Andy Ren Xu's judgment

The practical value of this concept is that it helps you break "AI features that look smart" into deliverable, verifiable, and governable units of work.

chain-of-thoughtworking memorycontext windowagent loopReAct

Related distinctions

This concept is easily confused with adjacent concepts; it is recommended to continue to the comparison page.

京ICP备2026014272号