Complete guide
Context engineering.
The discipline of deciding what an AI system knows at the moment it acts. Not a prompt trick, not a vector database purchase — an engineering practice with six moving parts, its own failure modes, and its own metrics.

The one-sentence definition
Context engineering is the practice of assembling, budgeting, and governing the information an AI system reasons over at the moment it acts. Prompt engineering asks how to phrase the request. Context engineering asks a harder question: of everything the organisation knows, which parts belong in this decision, in what form, with what provenance, at what cost?
The reason the discipline exists is a gap. A frontier model knows an enormous amount about the world and almost nothing about your business — your definitions, your customers, your last incident, your policy exceptions. That gap is not closed by a bigger model. It is closed by engineering.
The six parts of the discipline
Teams that treat context engineering as a single tool purchase stall within a quarter. In practice the work divides into six components, each with its own failure mode.
- Retrieval. Getting the right passages in front of the model: chunking strategy, hybrid keyword plus vector search, reranking, freshness, and source authority. Failure mode: high recall, low precision — the model drowns in near-misses.
- Memory. What persists across turns, sessions, and agents: short-term scratchpads, session state, durable profile and institutional memory. Failure mode: memory that accumulates without curation and becomes an unaudited liability.
- Compaction and budgeting. Summarising, trimming, and prioritising so the request fits the window and the cost line. Failure mode: compaction that silently drops the one constraint that mattered.
- Tools and protocols. How the agent reaches systems that hold live truth, increasingly through MCP rather than bespoke integrations. Failure mode: tool sprawl with no contract, so every platform migration is a rewrite.
- Evaluation. Golden sets, rubric scoring, regression gates in CI, and online monitoring. Failure mode: shipping on vibes, then discovering the regression from a customer.
- Governance. Lineage, permissions, retention, and the ability to explain why a given answer used a given source. Failure mode: a working system that legal cannot approve.
Context is not the context window
A larger window is more room, not more relevance. Once a request exceeds a few thousand well-chosen tokens, the binding constraint stops being capacity and becomes signal-to-noise. Long-context evaluations consistently show accuracy degrading when material is padded rather than curated, and cost and latency rise linearly with every token you send. The discipline is subtractive as often as it is additive.
What a context engineer actually does
The role looks less like prompt authoring and more like analytics engineering did a decade ago: define the units of meaning, make them testable, version them, own their freshness, and expose them through a contract other teams can rely on. A typical week involves a retrieval-quality regression, a token-budget negotiation with a product owner, a memory-retention policy review, and one eval that needs new golden cases.
The skills transfer directly from data engineering. If you can model a semantic layer, reason about lineage, and defend a cost per query, you already hold most of the foundation.
The four metrics worth tracking
- Grounding rate. What share of answers cite a retrievable, permitted source.
- Context precision. What share of the tokens you sent were actually used to reach the answer.
- Cost per correct answer. Not cost per call — the denominator has to be correctness, or you optimise yourself into confident nonsense.
- Time to correct context. How long it takes a new fact in the business to become available to the agent. This is the metric that compounds.
How to learn it in the right order
Start with retrieval mechanics, because everything downstream inherits their quality. Move to compaction and token budgets, so you can defend a cost line. Then memory, because that is where organisational advantage accumulates. Then tools and protocols, then evaluation, then governance. Teams that invert this order — starting with a multi-agent framework — spend most of their first year debugging seams.
The certification path now mirrors that order. The Databricks Certified Context Engineer Associate exam weights retrieval, context-window design, memory, tools, and governance, and our free practice exam follows the same blueprint.
Where to go next
- What is context engineering?The short definition, and how the role differs from prompt engineering.
- RAG vs context engineeringWhy retrieval is one component, not the whole discipline.
- 33 context engineering interview questionsWith model answers, mapped to the chapters that go deeper.
- Free Databricks Context Engineer Associate practice exam395 questions, three modes, no signup wall.
- Agentic AI glossary120+ terms, each mapped to a chapter.
The full discipline, in 36 chapters.
The Context Advantage covers context, control, cost, and choice end to end, with the retrieval, memory, and compaction mechanics in Chapters 4, 10 through 12, 21, 22, 35, and 36.