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?
The orchestrator treats each sub-agent as a tool, so each sub-agent reply stays in its context as a tool result. The fix is to change what sub-agents send back. Trimming dispatch context works in the other direction, and a bigger window only puts off the saturation.
“The orchestrator treats each subagent as a tool and uses its instructions to route requests to the right one.”Source: docs.databricks.com
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.
| What the sub-agent returns now | What it should return | What stays out of the orchestrator's context |
|---|---|---|
| Complete internal tool-call transcript | Final result plus the key decisions taken | Intermediate tool calls and reasoning, kept in the session or trace |
| Genie Agent's full row-level result set | Synthesized answer with key figures and the source table cited | The raw rows, still queryable from the Unity Catalog table |
| Restated instructions and prior history, then the result | Only the new information and results | Content 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.
Pointers set the evidence aside without deleting it. Transcripts go to the session store, call records go to tracing, and raw rows stay in the source table. Echoed instructions carry nothing new because the orchestrator already holds them.
“the conversation history, the ordered transcript of messages, tool calls, and results that an agent reads at the start of a turn”Source: docs.databricks.com
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?
Correct answer: A — Return a concise, structured summary of the final result and key decisions
- A. Correct. Replacing the full tool-call transcript with a concise summary of the final result and the decisions that led to it removes low-value token volume from the orchestrator's context while still giving it everything it needs to continue planning coherently.
- B. Incorrect. Expanding the context window increases capacity but does not reduce the load; it lets the saturation problem grow larger and delays rather than solves it, and does nothing to change what sub-agents send.
- C. Incorrect. Appending the full transcript to every response is the opposite of load reduction — it guarantees the orchestrator's context keeps accumulating raw, mostly redundant tool-call detail every turn.
- D. Incorrect. Routing tool calls through the orchestrator moves the detailed logging burden onto the orchestrator itself, increasing its context load rather than reducing it.
- E. Incorrect. Summarizing the orchestrator's own instructions doesn't address the problem, since the instructions aren't the source of saturation — the verbose sub-agent transcripts are.
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?
Correct answer: A — Return a synthesized answer with key figures and citations, not the raw row-level results
- A. Correct. A synthesized answer with the key figures and source citations gives the orchestrator the decision-relevant substance of the analysis without the thousands of raw rows, cutting context load while keeping the answer coherent and traceable.
- B. Incorrect. A bare row count discards the figures and citations the orchestrator actually needs to reason about the business question, trading context savings for lost coherence.
- C. Incorrect. Keeping the full row-level result set still floods the orchestrator's context with thousands of rows; removing only the reasoning trace does not solve the underlying volume problem.
- D. Incorrect. Sending only the reasoning trace and forcing the orchestrator to re-run the query duplicates work, wastes compute, and still leaves the orchestrator without a usable answer.
- E. Incorrect. Compressing the raw result set into a CSV attachment still requires the orchestrator to load and parse the full row-level data to get an answer, so the context burden remains.
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.
In the sub-agent's output template. Remove the restatement and ask for new results and decisions only. The orchestrator already holds the task and the history, so leaving them out costs nothing in coherence.
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?
The orchestrator's own session already holds its instructions and history, so any echo is a duplicate added on every turn, even a short paraphrase or a compressed one. Dropping the oldest turns throws away the orchestrator's own decisions while the echoes keep arriving. Removing the echo from the template fixes the cause.
“A session grows within the interaction and is complete on its own.”Source: docs.databricks.com
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?
Correct answer: A — Return only new information and results, omitting instructions already known to the orchestrator
- A. Correct. Since the orchestrator already holds the original instructions, omitting them from each sub-agent response and returning only new information eliminates the redundant restatement that drives the saturation, without losing any information the orchestrator needs.
- B. Incorrect. A shorter paraphrase still adds redundant, already-known content to every turn; it reduces but does not eliminate the unnecessary repetition, so saturation continues to build.
- C. Incorrect. Discarding older orchestrator turns risks dropping information the orchestrator still needs for coherent planning, and does not stop the sub-agent from continuing to restate instructions each turn.
- D. Incorrect. Packaging the same repeated content as a separate file still requires the orchestrator to receive and account for it, so it does not remove the redundant volume from context.
- E. Incorrect. Having the orchestrator echo its own instructions back adds an extra round of redundant content rather than removing the sub-agent's repeated restatement.
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?
The orchestrator has to combine results into a final answer, so the schema keeps the decisions and figures it needs and sends the evidence out through pointers. A status-and-count schema has nothing to combine. An optional transcript field will eventually get filled. Leaving out decisions lets later steps contradict earlier choices, because a trace is not in the orchestrator's context.
“manage agent interactions, task delegation, and result synthesis to deliver comprehensive solutions”Source: docs.databricks.com
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.
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)MLflow records the token usage for each call in the mlflow.chat.tokenUsage span attribute, and the total goes in trace.info. Reading usage span by span shows which sub-agent's returns drive the orchestrator's input tokens. The trace total cannot show this.
Source: docs.databricks.comSources4
Sources
(6)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 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.
“with distinct logic or conversation contexts”
↩︎ Why sub-agent responses fill the orchestrator's context - 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 - 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“Messages passed between agents”
↩︎ 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 - 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 - 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