2026-06-09
Splitting the Context Window in AI SDK
AI SDK lets a tool's execute be an async generator. Each yield is a preliminary result streamed to the UI, and only the last one is written back to the agent's memory. I explore how these preliminary tools - in an orchestrator-worker style - split the context window, save tokens, and make cache hits almost certain.