Context Engineering
Definition
Context engineering is "the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference" — the broader discipline of managing all information that enters the model's attention across multiple turns, of which prompt engineering is one subset.
Key points
- Context engineering (verbatim): "the set of strategies for curating and maintaining the optimal set of tokens (information) during LLM inference."
- Prompt engineering (verbatim): "methods for writing and organizing LLM instructions for optimal outcomes." Prompt engineering is a subset of context engineering.
- Context = everything the model attends to: "system instructions, tools, Model Context Protocol (MCP), external data, message history, etc."
- As agents run over more turns, the question shifts from "what prompt do I write" to "what configuration of context is most likely to generate the model's desired behavior."
- Context is a finite resource with diminishing marginal returns: models have a limited "attention budget" drawn down by every token.
- Guiding principle: find "the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome" — keep context "informative, yet tight." Curate "a set of diverse, canonical examples" rather than "a laundry list of edge cases."
Why it matters for the exam
- The umbrella concept behind the whole context-management domain — the "why" behind curation, Just-in-Time Retrieval, Server-side Compaction, Structured Note-Taking, and subagents. Expect it as the framing for long-session and multi-agent design questions.
Common gotchas
- Prompt engineering ≠ context engineering — the former is writing instructions, the latter manages the whole token budget across turns. Don't treat them as synonyms.
- "More context is better" is wrong: the attention budget is finite, so adding tokens has diminishing (and eventually negative) returns via Context Rot.
See also
Sources
Referenced by
Practice questions optional · AI
Generate fresh practice questions about this concept with AI. These are not vault-verified.