원클릭으로
copilotkit-develop
// Use when building AI-powered features with CopilotKit v2 -- adding chat interfaces, registering frontend tools, sharing application context with agents, handling agent interrupts, and working with the CopilotKit runtime.
// Use when building AI-powered features with CopilotKit v2 -- adding chat interfaces, registering frontend tools, sharing application context with agents, handling agent interrupts, and working with the CopilotKit runtime.
Use when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
Use when building custom agent backends, implementing the AG-UI protocol, debugging streaming issues, or understanding how agents communicate with frontends. Covers event types, SSE transport, AbstractAgent/HttpAgent patterns, state synchronization, tool calls, and human-in-the-loop flows.
Use when contributing to the CopilotKit open-source project — forking, cloning, setting up the monorepo, creating branches, running tests, and submitting pull requests against CopilotKit/CopilotKit.
Use when diagnosing CopilotKit issues -- runtime connectivity failures, agent not responding, streaming errors, tool execution problems, transcription failures, version mismatches, and AG-UI event tracing.
Use when wiring an external agent framework (LangGraph, CrewAI, PydanticAI, Mastra, ADK, LlamaIndex, Agno, Strands, Microsoft Agent Framework, or others) into a CopilotKit application via the AG-UI protocol.
Use when the user wants to update, refresh, or reinstall the CopilotKit agent SKILLS (the SKILL.md files that teach this agent about CopilotKit). NOT for updating the CopilotKit codebase or project — this is specifically about refreshing the skills/knowledge this agent has loaded. Triggers on "update copilotkit skills", "update skills", "refresh skills", "skills are stale", "skills are outdated", "get latest skills", "my copilotkit knowledge is wrong", "copilotkit APIs changed", "skills seem old", "wrong API names", "reinstall skills", "skills not working right", "update your copilotkit knowledge".
| name | copilotkit-develop |
| description | Use when building AI-powered features with CopilotKit v2 -- adding chat interfaces, registering frontend tools, sharing application context with agents, handling agent interrupts, and working with the CopilotKit runtime. |
| version | 1.0.0 |
This plugin includes an MCP server (copilotkit-docs) that provides search-docs and search-code tools for querying live CopilotKit documentation and source code.
.mcp.json -- no setup needed.CopilotKit v2 is built on the AG-UI protocol (@ag-ui/client / @ag-ui/core). The stack has three layers:
@copilotkit/runtime) -- Server-side. Hosts agents, handles SSE/Intelligence transport, middleware, transcription.@copilotkit/core) -- Shared state management, tool registry, suggestion engine. Not imported directly by apps.@copilotkit/react) -- Provider, chat components, hooks. Re-exports everything from @ag-ui/client so apps need only one import.Create a CopilotRuntime (or the explicit CopilotSseRuntime / CopilotIntelligenceRuntime) and expose it via createCopilotEndpoint (Hono) or createCopilotEndpointExpress (Express).
import { CopilotRuntime, createCopilotEndpoint } from "@copilotkit/runtime";
import { LangGraphAgent } from "@ag-ui/langgraph";
const runtime = new CopilotRuntime({
agents: {
myAgent: new LangGraphAgent({ /* ... */ }),
},
});
const app = createCopilotEndpoint({
runtime,
basePath: "/api/copilotkit",
});
import { CopilotKitProvider } from "@copilotkit/react";
function App() {
return (
<CopilotKitProvider runtimeUrl="/api/copilotkit">
<YourApp />
</CopilotKitProvider>
);
}
Use <CopilotChat>, <CopilotPopup>, or <CopilotSidebar>:
import { CopilotChat } from "@copilotkit/react";
function ChatPage() {
return <CopilotChat agentId="myAgent" />;
}
Let the agent call functions in the browser:
import { useFrontendTool } from "@copilotkit/react";
import { z } from "zod";
useFrontendTool({
name: "highlightCell",
description: "Highlight a spreadsheet cell",
parameters: z.object({ row: z.number(), col: z.number() }),
handler: async ({ row, col }) => {
highlightCell(row, col);
return "done";
},
});
Provide runtime data to the agent:
import { useAgentContext } from "@copilotkit/react";
useAgentContext({
description: "The user's current shopping cart",
value: cart, // any JSON-serializable value
});
When an agent pauses for human input:
import { useInterrupt } from "@copilotkit/react";
useInterrupt({
render: ({ event, resolve }) => (
<div>
<p>{event.value.question}</p>
<button onClick={() => resolve({ approved: true })}>Approve</button>
</div>
),
});
Show custom UI when tools execute:
import { useRenderTool } from "@copilotkit/react";
import { z } from "zod";
useRenderTool({
name: "searchDocs",
parameters: z.object({ query: z.string() }),
render: ({ status, parameters, result }) => {
if (status === "executing") return <Spinner>Searching {parameters.query}...</Spinner>;
if (status === "complete") return <Results data={result} />;
return <div>Preparing...</div>;
},
}, []);
| Hook | Purpose |
|---|---|
useFrontendTool | Register a tool the agent can call in the browser |
useComponent | Register a React component as a chat-rendered tool (convenience wrapper around useFrontendTool) |
useAgentContext | Share JSON-serializable application state with the agent |
useAgent | Get the AbstractAgent instance for an agent ID; subscribe to message/state/run-status changes |
useInterrupt | Handle on_interrupt events from agents with render + optional handler/filter |
useHumanInTheLoop | Register a tool that pauses execution until the user responds via a rendered UI |
useRenderTool | Register a renderer for tool calls (by name or wildcard "*") |
useDefaultRenderTool | Register a wildcard "*" renderer using the built-in expandable card UI |
useRenderToolCall | Internal hook returning a function to resolve the correct renderer for a given tool call |
useRenderActivityMessage | Internal hook for rendering activity messages by type |
useRenderCustomMessages | Internal hook for rendering custom message decorators |
useSuggestions | Read the current suggestion list and control reload/clear |
useConfigureSuggestions | Register static or dynamic (LLM-generated) suggestion configs |
useThreads | List, rename, archive, and delete Intelligence platform threads |
| Component | Purpose |
|---|---|
CopilotKitProvider | Root provider -- configures runtime URL, headers, agents, error handler |
CopilotChat | Full chat interface connected to an agent (inline layout) |
CopilotPopup | Chat in a floating popup with toggle button |
CopilotSidebar | Chat in a collapsible sidebar with toggle button |
CopilotChatView | Headless chat view with slots for message view, input, scroll, suggestions |
CopilotChatInput | Chat input textarea with send/stop/transcribe controls |
CopilotChatMessageView | Renders the message list |
CopilotChatSuggestionView | Renders suggestion pills |
| Export | Purpose |
|---|---|
CopilotRuntime | Auto-detecting runtime (delegates to SSE or Intelligence) |
CopilotSseRuntime | Explicit SSE-mode runtime |
CopilotIntelligenceRuntime | Intelligence-mode runtime with durable threads |
createCopilotEndpoint | Create a Hono app with all CopilotKit routes |
createCopilotEndpointExpress | Create an Express router with all CopilotKit routes |
CopilotKitIntelligence | Intelligence platform client configuration |