Agent War Room
A planner agent decomposes a goal and delegates to specialist agents — researcher, analyst, writer, reviewer — then merges their work into one deliverable. This is the orchestration pattern behind Microsoft Agent Framework and Foundry Agent Service.
🧩 What is multi-agent orchestration?
Real work is rarely one prompt. It's research → analysis → drafting → review. Instead of asking a single model to do everything, multi-agent orchestration uses a planner (orchestrator) that decomposes a goal into subtasks and hands each to the specialist agent best suited for it. Each specialist has its own instructions and tools; the planner then synthesizes their outputs into a final deliverable.
This is the dominant agentic pattern of 2026. Copilot Studio multi-agent systems are generally available, and Microsoft Foundry Agent Service ships the Agent Framework, hosted agents, and the A2A (agent-to-agent) protocol for agents that call each other across boundaries.
The decompose → delegate → run → synthesize loop
The live demo lets you set a mission, pick concurrent or sequential mode, and watch the planner delegate in real time.
🎯 Use cases
⚖️ Pros, cons & limitations
✓ Pros
- Specialists with focused instructions beat one do-everything prompt.
- Concurrent fan-out/fan-in is fast; sequential hand-offs add rigor.
- Each agent can have its own tools, model, and Entra identity.
- Maps naturally onto how human teams actually work.
- Foundry adds tracing, evals, and managed scaling.
✕ Cons / trade-offs
- More moving parts than a single agent — more to debug.
- Multiple model calls mean higher token cost and latency.
- Planner quality gates everything; a weak plan cascades.
- Synthesis can lose detail if subtasks overlap or conflict.
△ Limitations
- Some Foundry capabilities (hosted agents, A2A) are in preview.
- Needs guardrails for prompt-injection across agents (XPIA).
- Not every task benefits — simple asks are cheaper single-agent.
- Requires evals to catch regressions as you iterate.
📦 Get the code
Three ways to go from this page to a working multi-agent system. Start with the prompt for speed, or follow the inline build to understand the orchestration.
Paste this into GitHub Copilot Chat (agent mode) in VS Code, or any capable coding model. It's a complete spec for the planner + specialists, plus the Foundry deploy path.
You are a senior AI engineer and an expert in multi-agent orchestration with the
Microsoft Agent Framework and Microsoft Foundry Agent Service.
Build me a working multi-agent system: a PLANNER agent that decomposes a goal,
delegates subtasks to SPECIALIST agents, and synthesizes their outputs into one
deliverable. It must run locally first, then deploy as Hosted agents on Foundry.
REQUIREMENTS
1. Stack
- Python, Microsoft Agent Framework (agent-framework) for orchestration.
- Models from the Foundry model catalog via the Responses API.
- Keep agent logic framework-clean so it can be packaged as a Foundry Hosted agent.
2. Agents
- Planner (orchestrator): decomposes the goal into typed subtasks, assigns each to the
right specialist, then merges results into a final deliverable.
- Specialists, each with its own instructions and tools:
* Researcher -> tool: web_search
* Analyst -> tool: code_interpreter
* Writer -> drafts the final content
* Reviewer -> checks accuracy, tone, compliance; can request one revision
- Make the roster configurable (add/remove agents without code changes).
3. Orchestration
- Concurrent mode: fan-out subtasks in parallel, fan-in results (asyncio.gather).
- Sequential mode: hand-off chain where each agent builds on the previous output.
- Stream progress: which agent is working, the subtask, and the partial result.
4. Foundry deployment
- Package as a Hosted agent (container or zip), managed endpoint, per-agent Entra
identity, autoscaling, session state.
- Enable end-to-end tracing (Application Insights).
- Add a small eval set; show how to run Foundry evals and the agent optimizer.
- Publish to Microsoft 365 Copilot / Teams; expose over A2A for agent-to-agent calls.
5. Quality
- Real async orchestration, structured logging, graceful failure if a specialist errors.
- A README explaining the decompose -> delegate -> run -> synthesize flow with the
example: "Plan the launch of our new AI feature."
Generate the full project: agents, orchestrator, requirements.txt, a run script, the
Foundry packaging + deploy steps, a tracing config, and an eval set. Then tell me how to
run it locally and verify it on Foundry. Ask me anything you need; otherwise build it.
Prefer to understand the orchestration? Here's the core in ~40 lines, then how to run it.
1. Planner + specialists — war_room.py
A planner decomposes the goal; specialists run concurrently; the planner synthesizes. (Uses the Microsoft Agent Framework against a Foundry/Azure OpenAI endpoint.)
import asyncio
from agent_framework.azure import AzureOpenAIChatClient
from azure.identity import AzureCliCredential
client = AzureOpenAIChatClient(credential=AzureCliCredential())
# --- Specialist roster: name -> instructions ---------------------------
SPECIALISTS = {
"researcher": "Gather facts and sources for the subtask. Be concise.",
"analyst": "Analyze data, quantify impact, and flag risks.",
"writer": "Draft clear, on-brand content from the inputs.",
"reviewer": "Check accuracy, tone, and compliance. Approve or request one fix.",
}
def specialist(name: str):
return client.create_agent(name=name, instructions=SPECIALISTS[name])
async def run_specialist(name: str, goal: str, task: str) -> str:
agent = specialist(name)
reply = await agent.run(f"GOAL: {goal}\nYOUR SUBTASK: {task}")
return reply.text
async def war_room(goal: str, mode: str = "concurrent") -> str:
planner = client.create_agent(
name="planner",
instructions="Decompose the goal into one subtask per specialist, "
"then merge their results into a single deliverable.",
)
# 1) Decompose: ask the planner for a subtask per specialist
plan = await planner.run(
f"GOAL: {goal}\nSpecialists: {', '.join(SPECIALISTS)}.\n"
"Return one short subtask per specialist, 'name: task' per line."
)
tasks = dict(
line.split(":", 1) for line in plan.text.splitlines() if ":" in line
)
tasks = {k.strip().lower(): v.strip() for k, v in tasks.items()
if k.strip().lower() in SPECIALISTS}
# 2) Delegate + run (concurrent fan-out / fan-in, or sequential)
results = {}
if mode == "concurrent":
outs = await asyncio.gather(
*(run_specialist(n, goal, t) for n, t in tasks.items())
)
results = dict(zip(tasks, outs))
else: # sequential hand-off chain
carry = ""
for n, t in tasks.items():
results[n] = await run_specialist(n, goal, f"{t}\nContext so far: {carry}")
carry += f"\n[{n}] {results[n]}"
# 3) Synthesize
summary = "\n".join(f"[{n}] {o}" for n, o in results.items())
final = await planner.run(f"GOAL: {goal}\nSpecialist outputs:\n{summary}\n"
"Write the final deliverable.")
return final.text
if __name__ == "__main__":
print(asyncio.run(war_room("Plan the launch of our new AI feature.")))
2. Dependencies — requirements.txt
agent-framework azure-identity
3. Run it
- Create a venv and install:
pip install -r requirements.txt. - Sign in for local creds:
az login(usesAzureCliCredential). - Set your Foundry / Azure OpenAI endpoint & deployment as env vars (per the Agent Framework docs).
- Run:
python war_room.py— watch the planner delegate and synthesize. - Try sequential mode: call
war_room(goal, mode="sequential")to chain hand-offs. - Add a specialist by adding one line to
SPECIALISTS— no other code changes.
4. Take it to Foundry
- Package
war_room.pyas a Hosted agent (container or zip) for a managed endpoint, per-agent Entra identity, and autoscaling. - Turn on tracing (Application Insights) to see every model call and hand-off.
- Add an eval set and run Foundry evals to score quality and catch regressions; use the agent optimizer to tune instructions.
- Publish to Microsoft 365 Copilot / Teams, or expose over A2A for agent-to-agent calls.
A ready-to-clone GitHub repository for Agent War Room is on the way.
🎮 See it before you build it
The interactive holographic demo animates the full decompose → delegate → run → synthesize loop. Set a mission, choose concurrent or sequential, and watch the planner command the room.
Launch the live demo