A multi-agent system (MAS) splits a complex task across several AI agents, each with its own role, instructions and tools: one gathers information, one writes, one checks. It is the same principle as a team of people with different skills.
Orchestration patterns
- Sequential: one agent's output becomes the next agent's input, like an assembly line.
- Concurrent: several agents work in parallel on the same input and the results are combined.
- Handoff: one agent routes the request to the most suitable specialised agent.
- Group chat: agents take turns discussing, coordinated by a moderator, until they reach a solution.
- Orchestrator and planner: a main agent breaks the task down, assigns subtasks and checks progress.
A simple sequential example
Even without dedicated frameworks, the basic pattern takes a few lines with IChatClient:
record Agent(string Name, string Instructions);
async Task<string> RunAsync(IChatClient client, Agent a, string input) =>
(await client.GetResponseAsync(
[
new ChatMessage(ChatRole.System, a.Instructions),
new ChatMessage(ChatRole.User, input)
])).Text;
var writer = new Agent("Writer", "Write a clear, concise draft of the requested text.");
var reviewer = new Agent("Reviewer", "Fix errors, check consistency and return only the final text.");
var draft = await RunAsync(client, writer, "Announcement of the new support service.");
var final = await RunAsync(client, reviewer, draft);
Frameworks such as the Microsoft Agent Framework offer these patterns ready-made, with state, tools and tracing.
When it really pays off
A multi-agent system adds cost, latency and points of failure. It pays off when the task has truly distinct phases, when each phase needs different tools or permissions, or when an independent check improves quality. For many requests, a single agent with good instructions and the right tools is more than enough.
Governing the risks
- Limits: a maximum number of turns and calls, to avoid loops and runaway costs.
- Least privilege for each agent: the one that writes must not be able to pay.
- Human in the loop for important decisions.
- Evaluation: a set of test cases to measure quality every time instructions or models change.
Comments (0)
No comments yet.