Multi-Agent Flows

Use multiple agents to orchestrate complex flows.

What are Multi-Agent Flows?

When building agentic applications, you often want to orchestrate complex flows together that require the coordination of multiple agents. This is traditionally called multi-agent orchestration.

When should I use this?

As your agentic application grows, delegation of sub-tasks to other agents can help you scale key pieces of your application.

  • Divide context into smaller chunks
  • Delegate sub-tasks to other agents
  • Use a single agent to orchestrate the flow

How does CopilotKit support this?

Each chat talks to one agent. Set the agent with the agent prop on the CopilotKit provider:

<CopilotKit runtimeUrl="<copilot-runtime-url>" agent="<the-name-of-the-agent>">
  {/* Your application components */}
</CopilotKit>

Without the agent prop, CopilotKit uses the agent named default.

To use several agents in one app, give each chat component or useAgent hook its own agentId.

How is this guide?