Mind · Memory
Scratchpad
Working memory for intermediate reasoning steps
Definition
Mechanism
A designated working memory region where the agent can write intermediate calculations, partial results, and notes-to-self during multi-step reasoning. Unlike the main output, scratchpad content is explicitly for the agent's own use and may be hidden from the final response. Prevents context pollution while enabling complex reasoning. It provides the persistence layer for chain-of-thought, storing the intermediate states of the reasoning process.
Invariants
- Bounded by `max_size`, which every scratchpad declares.
- Persistence: contents survive across reasoning steps within a task.
- Separation: scratchpad content is distinct from final output.
Risks
Failure modes
Scratchpad leak
internal working notes reach user-facing output.
Bound reached mid-reasoning
content must be dropped or summarised to continue, so earlier working is lost while the reasoning that depended on it continues.
Relationships
Root pattern: builds on nothing in this library.
Used by
References
Self-critique and retry after failure
Reference
Data schema
{
"type": "object",
"required": [
"content",
"max_size"
],
"properties": {
"content": {
"type": "string",
"description": "Working memory contents"
},
"max_size": {
"type": "integer",
"description": "Maximum allowed size in tokens"
},
"owner_id": {
"type": "string",
"description": "Agent that owns this scratchpad"
}
}
}