Chapter 6 of 7 · Databricks Context Engineer Associate
Context Compression and Compaction
What compaction keeps or drops, prompt tuning, trimming and trade-offs.
- 2topics
- 11 minfast track
- 1diagrams and exhibits
- 11%of the exam
Topics in this chapter
Take them in order, or jump to the one you need.
- 1What Compaction Must Keep and What It Can DropContext Engineer exam: which information a compaction summary must keep, what is safe to drop from a trace, and how to fix a…Diagram6 min
- 2Tuning Compaction, Trimming and the Cost Trade-OffContext Engineer exam: tune a compaction prompt recall first, decide if trimming heuristics are enough, and weigh aggressive…5 min
About this chapter
What this chapter covers
Context Compression and Compaction is 11% of the Databricks Context Engineer Associate exam. It covers how a long-running agent keeps working when its history no longer fits comfortably in the context window.
The chapter has two parts. The first is what a compaction must keep and what it can safely drop, including how to spot the category of information a bad compaction threw away. The second is how to tune a compaction prompt, when simple trimming is enough, and how aggressive or conservative a compaction should be.
Questions are single-answer and multiple-selection ("Which TWO ...?") questions, almost all scenarios that describe an agent, a trace, a configuration or MLflow evaluation results and ask for the diagnosis or the remediation that meets a stated constraint. There are no exhibits.
How the topics fit together
When a trace grows, you first decide whether a rule-based trim is enough or whether the history needs a model-written summary. If it needs a summary, the compaction prompt decides what survives, and evaluation on real traces tells you whether the result is both cheap and coherent.
- Diagnosis questions describe a compacted agent that now contradicts itself and ask which category of information was lost.
- Safe removal questions show a trace and ask which content can go without breaking later steps.
- Tuning questions ask how to iterate a compaction prompt, recall first and precision second.
- Method questions ask whether trimming heuristics fit the task's relevance pattern.
- Trade-off questions weigh aggressive compaction against conservative compaction for a stated goal.
Look for the downstream symptom first. Contradicting an earlier decision, repeating a rejected approach and ignoring a user exclusion each point to a different category the compaction dropped, and the right fix restores only that category.
How to use these pages
Each topic page has the same shape, so you can skim for what you need.
- What it is: the idea in plain words.
- How it works: the mechanism, with tables and examples.
- What to remember for the exam: the facts to memorize and how questions are phrased.
- Common mistakes: the classic traps.
- Check yourself: three questions to test your understanding.
Ready for more practice?
The full Databricks Context Engineer Associate question bank has 600 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Databricks. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.