What is context engineering?
Context engineering is the discipline of deciding what information occupies a model''s context window on each call: instructions, retrieved documents, prior turns, tool definitions, examples and state. It replaces prompt engineering as the central craft once systems become multi-step, because the limiting factor stops being the wording of one instruction and becomes the selection, compression and ordering of everything the model sees.
Practitioners budget the window explicitly: a stable cached system prefix, a compacted conversation summary, only the retrieved passages that survived re-ranking, and only the tools relevant to the current step. Older material is summarised or written to external memory and retrieved when needed. The aim is to keep the signal-to-noise ratio high, because long contexts degrade attention to any single fact and increase cost linearly.
An agent that has run 40 steps replaces its raw transcript with a structured state object — goal, decisions made, open questions, last three observations — cutting tokens by 90% while improving step accuracy.
Context design now determines accuracy, latency and cost simultaneously. Teams that measure it treat the window as a scarce resource with an explicit budget, rather than appending everything and hoping a larger window solves it.
- That a million-token window removes the need to choose. Retrieval accuracy within long contexts still degrades.
- That more examples always help. Beyond a handful, examples often crowd out task-relevant evidence.
- Published long-context evaluations use synthetic needle-in-haystack tasks that overstate practical recall.
- Behaviour is model-specific and changes between versions.
