# Introduction

> Bring your CrewAI Flow-based agents to your users with CopilotKit via AG-UI.

## Bring your CrewAI Flow-based agents to your users

CrewAI runs your flows. CopilotKit gives them a surface your users can see, interrupt and steer.

[Quickstart](/crewai-crews/quickstart)

## Build with CrewAI Flows

CrewAI gives you the flow: steps, state and the crew that works through them. What it does not give you is the surface. Your users need a place to talk to the flow, a view of each step while it runs, and a way to step in. Each capability below builds on something your flow already does.

- [Generative UI](/crewai-crews/generative-ui): Your flow emits state and tool calls as each step completes. CopilotKit streams those to the browser and renders them as React components your users watch update while the flow runs.
- [Human-in-the-loop](/crewai-crews/human-in-the-loop): A flow can stop and wait for a person. CopilotKit renders your own UI for that decision and resumes the flow with the answer.
- [Shared state](/crewai-crews/shared-state): Flow state is the one object every step reads and writes. CopilotKit mirrors it into your app and back, so a change from the user and a change from the flow go to the same state.

Chat surfaces, headless UI, frontend tools and multi-agent flows work with CrewAI too. [And more](/crewai-crews/build-with-agents)

## Start building

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

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

[Read the quickstart](/crewai-crews/quickstart)

## Connect your agent

Your flow keeps running as its own Python service, with the AG-UI bridge from ag_ui_crewai in front of it. CopilotKit reaches that service over HTTP, so nothing inside the flow changes.

```ts title="app/api/copilotkit/[[...slug]]/route.ts"
import {
  CopilotRuntime,
  createCopilotRuntimeHandler,
} from "@copilotkit/runtime/v2";
import { HttpAgent } from "@ag-ui/client";

const runtime = new CopilotRuntime({
  agents: {
    my_agent: new HttpAgent({ url: process.env.AGENT_URL! }),
  },
});

const handler = createCopilotRuntimeHandler({
  runtime,
  basePath: "/api/copilotkit",
});

export const GET = handler;
export const POST = handler;
```

[Read the setup guide](/crewai-crews/quickstart)
