CopilotKit
Open-source React framework and UI stack for building in-app AI copilots, generative UI, and agentic workflows.
Why consider CopilotKit?
CopilotKit is an enterprise-ready frontend stack that integrates AI agents with modern web frameworks like React and Angular to power chat, generative UI, and human-in-the-loop workflows.
Learn CopilotKit by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide3 sections
Integrating AI Agents into Application Frontends
Building conversational AI into an existing application often requires bridging the gap between a generic text response and the application's native state. CopilotKit is a best-in-class SDK for building full-stack agentic applications, Generative UI, and chat applications. It addresses the complexity of tying AI models to an application's specific context, allowing developers to embed AI directly into the user interface rather than forcing users into a separate chat window. As the Enterprise Agentic Frontend Stack. Build rich agentic applications that learn from every interaction, it offers tools to structure how an AI reads context and returns structured data. It provides generative UI, shared state, and human-in-the-loop workflows for React, Angular, Vue, React Native, meaning developers can implement it across web and mobile platforms using a single unified backend. For more details, consult the official website.
Managing Application State and Interactions
For an AI agent to be useful within an application, it must understand what the user is currently doing. The framework provides a synchronized state layer that both agents and UI components can read from and write to in real time. This means if a user selects an item in a list or navigates to a new view, the agent is immediately aware of this context and can adjust its responses accordingly.
Beyond answering questions with text, CopilotKit enables the frontend to render interactive elements. It allows agents to generate and update UI components dynamically at runtime based on user intent and agent state. For example, if a user asks to view their recent transactions, the agent can return a fully interactive React data table rather than a static markdown list. The user can then interact with that table, and the agent continues to observe those changes through the shared state layer.
In many sensitive environments, allowing an AI to execute actions autonomously poses a security or reliability risk. To mitigate this, developers can inject human-in-the-loop workflows, which lets agents pause execution to request user input, confirmation, or edits before continuing. If the agent attempts to delete a database record or send an email on behalf of the user, the execution halts, presents a confirmation dialogue to the user, and resumes only after explicit approval. You can learn more on GitHub.
Initializing the Framework and Chat Interface
When starting a new project or integrating into an existing one, CopilotKit provides a fully customizable chat interface that supports message streaming, tool calls, and agent responses. This chat component can be styled to match the host application's design system, avoiding the disjointed experience of a generic AI widget.
To begin building, you can initialize a new project via the command line interface:
npx copilotkit@latest createThis command scaffolds the necessary configuration files and dependencies. Furthermore, CopilotKit provides specialized modules to help coding agents interact with the SDK. Developers can add these capabilities to a repository by running:
npx copilotkit@latest skills installThe underlying architecture relies on standardized communication between the frontend and the agent backend. Specifically, we are the company behind the AG-UI Protocol, ensuring that agent capabilities, UI rendering requests, and state synchronization remain interoperable and consistent regardless of the specific LLM or backend framework being used. You can view all configurations and examples in the canonical README.
Related tools
More options with a similar category or technology profile.
marimo
A reactive Python notebook that is reproducible, git-friendly, and executable as a script.
JupyterLab
The next-generation web-based user interface for Project Jupyter computational notebooks.
Trafilatura
Python package and command-line tool designed to gather text and metadata on the Web.
ScrapeGraphAI
Python scraper library that uses LLMs and direct graph logic to extract website data.