Context Engineering
Definition
Context engineering is the discipline of selecting, structuring, refreshing, and isolating the information available to a model at each decision. It governs instructions, repository or domain knowledge, examples, tool descriptions, retrieved records, and sub-agent handoffs as a budgeted system rather than a single prompt. OpenAI's coding harness describes supplying the right context at the right time, while Moody's isolates domain contexts to prevent cross-domain interference. OpenAI Moody's
Corpus Support
The analysis counts 83 deduplicated agentic systems (8.4%) across 13 industries. Evidence includes 40 article, 49 transcript, and 36 summary quotes; 124 are stated and 1 implied. Corpus analysis
Problem It Solves
Model behavior depends on what is visible now, yet production systems have more instructions, history, tools, examples, and data than can be supplied indiscriminately. Spotify makes repository conventions discoverable to coding agents, and Etsy curates attributes, examples, imagery, and taxonomy rules for extraction. Spotify Etsy
Applicability Signals
- Agents operate over a large repository or changing knowledge base. OpenAI
- Domain instructions must remain isolated across specialized agents. Moody's
- Tool catalogs, examples, and rules exceed a single prompt budget. Etsy
- Long-running work becomes unstable as irrelevant context accumulates. Andon Labs
Architecture and Variants
- Deferred context: keep instructions or data outside the prompt until the current step needs them. OpenAI
- Domain isolation: assign agents bounded financial contexts rather than sharing one undifferentiated prompt. Moody's
- Repository legibility: maintain discoverable conventions and examples that agents can locate. Spotify
- Human-authored transformation recipes: preserve migration knowledge as structured “cookbooks.” Mercedes-Benz
Why Teams Choose It
Teams use context engineering to improve decisions without defaulting to larger models or ever-longer prompts. It makes context provenance and ownership explicit, and lets specialized agents work with narrower information surfaces. OpenAI Moody's
Tradeoffs
- Curated context improves consistency but requires maintenance as code, tools, and policy change. OpenAI
- Strong domain isolation reduces interference but complicates cross-domain synthesis. Moody's
- More examples can improve extraction until they crowd out task data; Etsy chooses a curated set rather than unbounded demonstrations. Etsy
Gotchas and Resolutions
- Stale instructions silently steer agents toward obsolete behavior; prune and refresh context artifacts. OpenAI
- Long context can destabilize autonomous runs even when it fits the model window; Andon uses sliding windows and caching rather than treating capacity as quality. Andon Labs
- Inconsistent repository conventions make examples hard for agents to discover; Spotify standardizes local patterns. Spotify
When Not to Use It
Do not create a context platform for a small, stable, one-shot prompt whose required information is already explicit. Also do not use context engineering to hide missing authorization or memory semantics: selecting information is different from deciding whether it may be seen or how long it persists. OpenAI
Boundaries and Related Patterns
agent-memory persists and retrieves state; context engineering decides whether and how retrieved memory enters the current call. context-compaction is one reduction technique within the broader discipline. RAG supplies external evidence, while context engineering combines that evidence with instructions, tools, examples, and active state. Andon Labs
Operational Checklist
- Inventory every context source, owner, refresh trigger, and token cost. OpenAI
- Isolate domain and sub-agent contexts unless cross-domain information is required. Moody's
- Test context removal and staleness, not just context addition. Andon Labs
- Trace which context artifacts supported each important decision. Etsy
Representative Implementations
| Project | Industry | Implementation | Provenance | Source |
|---|---|---|---|---|
| OpenAI coding harness | Tech | Deferred, refreshed, and injected repository context. | source-backed | source |
| Moody's risk agents | Finance | Domain-bounded agent contexts. | source-backed | source |
| Spotify coding automation | Media & Entertainment | Discoverable monorepo conventions and examples. | source-backed | source |
| Andon long-running agents | Research & Academia | Sliding windows and prompt caching. | source-backed | source |
| Etsy attributes | E-commerce | Curated product evidence, examples, and taxonomy rules. | source-backed | source |
| Mercedes-Benz migration | Automotive | Human-authored transformation cookbooks. | source-backed | source |
Methodology and Limitations
This page synthesizes 83 deduplicated systems. The accepted term spans several practices, and public reports rarely isolate context changes experimentally; citations support recurring architecture choices, not a universal optimal context recipe. Corpus methodology