CopilotKit + Deep Agents
Bring your Deep Agents agentsinto any app
CopilotKit is an open-source framework that connects your app to Deep Agents agents. Give your agents chat, generative UI, human-in-the-loop, AG-UI Streams, Automatic Learning and more.
QuickstartBuild with Deep Agents
Deep Agents gives you a planning agent on LangGraph: subagents, a task list and the state they share. What it does not give you is the surface. Your users need a place to talk to the agent, a view of the plan as it runs, and a way to step in. Each capability below builds on something your agent already does.
Generative UI
Your agent updates its plan and calls tools as it works. CopilotKit streams both to the browser and renders them as React components, so the user watches the task list fill in.
Human-in-the-loop
A node can interrupt and wait for a person. CopilotKit renders your own UI for that decision and resumes the run with the answer.
Shared state
The graph carries one state object between subagents. CopilotKit mirrors it into your app and back, so user changes and agent changes go to the same state.
Chat surfaces, headless UI, frontend tools and subagent flows work with Deep Agents too. And more
Start building
Scaffold a new app with the CLI, or follow the quickstart to connect the Deep Agents agent you already run.
npx copilotkit@latest initConnect your agent
Your agent stays where it runs today, on LangGraph Platform or your own service. CopilotKit reaches it over AG-UI, so nothing inside the agent changes.
import { CopilotRuntime, createCopilotRuntimeHandler } from "@copilotkit/runtime/v2";
import { LangGraphAgent } from "@copilotkit/runtime/langgraph";
const runtime = new CopilotRuntime({
agents: {
sample_agent: new LangGraphAgent({
deploymentUrl: process.env.LANGGRAPH_DEPLOYMENT_URL!,
graphId: "sample_agent",
langsmithApiKey: process.env.LANGSMITH_API_KEY!,
}),
},
});
const handler = createCopilotRuntimeHandler({
runtime,
basePath: "/api/copilotkit",
});
export const GET = handler;
export const POST = handler;
export const PATCH = handler;
export const DELETE = handler;How is this guide?