A2UI Launched: Full CopilotKit support at launch!

A2UI Launched: CopilotKit has partnered with Google to deliver full support in both CopilotKit and AG-UI!

Check it out
LogoLogo
  • Overview
  • Integrations
  • API Reference
  • Copilot Cloud
Slanted end borderSlanted end border
Slanted start borderSlanted start border
Select integration...

Please select an integration to view the sidebar content.

IntegrationsCrewai flows

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?

Multi-agent flows are useful when you want to orchestrate complex flows together that require the coordination of multiple agents. 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?

CopilotKit can be used in either of two distinct modes: Router Mode, or Agent Lock. By default, CopilotKit will use Router Mode, leveraging your defined LLM to route requests between agents.

Router Mode (default)

Router Mode is enabled by default when using CoAgents. To use it, specify a runtime URL prop in the CopilotKit provider component and omit the agent prop, like so:

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

In router mode, CopilotKit acts as a central hub, dynamically selecting and routing requests between different agents or actions based on the user's input. This mode can be good for chat-first experiences where an LLM chatbot is the entry point for a range of interactions, which can stay in the chat UI or expand to include native React UI widgets.

In this mode, CopilotKit will intelligently route requests to the most appropriate agent or action based on the context and user input.

Router mode requires that you set up an LLM adapter. See how in "Set up a copilot runtime" section of the docs.

Agent Lock Mode

To use Agent Lock Mode, specify the agent name in the CopilotKit component with the agent prop:

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

In this mode, CopilotKit is configured to work exclusively with a specific agent. This mode is useful when you want to focus on a particular task or domain. Whereas in Router Mode the LLM and CopilotKit's router are free to switch between agents to handle user requests, in Agent Lock Mode all requests will stay within a single workflow graph, ensuring precise control over the workflow.

Use whichever mode works best for your app experience! Also, note that while you cannot nest CopilotKit providers, you can use different agents or modes in different areas of your app — for example, you may want a chatbot in router mode that can call on any agent or tool, but may also want to integrate one specific agent elsewhere for a more focused workflow.

PREV
Markdown rendering
Slanted end borderSlanted end border
Slanted start borderSlanted start border
NEXT
Terminology

On this page

What are Multi-Agent Flows?
When should I use this?
How does CopilotKit support this?
Router Mode (default)
Agent Lock Mode