Context engineering is the discipline of deciding what information gets passed to a language model, in what form, and at what point. Where prompt engineering focuses on the wording of a single instruction, context engineering governs the entire information environment the model reasons within.
Why the distinction matters
A language model cannot fetch information it was not given. Its output is bounded by what sits inside its context window at inference time. If that window contains the wrong data, stale data, or too much noise, the model's response suffers regardless of how carefully the prompt is worded.
Context engineering treats that window as a managed resource. The question is not only 'what should I ask?' but 'what should the model know, and how should that knowledge be arranged?'
What context engineering actually involves
In practice it covers several related decisions:
- Selection. Which documents, records, tool outputs, or memory traces are relevant to this request? Retrieval pipelines, including RAG, are one mechanism for answering that question at runtime.
- Structure. How should information be ordered and formatted? Models attend differently to content depending on its position and presentation. Putting critical constraints at the end of a long context is a known source of failure.
- Compression. Context windows are finite and inference costs scale with token count. Summarisation, chunking strategy, and filtering all affect how much useful information fits.
- Freshness. Static context becomes stale. Systems that inject live data, user state, or recent tool results require logic to manage what gets refreshed and when.
- Role separation. In multi-turn or agentic systems, distinguishing system instructions, user input, tool responses, and prior model output matters for how the model interprets each.
Relationship to prompt engineering
Prompt engineering remains relevant: the wording of an instruction still shapes what the model does with the information it receives. But prompt engineering addresses perhaps 10 to 20 percent of the levers available. Context engineering addresses the rest. The two are not in competition; context engineering is the broader frame within which prompt engineering operates.
Where it shows up in production systems
Context engineering decisions are embedded in most non-trivial AI-assisted applications:
- A coding agent that pulls relevant files, test results, and error logs before asking a model to propose a fix is doing context engineering.
- A customer-facing assistant that retrieves account history and policy documents before generating a response is doing context engineering.
- A document processing pipeline that decides which sections of a contract to pass to a model, and in what order, is doing context engineering.
In agentic systems, where models take sequences of actions and the context grows with each step, the engineering problem becomes more complex. Decisions about what to retain, what to summarise, and what to discard directly affect whether the agent remains coherent over a long task.
Common failure modes
Poor context engineering tends to produce one of a few recognisable problems: the model ignores a constraint because it was buried in irrelevant material; it hallucinates a fact that was retrievable but not retrieved; it contradicts earlier instructions because the context window was not managed across turns; or it performs well in testing and poorly in production because the test context was cleaner than real data.
These failures are often misattributed to the model itself. In many cases the model is behaving consistently with what it was given.
What we test for
Context engineering judgement is assessed directly during our technical vetting. In the AI-native assessment, candidates are scored on prompt and context engineering as a named criterion: whether they set up the prompt and task context so the tool produces usable output in one or two passes. We also look at spec-driven development and AI output verification, both of which depend on the same underlying skill of deciding what information the model needs and when. The full scorecard and session structure are described at how we vet.
Short answers
Is context engineering the same as RAG?
No. RAG is one technique for populating context at runtime by retrieving relevant documents. Context engineering is the broader discipline of deciding what goes into the context window, in what form, and in what order. RAG is a tool within that practice.
Do you need to understand context engineering to use AI coding tools?
For basic use, no. For production systems where reliability matters, yes. Engineers who understand context engineering make better decisions about what information to surface to a model and why outputs fail when they do.
How does context engineering differ from fine-tuning?
Fine-tuning changes the model's weights to embed knowledge or behaviour. Context engineering supplies information at inference time without changing the model. The two are complementary, but context engineering is cheaper to iterate and does not require retraining.