Quickstart
Turn your CrewAI Flows into an agent-native application in 10 minutes.
Start with your coding agent
Use this prompt to connect your CrewAI agent to CopilotKit and verify a working conversation. Your coding agent will follow this guide in your project, or you can work through the manual steps below.
Open your coding agent in your project's folder, or in an empty folder for a new app.This runs in a coding agent on your computer.
Prerequisites
Before you begin, you need a CrewAI Flow. It can run locally or on infrastructure you manage; a CrewAI Enterprise deployment is optional. If you use the CopilotKit CLI path below, the starter creates the Flow integration for you.
The CLI starter also needs:
- Node.js 20.9+
- Python 3.10 to 3.13
- uv
- An OpenAI API key
Getting started
Optional: Set up CopilotKit Intelligence
Start cloud-hosted setup and create or select a project if you want persistent threads and the inspector.
- The CLI's
initflow writes the server-side project API key to.envasCPK_INTELLIGENCE_API_KEY. - Cloud-hosted setup does not issue
COPILOTKIT_LICENSE_TOKEN. - You do not need a Copilot Cloud account to run a local CrewAI Flow with CopilotKit.
How do you want to get started?
Bootstrap with the new CopilotKit CLI (Beta) or code along with us to get started.
Run the CLI
Run the following command in your Next.js application:
No problem. Just use create-next-app to make one quickly.
npx create-next-app@latestnpx copilotkit@latest init --framework flowsThe starter uses a regular CrewAI Flow.
Start the app
In the project directory, copy the example environment file:
cp .env.example .envSet OPENAI_API_KEY in .env. Then install the dependencies and start the app:
npm install
npm run devnpm install also installs the Python dependencies of the Flow with uv. npm run dev starts the UI and the Flow server.
Talk to your agent
You've successfully integrated a CrewAI Flow agent chatbot to your application. Depending on the template you chose, you may see some different UI elements. To start, try asking a few questions to your agent.
- Can you tell me a joke?
- Can you help me understand AI?
- What do you think about React?
Open Inspector and confirm setup
On localhost, click the Inspector button in the corner of the app.
- Open Inspect, then Agent. Your agent is listed.
- Send a chat message. Open Inspect, then AG-UI Events. Events are moving.
- Open Rich Threads. The list is unlocked (Intelligence is on), or locked with Copy setup prompt (Intelligence is off).
More detail: Inspector.
What's next?
Implement Human in the Loop
Allow your users and agents to collaborate together on tasks.
Utilize the Shared State
Learn how to synchronize your agent's state with your UI's state, and vice versa.
Add some generative UI
Render your agent's progress and output in the UI.
Setup frontend actions
Give your agent the ability to call frontend tools, directly updating your application.
How is this guide?