CertSafari
    Databricks Certified Context Engineer Associate· Lessons

    Domain 7 · Lesson 43/45

    Sub-agent output design for orchestrator context saturation

    Given a multi-agent Databricks workflow where the orchestrating agent is experiencing context saturation, identify the sub-agent output design change that would most reduce orchestrator context load without compromising task coherence.

    16 min read
    2.17% of exam
    6 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Explain why each sub-agent response adds to the orchestrator's context and keeps adding to it on every turn
    • Choose the sub-agent output change that most reduces orchestrator context load while keeping the result, key decisions, key figures and citations
    • Rule out fixes that fail: a bigger context window, attaching full transcripts, paraphrased echoes, and summaries trimmed so far that coherence breaks
    • Design a structured output schema that fixes the shape and size of what each sub-agent returns

    Key concept

    Conclusions, not evidence — A sub-agent returns a short conclusion to the orchestrator. That conclusion holds the result, the key decisions and figures behind it, and pointers to where the full evidence is stored. The transcript and raw data stay outside the orchestrator's context and can be fetched if they are ever needed.

    1.Why sub-agent responses fill the orchestrator's context

    Multi-agent systems on Databricks are built so that specialist agents work in separate contexts and the orchestrator does not have to hold everything. A Genie Agent queries tables, a knowledge assistant searches documents, a code agent writes and runs code, and the orchestrator decides what happens next. This only works if the orchestrator's own context stays readable. When it fills up, routing gets worse, earlier decisions are lost, and planning slows down. That is the situation this lesson addresses: the orchestrator is saturated, and the fix has to come from changing what sub-agents send back.

    Sub-agent output becomes orchestrator input. The Databricks multi-agent orchestrator registers each sub-agent as a tool. Whatever the sub-agent returns lands in the orchestrator's context exactly like any other tool result, and it stays there for every later turn. Each sub-agent call therefore adds context that the orchestrator keeps paying for until something removes it.

    Three habits in sub-agent output cause most of the bloat:

    • Internal transcripts. The sub-agent sends back every tool call it made, every intermediate result and every reasoning step, when the orchestrator only needed the outcome.
    • Raw data. A Genie sub-agent returns thousands of query rows when the business question had a three-number answer.
    • Echoes. The sub-agent opens each reply by restating the orchestrator's task instructions and the earlier conversation, which the orchestrator already has.

    Each habit adds tokens that carry no new information for the orchestrator. Because the orchestrator calls sub-agents repeatedly, the waste grows with every turn.

    Checkpoint 1 of 8· Check yourself

    A Databricks orchestrator routes requests to a Genie sub-agent, a knowledge assistant and a code agent. After many turns it routes poorly and loses track of earlier decisions. Which change addresses the cause of the saturation?

    Sources12

    2.Return conclusions and pointers, not evidence

    The change that most reduces orchestrator load is a concise return: the final result, the key decisions behind it, the key figures, and citations or pointers to the supporting evidence. Everything else stays where the sub-agent produced it. The orchestrator needs enough to decide its next step and to stay consistent with what has already been settled. It does not need to re-read how the sub-agent got there.

    Coherence holds because the parts the orchestrator relies on are kept. Dropping decisions breaks coherence: a code-generation sub-agent that chose a schema version or rejected an approach has to report that choice, or the next sub-agent may contradict it. Dropping figures also breaks coherence: a Genie sub-agent answering "how did Q3 revenue compare across regions" has to return the regional totals and the source table, not just "query succeeded". What can safely go is the work behind those conclusions: repeated tool calls, rows that were aggregated away, and abandoned lines of reasoning.

    Pointers mean the evidence is put aside, not deleted. On Databricks, a sub-agent's full interaction can live in an agent session store. That store keeps the ordered transcript of messages, tool calls and results, and can rebuild the full context on request. Its items cannot be changed once written, so a pointer still leads to the same content later. MLflow Tracing also records each agent's LLM and tool calls per turn. A sub-agent can return a session_id, a trace reference or the name of the Unity Catalog table it queried. The orchestrator, or a reviewer, follows that pointer only when the conclusion needs checking. For when this external state is required, see Delta-backed and external state.

    Bloated sub-agent returns and their replacements
    What the sub-agent returns nowWhat it should returnWhat stays out of the orchestrator's context
    Complete internal tool-call transcriptFinal result plus the key decisions takenIntermediate tool calls and reasoning, kept in the session or trace
    Genie Agent's full row-level result setSynthesized answer with key figures and the source table citedThe raw rows, still queryable from the Unity Catalog table
    Restated instructions and prior history, then the resultOnly the new information and resultsContent the orchestrator already holds in its own session

    Every tempting alternative fails in one of two ways: it leaves the bloat in place, or it removes the wrong thing.

    • A larger orchestrator context window delays saturation without fixing it. Responses keep piling up, and a model with a longer context does not attend better to transcripts it never needed.
    • Attaching the full transcript to every response, or routing every sub-agent tool call through the orchestrator for logging, puts even more evidence into the orchestrator's context. Logging is the job of tracing, which already records each agent's calls outside any agent's context.
    • Summarizing the orchestrator's original instructions shrinks the wrong thing. Those instructions are what keeps the orchestrator on task.
    • Returning only a row count saves the most tokens, but the orchestrator loses the figures and citations it needs to answer the question, so coherence breaks.
    • Keeping the raw rows but stripping the reasoning removes the smaller part of the problem, because the rows are the bulk.
    • Returning only the reasoning and letting the orchestrator re-run the query repeats work and brings the rows straight back into the orchestrator's context.
    • Sending the rows as a compressed CSV attachment still gives the orchestrator raw evidence to read. A different file format does not make it a conclusion.

    Checkpoint 2 of 8· Match them up

    A sub-agent is redesigned to return only its conclusion plus pointers. For each kind of evidence it no longer sends to the orchestrator, match where that content now lives.

    Tap a term, then the definition that fits it.

    Checkpoint 3 of 8· Exam question

    In a Databricks multi-agent workflow, an orchestrator routes tasks to several specialized sub-agents (for example, a data-retrieval agent and a code-generation agent). Over many turns, the orchestrator's context window fills up because each sub-agent response includes its complete internal tool-call transcript. Which sub-agent output design change would most reduce the orchestrator's context load without compromising task coherence?

    Checkpoint 4 of 8· Exam question

    A Genie-based data-analysis sub-agent, when asked a business question by the orchestrator, returns the full raw query result set of thousands of rows along with its complete step-by-step reasoning trace. This is filling the orchestrator's context and slowing downstream planning. Which output change best addresses this while preserving task coherence?

    Sources34

    3.Return only new information, not echoes

    A sub-agent should return only what the orchestrator does not already have. Some sub-agents open every response by restating the orchestrator's task instructions and the conversation so far, usually because a prompt template asks them to "confirm understanding" or "provide full context". In a long-running workflow that repeats the same content on every turn. The orchestrator's context grows each time, and none of the growth is new information.

    The orchestrator already keeps its own history. A session holds the record of one interaction: it grows as that interaction runs and is complete on its own. When a sub-agent copies part of that record back into a response, the orchestrator ends up holding two copies of the same content.

    The near-miss fixes fail for specific reasons. A shorter paraphrase of the instructions on each turn still repeats content the orchestrator has. It makes each echo smaller but keeps adding one on every turn, so context still grows linearly. Having the orchestrator discard its oldest turns after each response is not a change to sub-agent output. It also throws away the orchestrator's own decisions while the echoes keep coming. Sending the full history as a compressed file each turn moves the duplicate somewhere else without removing it. Having the orchestrator forward its instructions back for confirmation adds a second copy going the other way. Removing the echo from the output template removes the cause. Clearing tool results that have already been used is a separate technique, covered in clearing raw tool outputs.

    Checkpoint 5 of 8· Check yourself

    Over a 30-turn workflow, an orchestrator's context keeps growing. Each sub-agent reply starts by restating the orchestrator's task instructions and the conversation so far, because the sub-agent's template asks it to "provide full context". Which change removes the cause without hurting coherence?

    Checkpoint 6 of 8· Exam question

    In a long-running multi-agent workflow, a sub-agent restates the orchestrator's full original task instructions and prior conversation history at the start of every response it sends back. Over many turns this steadily saturates the orchestrator's context. Which change to the sub-agent's output design would most reduce this without harming task coherence?

    Sources5

    4.Structured outputs fix the shape and size of each return

    Asking a sub-agent in plain language to "be concise" is a request. An output schema enforces it. If each sub-agent must return a fixed structure, the orchestrator always knows what will arrive and how large it can be. One returned transcript can no longer fill the context, and a missing decision shows up as a missing field instead of a silent gap.

    A practical schema for sub-agent results usually has these fields:

    • result: the answer to the delegated task, with a length limit.
    • decisions: the choices the sub-agent made that later steps must respect. Make this field required, because coherence depends on it.
    • key_figures: the specific numbers or values the answer rests on.
    • evidence_refs: pointers such as a session ID, trace reference or Unity Catalog table name. These replace inline evidence.
    • open_issues: anything unresolved that the orchestrator must handle.

    Two things are deliberately missing: a free-text transcript field and a raw-data field. If a schema leaves room for a full transcript, a sub-agent will eventually fill it.

    A schema can also be too strict. If it allows only a status and a count, it repeats the row-count mistake in a more official form. The orchestrator gets no figures or decisions to combine into an answer. Size each field to what the orchestrator's next decision needs, not to the smallest possible token count. The orchestrator's job is to manage delegation and combine results into a final answer, and a structured return gives it consistent parts to combine. A schema limits how much each handoff carries. Deciding where the handoffs fall in the first place is agent boundary placement.

    Checkpoint 7 of 8· Check yourself

    A team stops asking its sub-agents to "be concise" and enforces an output schema instead. Which schema cuts the orchestrator's context load and still lets it combine sub-agent results into a coherent final answer?

    Sources6

    5.Check that orchestrator context load actually dropped

    Check the effect in traces rather than guessing. MLflow Tracing records multi-agent runs, including which agent was called on each turn, the messages passed between agents, and each agent's LLM and tool calls. Token usage is recorded on each span and as a total on the trace. Compare the orchestrator's input tokens before and after a sub-agent's output design changes. If they fall and task success on the same evaluation set stays the same, the new return is doing its job.

    Reading total and per-span token usage from an MLflow tracepython
    last_trace_id = mlflow.get_last_active_trace_id()
    trace = mlflow.get_trace(trace_id=last_trace_id)
    
    total = trace.info.token_usage
    print("Input:", total["input_tokens"], "Output:", total["output_tokens"], "Total:", total["total_tokens"])
    
    for span in trace.data.spans:
        usage = span.get_attribute("mlflow.chat.tokenUsage")
        if usage:
            print(span.name, usage)

    Per-span output shows where the load comes from. If the orchestrator's input tokens rise sharply right after calls to one sub-agent, that sub-agent's return is the one to restructure. The same trace also shows what was removed from the orchestrator's context: the sub-agent's internal tool calls are still recorded on its own spans.

    Checkpoint 8 of 8· Fill the gap

    After restructuring a sub-agent's return, you want to find which sub-agent's calls still push up the orchestrator's input tokens. That needs usage per span, not only the trace total. Which attribute name completes the loop?

    last_trace_id = mlflow.get_last_active_trace_id()
    trace = mlflow.get_trace(trace_id=last_trace_id)
    
    total = trace.info.token_usage
    print("Input:", total["input_tokens"], "Output:", total["output_tokens"], "Total:", total["total_tokens"])
    
    for span in trace.data.spans:
        usage = span.get_attribute(" ? ")
        if usage:
            print(span.name, usage)

    Sources4

    Sources

    (6)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “The orchestrator treats each subagent as a tool and uses its instructions to route requests to the right one.”
      ↩︎ Why sub-agent responses fill the orchestrator's context
      “The orchestrator treats each subagent as a tool and uses its instructions to route requests to the right one.”
      ↩︎ Key concept
      “Each entry automatically becomes a tool that the orchestrator can call.”
      ↩︎ Exam trap 1
      “Each entry automatically becomes a tool that the orchestrator can call.”
      ↩︎ Prediction
    2. 3.
      “Reconstruct full context (including tool calls and reasoning) on a follow-up message.”
      ↩︎ Return conclusions and pointers, not evidence
      “Items are immutable after they are appended.”
      ↩︎ Return conclusions and pointers, not evidence
      “the conversation history, the ordered transcript of messages, tool calls, and results that an agent reads at the start of a turn”
      ↩︎ Checkpoint
    3. 4.
      “LLM and tool calls made by each agent, organized per an agent and a turn”
      ↩︎ Return conclusions and pointers, not evidence
      “total usage appears in the trace info”
      ↩︎ Check that orchestrator context load actually dropped
      “LLM and tool calls made by each agent, organized per an agent and a turn”
      ↩︎ Exam trap 2
    4. 5.
      “A session grows within the interaction and is complete on its own.”
      ↩︎ Return only new information, not echoes
      “A session grows within the interaction and is complete on its own.”
      ↩︎ Exam trap 3
    5. 6.
      “manage agent interactions, task delegation, and result synthesis to deliver comprehensive solutions”
      ↩︎ Structured outputs fix the shape and size of each return
      “manage agent interactions, task delegation, and result synthesis to deliver comprehensive solutions”
      ↩︎ Exam trap 4

    Ready to test yourself?

    Practise Databricks Certified Context Engineer Associate in quiz mode.

    Spotted a mistake, or was something unclear? Tell us.