Glossary · term

Context Engineering

Context engineering is the practice of selecting, structuring, and maintaining the information available to a language model at inference time so that it can perform a task reliably. The context can include system instructions, user messages, retrieved documents, tool definitions and results, examples, memory, summaries, and current workflow state. The work is dynamic because the useful context may change at every step of an agent loop.

Agents2025-06-23Wave 1 · 2023Maturity: 3/5

Origin and context

In 2025, practitioners used the term to distinguish whole-context design from wording a prompt alone. LangChain described systems that provide the right information and tools in the right format, while Anthropic defined the problem as curating the tokens available during inference under a finite attention budget. A 2026 preprint proposes a more structured practitioner methodology, but its authors describe limited observational evidence rather than a settled standard.

Sources: s1, s2, s3

Why it matters

Model quality is only one determinant of application quality. An agent can fail because instructions conflict, retrieved material is stale, tool descriptions are ambiguous, history crowds out current evidence, or important state is missing. Context engineering treats those inputs as an operational system that can be measured and improved. It connects retrieval, memory, prompt design, compaction, tool ergonomics, permissions, and evaluation instead of optimizing each component in isolation.

Sources: s1, s2, s3

Example

A coding agent working in a large repository might begin with concise project instructions and file paths rather than loading every file. It searches for relevant symbols when needed, adds only the most useful code and test output, records durable decisions in structured notes, and compacts older dialogue before the context window fills. Evaluations can compare whether this policy improves task success without excessive tokens or stale state.

Sources: s1, s2

How it differs

Prompt engineering

Prompt engineering focuses on the instructions and examples used to elicit behavior. Context engineering includes prompt design but also governs retrieved evidence, message history, tool descriptions and results, memory, and the policy for adding or removing information over time.

Retrieval-Augmented Generation

RAG retrieves external evidence for a request. It is one context-supply mechanism. Context engineering additionally decides when retrieval occurs, how evidence competes with other inputs, what the model retains, and how the assembled context is evaluated.

Maturity and evidence

Maturity is rated 3. The term has clear definitions from multiple organizations and names a durable set of production practices, but its boundaries, measurements, and professional methodology remain fluid. The 2026 paper is useful formalization evidence, not proof of an established scientific consensus.

Sources: s1, s2, s3

Limits and open questions

More context is not automatically better. Irrelevant, duplicated, stale, or malicious inputs can dilute attention and change behavior. Summaries can erase details; retrieval can miss evidence; memory can preserve errors; and context policies can leak data across users. Teams need task-specific evaluations, provenance, access controls, token and latency budgets, and explicit rules for retention, compaction, and deletion. The field still lacks a universal context-quality metric.

Sources: s1, s2, s3

Related terms

References

Last updated: 2026-08-27

In the Skills Atlas

This term is also covered in the Skills Atlas as context engineering skill.

In the Skills Atlas

This term is also covered in the Skills Atlas as retrieval augmented generation skill.

In the Skills Atlas

This term is also covered in the Skills Atlas as prompt caching skill.