CertSafari
    Databricks Certified Context Engineer Associate· Lessons

    Domain 7 · Lesson 43/45

    Reducing Orchestrator Context Load with Sub-Agent Output Design

    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.

    14 min read
    2.17% of exam
    8 sources
    Published 3 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Explain why every sub-agent reply adds to the orchestrator's context in a Databricks multi-agent system
    • Pick the sub-agent output design change that cuts orchestrator context load while keeping the task coherent
    • Reject tempting fixes that are lossy for the orchestrator, such as truncating its history or passing raw transcripts up
    • Shape compact sub-agent results with structured outputs, knowing what the schema can and cannot enforce
    • Use MLflow trace token usage to find which sub-agent output is inflating orchestrator input

    Key concept

    Sub-agent output is orchestrator input — To the orchestrator, a sub-agent is just a tool. Whatever the sub-agent returns becomes a tool result that sits in the orchestrator's context for the rest of the task. So the most direct lever on orchestrator context load is the size and shape of what each sub-agent sends back.

    1.Why the orchestrator saturates first

    On Databricks, a multi-agent system puts one coordinator in front of several specialists. That coordinator might be a Supervisor Agent built through Agent Bricks, or a custom orchestrator on Databricks Apps built from the OpenAI Agents SDK template. The specialists can be Genie Agents, knowledge assistants, serving endpoints or other app agents. Users get a single entry point, and each specialist works its own domain.

    The mechanism is simple. In the Databricks Apps orchestrator, each configured sub-agent becomes a tool. The design-patterns guide describes an agent's loop as calling tools and then integrating tool outputs into the conversation. Put those together and every sub-agent reply becomes part of the orchestrator's working context. The orchestrator keeps it there, re-reads it on every later reasoning step, and reasons over it alongside everything else.

    That is why saturation shows up at the orchestrator before anywhere else. Each sub-agent has its own context and only sees its own slice of the work. The orchestrator sees all the slices. If a Genie sub-agent returns a hundred result rows, a RAG sub-agent returns five full retrieved passages, and a custom agent returns its whole reasoning trace, the orchestrator holds all of that at once. A Databricks blog post on supervisor architecture names this pressure as a reason to split work into agents in the first place: otherwise the context grows too complex for a single agent to keep track of. Verbose sub-agent output brings the same problem back, this time inside the orchestrator.

    Checkpoint 1 of 8· Check yourself

    In a Databricks Apps multi-agent orchestrator, what happens to a sub-agent's reply after the orchestrator calls it?

    Checkpoint 2 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?

    Sources123

    2.The design change: return conclusions, not evidence

    Start with what the orchestrator actually does. The Supervisor Agent documentation describes its job as managing agent interactions, task delegation, and result synthesis. Routing needs to know what has been done and what is still open. Synthesis needs each specialist's conclusion. Neither needs the evidence each specialist went through to reach its conclusion: every SQL row it scanned, every passage it retrieved, every intermediate thought.

    That difference points to the change the exam is looking for. Have each sub-agent return a compact, decision-relevant result, and keep the detail on the sub-agent's side. A well-designed return usually contains:

    - The answer or finding for the sub-task, stated directly. - A status: done, partial, or blocked, plus any open question the orchestrator has to act on. - Key figures or entities the orchestrator will need to combine with other sub-agents' results. - Provenance: which table, document or source backs the finding, so the detail can be fetched later if needed.

    What stays out: raw transcripts, raw tool payloads, full retrieved documents, and chain-of-thought.

    This is the only family of fixes that fits both halves of the objective. It reduces load because the orchestrator stops holding evidence. It keeps coherence because the orchestrator still gets every conclusion it needs to synthesize. Now compare the options that fail one half or the other. Truncating or dropping the orchestrator's older turns reduces load, but it throws away conclusions the orchestrator still needs, which breaks coherence. Passing full transcripts up "to be safe" keeps everything and makes saturation worse. Moving to a larger model or adding more sub-agents changes neither what each reply contains nor where it ends up.

    Checkpoint 3 of 8· Check yourself

    A Supervisor Agent is saturating. Which change targets the documented part of its job that actually consumes sub-agent output?

    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?

    Sources4

    3.Shaping sub-agent output with structured outputs

    A compact result is easier to rely on when its shape is fixed. Databricks structured outputs let a chat model return JSON that follows a schema you supply through response_format. That works the same way across supported model providers. For sub-agent design, a schema with fields such as finding, status, and sources stops a sub-agent from drifting back into long free text. It also gives the orchestrator a predictable shape to combine. The documented example below extracts a small, fixed set of fields from a long input, which is exactly the move a sub-agent's final reply needs to make.

    Start of a documented json_schema response_format: a strict schema that reduces a long input to a few named fieldspython
    response_format = {
          "type": "json_schema",
          "json_schema": {
            "name": "research_paper_extraction",
            "schema": {
              "type": "object",
              "properties": {
                "title": { "type": "string" },
                "authors": {
                  "type": "array",
                  "items": { "type": "string" }
                },
                "abstract": { "type": "string" },

    The documented limitations matter for this design, and one of them catches people out. A schema fixes the shape of the output, not its size. Foundation Model APIs do not enforce length or size constraints, so a maxLength on a summary field will not stop a long reply. Brevity has to come from the sub-agent's instructions, such as "state the finding in two sentences". Keep the schema flat too: the docs say heavily nested schemas lower generation quality.

    Documented structured-output limits and what each means when designing a sub-agent's return schema
    Documented limitWhat it means for sub-agent output design
    Length and size keywords such as maxLength, maxProperties, and minProperties are not enforcedThe schema cannot cap how much a sub-agent returns. Ask for brevity in the instructions.
    Heavily nested JSON schemas result in lower quality generationUse a flat return shape (finding, status, sources) rather than deeply nested objects
    The maximum number of keys in the JSON schema is 64A return schema should be small anyway. Needing many keys suggests the sub-agent is passing up evidence.
    Claude models: only json_schema is supported; no streaming; response_format cannot be combined with tools or tool_choiceA sub-agent that calls tools on a Claude model cannot use response_format in those same requests. Plan where the structured final reply gets produced.

    Checkpoint 5 of 8· Check yourself

    A team adds a strict json_schema to each sub-agent's final reply and sets maxLength: 400 on the summary field. Summaries are still often much longer than that, and the orchestrator is still saturating. What is the best explanation?

    Sources5

    4.Keeping the task coherent, and measuring the effect

    The usual worry about compact returns is that the detail is "gone". It does not have to be. Detail can live on the sub-agent's side and be fetched when needed. On Databricks, managed agent sessions are one place for an agent's full history. The docs describe using them to rebuild full context, tool calls and reasoning included, on a follow-up. The details of sessions and memory belong to their own lesson. The point here is the contrast. A compact return with provenance is lossless for what the orchestrator needs, and the full detail can still be retrieved. Truncating the orchestrator's history is lossy: whatever falls off the end is gone, conclusions included.

    You can draw an analogy with how Databricks describes memory. As a session builds up, the agent distills the durable facts out of it. A good sub-agent return does the same thing for the orchestrator: it keeps what matters for the next decision and leaves the bulk behind.

    Checkpoint 6 of 8· Check yourself

    Which change reduces orchestrator context load while leaving the sub-agents' full working detail retrievable if a later step needs it?

    Diagnose before you redesign. MLflow Tracing records multi-agent runs with visibility into which agent was called on each turn and the messages passed between agents. From version 3.2.0, it also records token usage per call. Reading token usage span by span shows which sub-agent's replies make the orchestrator's input tokens jump. That sub-agent's output is the one to redesign first. The snippet below comes from the AG2 tracing integration page, but it uses the general MLflow trace API.

    Reading total and per-span token usage from an MLflow trace (from the AG2 tracing integration page)python
    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)

    Checkpoint 7 of 8· Fill the gap

    Which span attribute holds per-call token usage in this sample?

    for span in trace.data.spans:
        usage = span.get_attribute(" ? ")
        if usage:
            print(span.name, usage)

    Checkpoint 8 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?

    Sources678

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.Passing each sub-agent's full transcript up to the orchestrator is the safest way to keep the task coherent.Why is that wrong?

      The orchestrator needs conclusions to synthesize, not the evidence behind them. Full transcripts make saturation worse. Compact results with provenance keep coherence, and the full detail can be stored and rebuilt elsewhere if a later step needs it.

      Covered in The design change: return conclusions, not evidence

    2. 2.Adding maxLength to a sub-agent's structured-output schema will cap how much it returns to the orchestrator.Why is that wrong?

      Foundation Model APIs do not enforce length or size keywords. The schema fixes the shape of the output, and brevity has to come from the sub-agent's instructions.

      Covered in Shaping sub-agent output with structured outputs

    3. 3.Orchestrator saturation comes mainly from the orchestrator's own prompt, so the fix is to trim or truncate the orchestrator's history.Why is that wrong?

      Each sub-agent is a tool whose output is added to the orchestrator's conversation, so sub-agent replies are usually the main source of load. Truncation discards conclusions. Shrinking what sub-agents return deals with the cause.

      Covered in Why the orchestrator saturates first

    Sources

    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 the orchestrator saturates first
      “The orchestrator treats each subagent as a tool and uses its instructions to route requests to the right one.”
      ↩︎ Key concept
    2. 2.
      “Integrate tool outputs into the conversation.”
      ↩︎ Why the orchestrator saturates first
      “Integrate tool outputs into the conversation.”
      ↩︎ Exam trap 3
    3. 4.
      “manage agent interactions, task delegation, and result synthesis to deliver comprehensive solutions.”
      ↩︎ The design change: return conclusions, not evidence
    4. 5.
      “Structured outputs on Databricks let you generate responses in a defined JSON format as part of your AI application workflows.”
      ↩︎ Shaping sub-agent output with structured outputs
      “Heavily nested JSON schemas result in lower quality generation. If possible, try flattening the JSON schema for better results.”
      ↩︎ Shaping sub-agent output with structured outputs
      “The response_format parameter for Claude structured outputs cannot be combined with tools or tool_choice.”
      ↩︎ Shaping sub-agent output with structured outputs
      “Foundation Model APIs does not enforce length or size constraints for objects and arrays.”
      ↩︎ Exam trap 2
      “Foundation Model APIs does not enforce length or size constraints for objects and arrays.”
      ↩︎ Checkpoint
    5. 6.
      “Reconstruct full context (including tool calls and reasoning) on a follow-up message.”
      ↩︎ Keeping the task coherent, and measuring the effect
      “Reconstruct full context (including tool calls and reasoning) on a follow-up message.”
      ↩︎ Exam trap 1
    6. 7.
      “As a session accumulates, an agent (or your application) distills the durable facts out of it and writes them to memory.”
      ↩︎ Keeping the task coherent, and measuring the effect

    Ready to test yourself?

    Practise Databricks Certified Context Engineer Associate in quiz mode.

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