Share via


Semantic Kernel Agent Orchestration

Important

Agent Orchestration features in the Agent Framework are in the experimental stage. They are under active development and may change significantly before advancing to the preview or release candidate stage.

Semantic Kernel’s Agent Orchestration framework enables developers to build, manage, and scale complex agent workflows with ease.

Why Multi-agent Orchestration?

Traditional single-agent systems are limited in their ability to handle complex, multi-faceted tasks. By orchestrating multiple agents, each with specialized skills or roles, we can create systems that are more robust, adaptive, and capable of solving real-world problems collaboratively. Multi-agent orchestration in Semantic Kernel provides a flexible foundation for building such systems, supporting a variety of coordination patterns.

Orchestration Patterns

Like well-known cloud design patterns, agent orchestration patterns are technology agnostic approaches to coordinating multiple agents to work together towards a common goal. To learn more about the patterns themselves, refer to the AI agent orchestration patterns documentation.

Supported Orchestration Patterns in Semantic Kernel

Semantic Kernel supports you by implementing these orchestration patterns directly in the SDK. These patterns are available as part of the framework and can be easily extended or customized so you can tune your agent collaboration scenario.

Pattern Description Typical Use Case
Concurrent Broadcasts a task to all agents, collects results independently. Parallel analysis, independent subtasks, ensemble decision making.
Sequential Passes the result from one agent to the next in a defined order. Step-by-step workflows, pipelines, multi-stage processing.
Handoff Dynamically passes control between agents based on context or rules. Dynamic workflows, escalation, fallback, or expert handoff scenarios.
Group Chat All agents participate in a group conversation, coordinated by a group manager. Brainstorming, collaborative problem solving, consensus building.
Magentic Group chat-like orchestration inspired by MagenticOne. Complex, generalist multi-agent collaboration.

Simplicity and Developer-friendly

All orchestration patterns share a unified interface for construction and invocation. No matter which orchestration you choose, you:

  • Define your agents and their capabilities, see Semantic Kernel Agents.
  • Create an orchestration by passing the agents (and, if needed, a manager).
  • Optionally provide callbacks or transforms for custom input/output handling.
  • Start a runtime and invoke the orchestration with a task.
  • Await the result in a consistent, asynchronous manner.

This unified approach means you can easily switch between orchestration patterns, without learning new APIs or rewriting your agent logic. The framework abstracts away the complexity of agent communication, coordination, and result aggregation, letting you focus on your application’s goals.

// Choose an orchestration pattern with your agents
SequentialOrchestration orchestration = new(agentA, agentB)
{
    LoggerFactory = this.LoggerFactory
};  // or ConcurrentOrchestration, GroupChatOrchestration, HandoffOrchestration, MagenticOrchestration, ...

// Start the runtime
InProcessRuntime runtime = new();
await runtime.StartAsync();

// Invoke the orchestration and get the result
OrchestrationResult<string> result = await orchestration.InvokeAsync(task, runtime);
string text = await result.GetValueAsync();

await runtime.RunUntilIdleAsync();
# Choose an orchestration pattern with your agents
orchestration = SequentialOrchestration(members=[agent_a, agent_b])
# or ConcurrentOrchestration, GroupChatOrchestration, HandoffOrchestration, MagenticOrchestration, ...

# Start the runtime
runtime = InProcessRuntime()
runtime.start()

# Invoke the orchestration
result = await orchestration.invoke(task="Your task here", runtime=runtime)

# Get the result
final_output = await result.get()

await runtime.stop_when_idle()

Note

Agent orchestration is not yet available in Java SDK.

Preparing Your Development Environment

Add the following packages to your project before you proceed:

dotnet add package Microsoft.SemanticKernel.Agents.Orchestration --prerelease
dotnet add package Microsoft.SemanticKernel.Agents.Runtime.InProcess --prerelease

Depending on the agent types you use, you may also need to add the respective packages for the agents. Please refer to the Agents Overview for more details.

Next steps