Domain 5 · 15% of scored content
Context Management & Reliability
The smallest domain, and the one that decides whether a system survives contact with long sessions and real users. It covers what gets lost when context is summarised, when to hand a case to a human, how failure information travels between agents, and how a claim stays attached to its source. The recurring answer is structure: pull the facts that matter out of prose and carry them explicitly.
Manage conversation context to preserve critical information across long interactions
Progressive summarisation is lossy in a specific and dangerous way: it turns exact values into approximations. "$247.30 refunded on 14 March against order 88213" becomes "a refund was discussed", and the agent later contradicts what the customer was told.
The fix is to stop relying on the summary for those facts. Extract transactional details — amounts, dates, order numbers, statuses — into a persistent case facts block that is included in every prompt, outside the summarised history. For multi-issue sessions, keep that as its own structured layer.
Long inputs have a second problem: the lost-in-the-middle effect. Models handle the beginning and end of a long input reliably and drop findings from the middle. Put key findings summaries at the top of aggregated inputs and give the detail explicit section headers.
Tool results are the other context sink. An order lookup returning forty-plus fields when five are relevant will consume a large share of the window over a long conversation. Trim outputs to the relevant fields before they accumulate, and where subagents feed a context-constrained downstream agent, have them return structured key facts, citations and relevance scores rather than verbose content and reasoning chains. Whatever you send, send the complete conversation history each request — the API is stateless.
Know
- Progressive summarisation condenses numbers, dates and stated expectations into vague prose
- The lost-in-the-middle effect: beginnings and ends survive, middles get dropped
- Tool results accumulate tokens out of proportion to their relevance
- Complete conversation history must be passed in subsequent requests to maintain coherence
Be able to
- Extract transactional facts into a persistent case facts block included in every prompt
- Keep structured issue data in a separate context layer for multi-issue sessions
- Trim verbose tool outputs to relevant fields before they accumulate
- Place key findings at the start of aggregated inputs and use explicit section headers
- Require subagents to include metadata in structured outputs, and to return key facts rather than reasoning chains when the downstream budget is tight
Anti-patterns
- Trusting a summary to carry amounts and dates
- Feeding whole tool responses into context because trimming looks like premature optimisation
- Burying the most important findings in the middle of a long aggregated input
Design effective escalation and ambiguity resolution patterns
Three triggers justify escalation: the customer asked for a human, the policy has a gap or the request needs an exception, or the agent cannot make meaningful progress. Notice what is not on that list — difficulty by itself.
When a customer explicitly demands a human, hand over immediately rather than investigating first. When they are frustrated but the issue is squarely within the agent's capability, acknowledge the frustration and offer to resolve; escalate if they say again that they want a person.
Two popular escalation signals are unreliable. Sentiment does not correlate with case complexity — angry customers often have simple problems. Self-reported confidence is poorly calibrated, and an agent that is wrongly confident on hard cases will be wrongly confident about its confidence too.
Miscalibration usually means the decision boundary was never stated. Explicit escalation criteria with few-shot examples showing escalate-versus-resolve is the proportionate fix, before anyone builds a classifier.
Ambiguity has its own rule: when a tool returns multiple customer matches, ask for another identifier. Do not pick one heuristically.
Know
- Escalate on explicit customer request, policy gaps or exceptions, and inability to progress
- Honour an explicit request for a human immediately
- Sentiment and self-reported confidence are unreliable proxies for complexity
- Multiple matches call for clarification, not heuristic selection
Be able to
- Add explicit escalation criteria to the system prompt with few-shot escalate-versus-resolve examples
- Acknowledge frustration and offer resolution when the issue is within capability, escalating if the customer reiterates
- Escalate when policy is silent or ambiguous on the specific request
- Ask for additional identifiers when a tool returns multiple matches
Anti-patterns
- Routing on a self-reported confidence score
- Escalating on negative sentiment
- Training a classifier before trying explicit criteria
- Investigating first when the customer has already asked for a person
Implement error propagation strategies across multi-agent systems
When a subagent fails, what reaches the coordinator determines whether recovery is possible. Structured error context — failure type, the query that was attempted, any partial results, and plausible alternatives — lets the coordinator retry with a modified query, try another route, or proceed with partial coverage.
A generic status hides all of that. "Search unavailable" after exhausting internal retries tells the coordinator nothing it can act on.
Two anti-patterns are worse than a generic status. Catching a timeout and returning an empty result marked successful converts a failure into silently incomplete output. Propagating the exception to a top-level handler that kills the whole workflow throws away everything the other subagents completed.
Handle transient failures locally inside the subagent and propagate only what you could not resolve, along with what you attempted. And keep the distinction between an access failure and a valid empty result visible — they demand opposite responses. Where coverage ends up incomplete, annotate the synthesis output with which findings are well-supported and which topics have gaps.
Know
- Structured error context enables intelligent coordinator recovery
- Access failures and valid empty results are different things
- Generic error statuses hide context the coordinator needs
- Silently suppressing errors and terminating whole workflows are both anti-patterns
Be able to
- Return failure type, what was attempted, partial results and potential alternatives
- Distinguish access failures from valid empty results in reporting
- Recover locally from transient failures and propagate only unresolved ones
- Annotate synthesis output with coverage gaps where sources were unavailable
Anti-patterns
- Returning an empty result set marked successful after catching a timeout
- Terminating the entire workflow on one subagent failure
- Retrying internally with backoff and then reporting only a generic status
Manage context effectively in large codebase exploration
Extended exploration sessions degrade in a recognisable way. Answers turn inconsistent, and the agent starts describing "typical patterns" instead of the specific classes it found an hour ago. That is the signal that findings have fallen out of the window.
Scratchpad files are the counter. Have the agent record key findings as it goes and reference them for later questions, so the knowledge survives a context boundary. Summarise a phase before spawning the agents for the next one and inject that summary into their initial context.
Delegation is the other lever. Spawn subagents for specific questions — find all test files, trace refund flow dependencies — so the verbose output stays in their context while the main agent keeps the high-level picture.
For long-running systems, design crash recovery deliberately: each agent exports state to a known location, and the coordinator loads a manifest on resume and injects it into agent prompts. During interactive sessions, /compact reduces context filled with verbose discovery.
Know
- Context degradation shows up as inconsistent answers and generic "typical patterns" language
- Scratchpad files persist key findings across context boundaries
- Subagent delegation isolates verbose exploration output
- Structured state exports and a coordinator-loaded manifest give you crash recovery
Be able to
- Spawn subagents for specific investigative questions while the main agent coordinates
- Maintain scratchpad files of key findings and reference them later
- Summarise each exploration phase before spawning agents for the next
- Design crash recovery around manifests the coordinator loads on resume
- Use /compact during extended sessions filled with discovery output
Anti-patterns
- Continuing a degraded session because restarting feels wasteful
- Letting verbose exploration run in the main agent's context
- Keeping findings only in conversation history, where compaction will eventually eat them
Design human review workflows and confidence calibration
An aggregate accuracy figure can be a comfortable lie. 97% overall is consistent with 99% on the common document type and 70% on the one that matters, and the average hides it. Before you reduce human review, analyse accuracy by document type and by field, and confirm performance is consistent across every segment.
For ongoing measurement, sample. Stratified random sampling of high-confidence extractions measures the error rate in the population you stopped looking at, and catches novel error patterns as documents change.
Field-level confidence scores are useful once calibrated against a labelled validation set — uncalibrated, a confidence number is just another output. Calibrate, then set the review threshold from the calibration.
Route by risk: send low-confidence extractions and those from ambiguous or self-contradictory sources to human review first, so limited reviewer capacity lands where it changes outcomes.
Know
- Aggregate accuracy can mask poor performance on specific document types or fields
- Stratified random sampling measures error rates in high-confidence extractions and detects novel patterns
- Field-level confidence needs calibration against labelled validation data
- Validate by document type and field segment before automating
Be able to
- Sample high-confidence extractions on an ongoing basis rather than assuming stability
- Break accuracy down by document type and field before reducing review
- Have the model output field-level confidence, then calibrate thresholds on labelled data
- Route low-confidence and ambiguous-source extractions to human review first
Anti-patterns
- Automating on the strength of a single headline accuracy number
- Trusting uncalibrated confidence scores as a routing signal
- Reviewing a fixed percentage at random rather than prioritising by risk
Preserve information provenance and handle uncertainty in multi-source synthesis
Attribution dies at the summarisation step. Findings get compressed, the claim-source mapping is not carried through, and the final report asserts things it can no longer support. The fix is structural: require subagents to emit claim-source mappings — source URL, document name, relevant excerpt — and require the synthesis agent to preserve and merge them rather than regenerate prose.
Conflicting statistics from credible sources are not a problem to resolve by picking one. Annotate the conflict with attribution and keep both values with their original characterisation and methodological context. The document analysis agent's job is to surface the conflict explicitly; the coordinator decides how to reconcile it before synthesis.
Many apparent contradictions are just time. Require publication or data collection dates in structured outputs and a 2019 figure stops looking like a rebuttal of a 2024 one.
Finally, structure the report so a reader can tell established findings from contested ones — and render each content type in its natural form: financial data as tables, news as prose, technical findings as structured lists. Flattening everything into one format destroys information.
Know
- Source attribution is lost when findings are compressed without preserving claim-source mappings
- Synthesis agents must preserve and merge structured mappings, not re-summarise
- Conflicting credible sources should be annotated with attribution, not arbitrarily resolved
- Publication and collection dates prevent temporal differences reading as contradictions
Be able to
- Require subagents to output claim-source mappings with URLs, document names and excerpts
- Structure reports to separate well-established findings from contested ones, preserving methodological context
- Complete document analysis with conflicting values included and annotated, letting the coordinator reconcile
- Require publication or collection dates in structured outputs
- Render financial data as tables, news as prose, technical findings as lists
Anti-patterns
- Letting the synthesis step rewrite findings into prose that drops citations
- Picking the more recent or more convenient statistic when two credible sources disagree
- Converting every content type into one uniform format