AI Engineering Context
Scratchpad pattern
Using a synthetic assistant turn containing a JSON state object as working memory for an agentic loop. The model reads and updates the scratchpad each iteration, maintaining continuity across turns without relying on conversation history alone.