Saltar al contenido principal

Keep the agent scratchpad from breaking the cache

Separate stable agent definitions from volatile tool results and scratchpad content to preserve cache benefits.

prompt-caching5 min read

The growing transcript Your agent prompt grows after every tool call. Stable instructions are buried behind volatile observations. Every new observation can shift the prefix and erase the benefit of the stable agent definition. Agent cache rule Contract before state The agent contract changes by release; observed state changes by turn. Cache design should respect that difference. Full context easy to send, hard to reuse consistently Stable capability definitions can be reused while live state remains current. In agents, cache the durable contract and append the changing state. 01 Contract 02 Tools 03 State Node 1 The prompt starts with…

Read the full lesson

Sign up free: one personalized lesson every day, matched to your role and goals.

← Back to library

Contáctanos