Agentic Context Budget

Definition. The allocation of the context window among instructions, tools, retrieved content, history and working state, so that no component crowds out another. Context budgeting is the practical discipline that keeps an agent coherent over a long run.

How it works. Reserve space for the system prompt and tool definitions first, since they are fixed. Allocate a share to retrieved content and a share to history, and cap each. Summarise history rather than letting it grow. Measure how often each allocation binds, since a frequently binding allocation indicates a design problem rather than a tuning problem.

Example. An agent's context fills with tool results by step four, and the original instructions are pushed out. Allocating a fixed 20 percent to instructions, capping tool results at 2,000 tokens each with summarisation, and summarising history beyond ten turns keeps the instructions present throughout. Task completion on long tasks rises from 52 to 81 percent.

Use case. Context budgeting is required for any agent that runs more than a few steps, and it is the main control on long-run coherence. It is also a cost control, since context size drives cost.

Warnings. Letting tool results grow unbounded pushes out the instructions, which is the most damaging failure. Never allocate without measuring which allocation binds. And never assume a large window removes the need for budgeting.

Limitations. Fixed allocations perform poorly across a mixed workload, and dynamic allocation is harder to tune. Summarisation is also lossy, so some information is lost by design.

← Browse all glossary terms