CopilotKit

03pattern 03 of 05

Multi-agent flows that stay coherent.

Route one conversation across specialized sub-agents without losing state or context. Orchestrate them behind one UI — handoffs, interrupts, and shared state included — and show your users who is doing what.

New to CopilotKit? It's the open-source frontend stack for AI agents: you bring the agent, CopilotKit connects it to the people using your app. This page shows one of the five patterns it makes possible. What it is, in 30 seconds ↓

What CopilotKit is

Connect any agent to any user.

CopilotKit is the open-source frontend stack for AI agents: it puts an agent to work inside a real product, not in a chat window next to it. Bring the agent you have; reach the people where they already are.

any agent
Microsoft Agent FrameworkAWS StrandsGoogle ADKLangChain / LangGraphCrewAIAgnoClaude Agents SDKOpenAI Agents SDKMastraPydantic AILlamaIndexAG2
any user
iOSAndroidWebSMSiMessageTelegramWhatsAppSlackDiscordGoogle ChatMicrosoft Teams
01 · bring your agent

Any framework, unchanged

CopilotKit speaks AG-UI, the open protocol it created. The agent side stays yours.

02 · connect it to users

Inside your product

Hooks and components for every pattern on this site. This page is one of them.

03 · ship it safely

Production-ready runtime

Streaming, concurrency, retries, and state sync handled. Open source, 37,000+ GitHub stars.

In code
app/page.tsx
import { useRenderTool } from "@copilotkit/react-core/v2";
import { z } from "zod";

useRenderTool({
  name: "research_agent",
  parameters: z.object({ task: z.string() }),
  render: ({ parameters, status, result }) => (
    <SubAgentActivityCard
      subAgent="research_agent"
      task={parameters?.task}
      status={status} // inProgress → executing → complete
      result={result}
    />
  ),
}, []);
npm install @copilotkit/react-core @copilotkit/runtime
How it works
01

One supervisor

A supervisor agent owns the conversation and delegates to research, writing, or any sub-agent as tool calls.

02

One renderer per sub-agent

useRenderTool surfaces each delegation inline — the user sees which agent is running which task.

03

One state

Delegations, interrupts, and results live in shared state, so nothing is lost between handoffs.

Building this?

Tell us in one click. We'll point you at the demo source, the right guide, and the people in the community shipping the same pattern — and skip everything else.

Got it.

We'll tailor what we send you from here. The fastest way to go deeper is the live demo above.

Other patterns