Context engineering is the craft of deciding what a model sees. A model has no memory of you and no access to your world beyond the text in front of it, so the quality of any answer is capped by the quality of the context you assemble. Prompt engineering is about wording a single request well. Context engineering is the larger job: getting the right information into the window at the right time, and keeping the wrong information out.
Why it is the real work
As models get better at following instructions, the bottleneck moves. The scarce skill is no longer clever phrasing, it is curation: which files, which examples, which history, which tools, in what order, inside a finite context window. Every technique in this dictionary is a move in that game.
The three moves
- Get the right stuff in. Retrieval, RAG, tool results, worked examples.
- Keep the wrong stuff out. Prune finished work, summarise old history, do not paste whole files. More context is not better context.
- Shape what remains. Order matters and format matters, and long windows degrade, so put what counts where the model actually attends (see lost in the middle).
Related terms
Retrieval-augmented generation (RAG)
RAG is the workhorse pattern of context engineering: retrieve the material relevant to a request, put it in the context, and let the model generate an answer grounded in it rather than guessing from memory.
Read definition →Agents vs. workflows
A workflow follows a path you designed in advance; an agent decides its own path at run time by calling tools in a loop toward a goal. Knowing which one you actually need is the first context-engineering decision.
Read definition →Lost in the middle
Lost in the middle is the tendency of models to use information at the start and end of a long context well, while missing what sits in the middle. It means a bigger context window does not automatically mean better recall.
Read definition →