CopilotKit + CrewAI Flows

Bring your CrewAI Flows agentsinto any app

CopilotKit is an open-source framework that connects your app to CrewAI Flows agents. Give your agents chat, generative UI, human-in-the-loop, AG-UI Streams, Automatic Learning and more.

Quickstart
Chat

Waking up the demo

Talk to your agent in a ready-made chat interface. Open in the showcase

CrewAI and CopilotKit running together, in the React frontend. Every demo below is the same integration with one capability turned on.

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

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

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

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

Start building

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

npx copilotkit@latest init
Read the 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.

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

How is this guide?