# Introduction

> Bring your Deep Agents to your users with CopilotKit via AG-UI.

## Bring your Deep Agents to your users

Deep Agents runs your agent. CopilotKit gives it a surface your users can see, interrupt and steer.

[Quickstart](/deepagents/quickstart)

## Build 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](/deepagents/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](/deepagents/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](/deepagents/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](/deepagents/build-with-agents)

## Start building

Scaffold a new app with the CLI, or follow the quickstart to connect the Deep Agents agent you already run.

```bash
npx copilotkit@latest init
```

[Read the quickstart](/deepagents/quickstart)

## Connect 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.

```ts title="app/api/copilotkit/[[...slug]]/route.ts"
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;
```

[Read the setup guide](/deepagents/quickstart)
