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

  1. Bounded by `max_size`, which every scratchpad declares.
  2. Persistence: contents survive across reasoning steps within a task.
  3. Separation: scratchpad content is distinct from final output.

Risks

Failure modes

  1. Scratchpad leak

    internal working notes reach user-facing output.

  2. 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

Reflexion

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"
    }
  }
}

Identity

Ref
Scratchpad#626c
Sema ID
sema:Scratchpad#mh:SHA-256:626c5a0a716ab29b51e68429d41e99619201af48d17975d89636b55b8dc852f5
Ring
0
Tier
2
Updated
2026-11-11
Supersedes
  • sema:Scratchpad#mh:SHA-256:e805c332532cf4a435c48cc87d4db771e1645bb52c47d00dce318e2619ca6749