# Context Budget A context budget is the deliberate allocation of a model's finite [[Context Window]] across the different types of context it needs: instructions, knowledge, memory, tools, tool results, and the user query. It frames [[Context Engineering]] as an optimization problem with a hard constraint (|C| ≤ L_max). ## Why budgets matter The [[Context Window]] is finite. Everything competes for the same token space. Without a budget, context grows until it either hits the window limit or degrades output quality through [[Context Distraction]] and [[Context Entropy]]. The key insight from [[AI context is finite with diminishing returns]]: past a certain point, more context actively hurts. A budget forces you to decide what earns its place. ## Budget allocation A practical budget divides the context window across components: | Component | Purpose | Budget tension | |---|---|---| | **Instructions** | Rules, behavior, constraints | Stable but grows with scope | | **Knowledge** | Domain facts, documentation | Largest consumer; needs pruning | | **Memory** | Past interactions, learned patterns | Grows unboundedly without limits | | **Tools** | Tool definitions, MCP schemas | Fixed per tool set | | **Tool results** | Dynamic data from tool calls | Unpredictable; can spike | | **Query** | The actual user request | Usually small | | **Conversation** | Prior turns in the exchange | Grows linearly with conversation | ## Budget strategies - **[[Progressive Disclosure]]**: load only what's needed now; defer the rest - **[[Prompt Lazy Loading AI Design Pattern (PLL)|Lazy loading]]**: let the agent pull context on demand rather than front-loading everything - **Compression**: summarize older context to free space for fresh information - **Tiered priority**: define what gets cut first when the budget is tight (usually conversation history, then tool results, then knowledge) - **Hard caps per component**: set maximum token allocations per context type to prevent any single component from starving the others ## Connection to PCM/TCM/ECM At the [[Personal Context Management (PCM)]] level, budget management is about curating what your AI knows about you. At [[Team Context Management (TCM)]] and [[Enterprise Context Management (ECM)]] levels, it becomes a governance question: who decides what gets budget priority across shared context? ## References - ## Related - [[Context Window]] - [[Token Budget]] - [[Context Engineering]] - [[AI context is finite with diminishing returns]] - [[Context Distraction]] - [[Context Entropy]] - [[Context Bloat]] - [[Progressive Disclosure]] - [[Prompt Lazy Loading AI Design Pattern (PLL)]] - [[Context Signal-to-Noise Ratio]] - [[Context Compression]] - [[Personal Context Management (PCM)]] - [[Natural tension between compression and context]]