D1 · Agentic Architecture › Cluster 4 · Multi-Agent

4.7 · Result Merging / Aggregation

The coordinator synthesizes — and resolves conflicts

CONCEPT Merging is the coordinator's final act

After specialists return their outputs (whether from a fan-out or a pipeline), someone has to turn several partial answers into one coherent result. That's the coordinator's merge job: it aggregates the specialist outputs, synthesizes them into a single answer, and resolves conflicts when specialists disagree. Because sub-agents are context-isolated (4.4), only the coordinator sees all the results — so merging can only happen there.

Sub-stepWhat the coordinator does
AggregateCollect every specialist's output into one place
SynthesizeWeave them into a unified, coherent answer (not a concatenation)
Resolve conflictsWhen specialists disagree, decide which to trust / how to reconcile
🔑 Merging is synthesis, not concatenation. Stapling outputs together is not merging — the coordinator must reconcile overlaps and contradictions into one answer.

CONCEPT Conflict resolution strategies

DIAGRAM Aggregate → synthesize → resolve

flowchart TD S1["🔵 Specialist A output"] --> AGG["📥 Aggregate
(coordinator)"] S2["🔵 Specialist B output"] --> AGG S3["🔵 Specialist C output"] --> AGG AGG --> CONF{"Conflicts?"} CONF -->|no| SYN["🟣 Synthesize
one coherent answer"] CONF -->|yes| RES["⚖️ Resolve
authority · evidence · consensus"] RES --> SYN SYN --> OUT(["✔ Final merged answer"]) classDef b fill:#d1ecf1,stroke:#17a2b8,color:#0c5460; classDef p fill:#e2d4f0,stroke:#764ba2,color:#3d1a5b; classDef g fill:#d4edda,stroke:#28a745,color:#155724; class S1 b; class S2 b; class S3 b; class SYN p; class OUT g;

CODE Merge specialist results with an LLM synthesis pass

Aggregate the isolated outputs, then give the coordinator model an explicit synthesis + conflict-resolution instruction.

# `results` = outputs collected from the (parallel or sequential) specialists.
results = {
    "market": market_agent_output,
    "technical": tech_agent_output,
    "financial": finance_agent_output,
}

import json
merge_prompt = (
    "You are the coordinator. Synthesize the specialist outputs below into ONE "
    "coherent recommendation. Where they disagree, resolve the conflict and state "
    "which specialist you trusted and why. Do not just concatenate.\n\n"
    f"{json.dumps(results, indent=2)}"
)

merged = client.messages.create(
    model="claude-opus-4-8", max_tokens=2048,   # the strong model does the synthesis
    system="Aggregate, synthesize, and resolve conflicts across specialist outputs.",
    messages=[{"role": "user", "content": merge_prompt}],
)
final = "".join(b.text for b in merged.content if b.type == "text")
Using the strong model (claude-opus-4-8) for the merge is a common choice: synthesis and conflict resolution are exactly the hard reasoning the coordinator exists for, even if specialists ran on cheaper models.

EXAM TRAPS

Trap: Treating merge as concatenation. → Synthesis reconciles overlaps and contradictions into one answer; stapling outputs together is not merging.
Trap: Expecting specialists to resolve conflicts among themselves. → They're context-isolated and don't see each other. Only the coordinator sees all outputs, so it owns conflict resolution.
Trap: Ignoring disagreement. → If two specialists contradict each other, the merge step must decide (authority / evidence / consensus) or escalate — not silently pick one.

PRACTICE

Q1 · Why can't the specialists merge their own results?

They're context-isolated (4.4) and never see each other's outputs. Only the coordinator aggregates all results, so synthesis and conflict resolution happen there.

Q2 · The market and financial specialists give opposite go/no-go calls. What should the coordinator do?

Resolve the conflict explicitly — weigh authority (whose domain owns the call), evidence, and consensus — and state which it trusted and why. If stakes are high and it's unresolved, escalate to a human (3.6).

Q3 · Why often run the merge on the strong model even when specialists used cheaper ones?

Synthesis and conflict resolution are the hardest reasoning in the workflow. Specialists can be cheap/fast on sub-tasks, but the coordinator's merge benefits from the strongest model.