Context engineering
Definition
Deciding what information, tools and history a model sees at each step, and what to leave out, to get the result you want.
In more detail
The term widens prompt engineering to everything in the context window, which matters most for agents whose context grows with every step. Techniques include short always-on instructions, retrieving only relevant passages, loading skills on demand, compacting old history and delegating to subagents.
Related terms
Compaction
Summarising earlier parts of a long conversation and replacing them with the summary to free context space for the work still to do.
Context rot
The gradual decline in a model's accuracy and instruction-following as its context fills up with long, stale or irrelevant content.
Context window
The maximum number of tokens a model can consider in one request, covering both the input you send and the output it writes.
llms.txt
A proposed Markdown file at a website's root that summarises the site and links to its key documentation pages for language models.
Progressive disclosure
Loading only skill names and descriptions up front, and the full instructions or bundled files only when a task needs them.
Agent harness
The software around a model that turns it into an agent: the loop, tools, prompts, context management, permissions and limits.
Read more about Context engineering
- What is context engineering?
Context engineering is deciding what a model sees at each step. Why the term replaced prompt engineering for people building agents, and what the work involves.
- Context engineering techniques: what the model should see
What to put in a model's context at each step, what to leave out, and how instruction files, retrieval and tools fit.
- Context engineering
Deciding what instructions, documents, tools and history a model sees at each step.