CopilotKit / CopilotKit

CopilotKit / CopilotKit

Build agent-native applications — on any framework, on any surface. 构建原生智能体应用——支持任何框架,覆盖任何平台。

Generative UI, shared state, and human-in-the-loop workflows for React, Angular, Vue, React Native — and beyond the browser. 为 React、Angular、Vue、React Native 以及浏览器之外的环境提供生成式 UI (Generative UI)、共享状态和人机协作工作流。

What is CopilotKit

什么是 CopilotKit

CopilotKit is a best-in-class SDK for building full-stack agentic applications, Generative UI, and chat applications. CopilotKit 是一套顶尖的 SDK,用于构建全栈智能体应用、生成式 UI 和聊天应用。

What started as a React library is now a multi-platform agentic framework: the same agent can power your web app, your mobile app, and your team’s Slack workspace. 它最初是一个 React 库,现在已演变为一个多平台智能体框架:同一个智能体可以同时驱动你的 Web 应用、移动应用以及团队的 Slack 工作区。

We are the company behind the AG-UI Protocol - adopted by Google, LangChain, AWS, Microsoft, Mastra, PydanticAI, and more! 我们是 AG-UI 协议背后的公司,该协议已被 Google、LangChain、AWS、Microsoft、Mastra、PydanticAI 等机构采用!


Features

功能特性

  • Chat UI – A fully customizable chat interface that supports message streaming, tool calls, and agent responses. 聊天 UI – 完全可定制的聊天界面,支持消息流式传输、工具调用和智能体响应。
  • Backend Tool Rendering – Enables agents to call backend tools that return UI components rendered directly in the client. 后端工具渲染 – 使智能体能够调用后端工具,并直接在客户端渲染返回的 UI 组件。
  • Generative UI – Allows agents to generate and update UI components dynamically at runtime based on user intent and agent state. 生成式 UI – 允许智能体根据用户意图和智能体状态,在运行时动态生成和更新 UI 组件。
  • Shared State – A synchronized state layer that both agents and UI components can read from and write to in real time. 共享状态 – 一个同步的状态层,智能体和 UI 组件均可实时读写。
  • Human-in-the-Loop – Lets agents pause execution to request user input, confirmation, or edits before continuing. 人机协作 (Human-in-the-Loop) – 允许智能体暂停执行,在继续之前请求用户输入、确认或修改。
  • Self-Learning (early access) – Agents that continuously improve from user feedback via in-context reinforcement learning (CLHF). 自学习(抢先体验) – 通过上下文强化学习 (CLHF),智能体可根据用户反馈持续改进。

🧩 Works With Your Stack

🧩 适配你的技术栈

One agent backend. Every frontend. 一个智能体后端,适配所有前端。

  • React / Next.js ✅ GA Quickstart
  • Angular ✅ Supported (Quickstart coming soon)
  • Vue ✅ Supported (Quickstart coming soon)
  • React Native ✅ Supported Quickstart

Your agent logic stays the same — AG-UI handles the wire protocol, CopilotKit handles the UI layer for each framework. 你的智能体逻辑保持不变——AG-UI 处理通信协议,CopilotKit 处理各框架的 UI 层。


💬 Beyond the Browser: Slack & Microsoft Teams

💬 浏览器之外:Slack 与 Microsoft Teams

Your agents can run and generate Generative UI beyond the web app. CopilotKit now lets you deploy the same agent to the places your users already work: 你的智能体可以在 Web 应用之外运行并生成 UI。CopilotKit 现在允许你将同一个智能体部署到用户日常工作的平台:

  • Slack – Agents as first-class Slack apps: threads, tool calls, and human-in-the-loop approvals right in the channel. Slack – 将智能体作为一流的 Slack 应用:直接在频道内进行对话线程、工具调用和人机协作审批。
  • Microsoft Teams – Bring agentic workflows to the enterprise, where your org already lives. Microsoft Teams – 将智能体工作流引入企业,融入你组织现有的办公环境。

🧠 Self-Learning Agents

🧠 自学习智能体

Improve your product by learning over time. With Continuous Learning from Human Feedback (CLHF), part of the CopilotKit Intelligence Platform, agents improve with every interaction: 通过持续学习提升你的产品。作为 CopilotKit 智能平台的一部分,持续人类反馈学习 (CLHF) 让智能体在每次交互中不断进化:

  • In-context reinforcement learning – Agents automatically improve from user interactions, no model fine-tuning required. 上下文强化学习 – 智能体根据用户交互自动改进,无需模型微调。
  • Automatic prompt augmentation – Agent behavior adapts based on recent interactions and outcomes. 自动提示词增强 – 智能体行为根据近期交互和结果进行自适应调整。
  • Per-user adaptation – Agents learn individual preferences and get better for each user over time. 用户个性化适配 – 智能体学习个人偏好,并随着时间推移为每位用户提供更好的服务。
  • Threads & persistence – Full interaction history — generative UI, human-in-the-loop, shared state — captured across sessions. 对话线程与持久化 – 完整的交互历史(包括生成式 UI、人机协作、共享状态)在不同会话间均可保留。

Quick Start

快速开始

New projects: npx copilotkit@latest create -f <framework> 新项目: npx copilotkit@latest create -f <framework>

Existing projects: npx copilotkit@latest init 现有项目: npx copilotkit@latest init

What this gives you: 你将获得:

  • CopilotKit installed – Core packages are fully set up in your app. 安装 CopilotKit – 核心包已在你的应用中配置完毕。
  • Provider configured – Context, state, and hooks ready to use. 配置 Provider – 上下文、状态和 Hook 已准备就绪。
  • Agent <> UI connected – Agents can stream actions and render UI immediately. 连接智能体与 UI – 智能体可以流式传输操作并立即渲染 UI。
  • Deployment-ready – Your app is ready to deploy. 准备部署 – 你的应用已可随时部署。

🖥️ AG-UI: The Agent–User Interaction Protocol

🖥️ AG-UI:智能体-用户交互协议

Connect agent workflows to user-facing apps, with deep partnerships and 1st-party integrations across the agentic stack—including LangChain, CrewAI, Mastra, PydanticAI, and more. 将智能体工作流连接到面向用户的应用,并与智能体技术栈(包括 LangChain、CrewAI、Mastra、PydanticAI 等)进行深度合作与原生集成。

npx create-ag-ui-app my-agent-app


🙋🏽‍♂️ Contributing

🙋🏽‍♂️ 贡献指南

Thanks for your interest in contributing to CopilotKit! We value all contributions, whether it’s through code, documentation, creating demo apps, or just spreading the word. 感谢你对为 CopilotKit 做出贡献感兴趣!我们重视所有的贡献,无论是代码、文档、创建演示应用,还是仅仅是传播我们的项目。

For code contributions, see CONTRIBUTING.md. For documentation-related contributions, check out the documentation contributions guide. 代码贡献请参阅 CONTRIBUTING.md。文档相关贡献请查看文档贡献指南。