What Context Engineering Is | Context and the Stack
Databricks Context Engineer Associate · Lesson 1 of 18 · 3:48
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Databricks Certified Context Engineer Associate exam. In this lesson: what context engineering is and how it differs from prompt engineering, the four kinds of context that compete for the window (instructions, retrieved knowledge, memory, and tools), the Databricks stack (Unity Catalog, AI Search, Genie Agents, Lakebase, MCP, and MLflow), and context as an attention budget. Includes three original practice questions.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
A capable agent that knows nothing
Thistledown Properties rents apartments in several cities, and its new support agent answers tenants around the clock. The model behind it writes fluent answers, but it quotes a pet policy that changed last year, and it ignores the tenant's own lease. This lesson explains what context engineering is, what enters an agent's context, which Databricks product handles each part, and why context is a limited budget.
What context engineering is
Context engineering is the discipline of designing, assembling, and governing the information that an agent receives at inference time. A large model already knows how to reason, but it does not know your business, your data, or your rules. Prompt engineering polishes the wording of one request, while context engineering designs the whole information environment, across many requests, and over time. Its goal is the smallest set of high signal tokens that makes the right answer likely. So for every turn, the context engineer asks one question: what does the agent need to know right now, and what should stay out?
What enters the context
Four kinds of information compete for the context window. First, the system prompt and instructions, which set the agent's role, rules, and output format. Second, retrieved knowledge, like lease clauses or building rules found at inference time. Third, memory and state: the current conversation, and durable facts from earlier sessions. Fourth, tools: their descriptions, and the results they return.
The Databricks stack
Each part has a home on Databricks. Unity Catalog governs what may enter the context: table and column descriptions, tags, certification, permissions, and even functions and skills that agents can use. Lakebase, the managed Postgres database, stores agent state and memory, like session history and long term facts. MCP, the Model Context Protocol, connects the agent to tools and data sources in a standard way. And MLflow three logs traces, and evaluates and compares context configurations, so that every change is measured.
The attention budget
Context is a finite resource with diminishing returns: a model has an attention budget, and every token it reads draws on that budget. As the context grows, the model recalls facts less precisely, a slow decline often called context rot, long before the hard limit of the window. So the question is not only what fits, but what earns its place. Typical budget hogs are tool schemas the agent never calls, raw tool results from long ago, long lists of edge cases, and documents retrieved just in case. Removing them often improves focus more than adding instructions.
Recap
Let's recap. Context engineering designs the information an agent receives at inference time, across many requests. Instructions, retrieved knowledge, memory, and tools compete for the same window. Unity Catalog governs, Lakebase remembers, MCP connects, and MLflow measures. Context is an attention budget, and quality declines long before the window is full. And the best context is the smallest set of high signal tokens.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Thistledown’s team rewords the prompt again and again, but the agent still ignores each tenant’s lease. What is the team missing?
- A larger and more capable model
- The tenant’s lease in the context at inference time
- A longer system prompt with more rules
- A friendlier tone in the instructions
Show the answer
The tenant’s lease in the context at inference time
The agent needs the right information at inference time, here the tenant's own lease, and that is context engineering, not wording. “A larger and more capable model” is wrong, since a larger model still has no access to the lease. “A longer system prompt with more rules” is wrong, since a longer prompt adds tokens, not the missing lease. And “A friendlier tone in the instructions” would only change the tone, not what the agent knows.
The agent must remember that a tenant prefers text messages, and recall it next month. Which product should store it?
- MLflow 3
- MCP
- A Unity Catalog column description
- Lakebase
Show the answer
Lakebase
Lakebase stores agent memory that persists across sessions, like a tenant's preferences. “MLflow 3” is wrong, since MLflow logs traces and evaluations, not the memory an agent reads. “MCP” is wrong, since MCP connects tools, and does not store anything by itself. And “A Unity Catalog column description” is wrong, since a column description documents data, it is not a memory for one tenant.
The agent loads 60 tool schemas on every turn, but its traces show it calls only 4. Its answers are getting vague. What should change first?
- Give the agent only the tools its task needs
- Add instructions on choosing tools
- Move to a model with a larger window
- Remove the four tools it calls
Show the answer
Give the agent only the tools its task needs
The fifty six unused schemas consume attention on every turn, so give the agent only the tools its task needs. “Add instructions on choosing tools” is wrong, since more instructions add tokens, and the unused schemas still compete for attention. “Move to a model with a larger window” is wrong, since a larger window does not stop the model from spreading its attention. And “Remove the four tools it calls” would remove the four tools the agent actually uses.