← Build ExercisesDomain 5
Context Management & Reliability
6 build exercises to practice the concepts in this domain.
5.1Intermediate45 minutes
5.1 — Build a Persistent Case Facts Context Manager
What you will learn
- A case-facts block is carried verbatim so amounts, dates, and ids survive summarisation.
- Trim tool results to the fields you will need before they pile up.
- Repeated summaries drop numbers, dates, and identifiers.
- Put the key findings at the start of a long aggregated input.
- The API is stateless. Every request must include the history it needs.
5.2Intermediate40 minutes
5.2 — Build an Escalation Decision Engine
What you will learn
- Escalate when the customer asks for a person, when policy has a gap, or when the agent cannot proceed.
- Do not escalate on tone, or on the model's own confidence score.
- A frustrated customer with a resolvable issue is not the same as an explicit request for a human.
- Several matching customers means ask for another identifier, not pick one.
- Put the escalation criteria, with a few examples, in the system prompt before you add machinery.
5.3Advanced50 minutes
5.3 — Build a Structured Error Propagation System
What you will learn
- An upstream error names the failure type, what was tried, partial results, and other approaches.
- A timeout is not the same event as a successful query with no rows.
- Do not swallow the error, and do not abort the whole workflow for a local failure.
- Retry a transient failure locally before you tell the coordinator.
- The synthesis should say which parts of the question are uncovered.
5.4Advanced60 minutes
5.4 — Build a Context-Resilient Codebase Explorer
What you will learn
- Degradation is an attention problem. Raising the token limit does not restore specificity.
- A scratchpad file keeps findings outside the conversation.
- A subagent is a fresh context, not only a way to run work in parallel.
- A state manifest lets a crashed run continue.
- Inject a summary between phases so the next phase does not rediscover the repo.
5.5Advanced50 minutes
5.5 — Build a Confidence-Calibrated Review Router
What you will learn
- A 97% overall accuracy can hide a 40% error rate on one document type.
- Track accuracy by document type and by field.
- Calibrate raw confidence on a labelled set before you trust a threshold.
- Sample high-confidence items too, not only the ones the model doubted.
- Spend a limited review queue on the least certain items first.
5.6Advanced60 minutes
5.6 — Build a Provenance-Preserving Synthesis Pipeline
What you will learn
- A claim mapping carries the claim, source URL, document name, excerpt, and publication date.
- Those fields have to survive every later summary.
- When sources disagree, keep both values and say where each came from.
- Dates tell a trend apart from a contradiction.
- Render financial comparisons as a table, news as prose, and technical findings as a list.