ScriptsApr 22, 2026·3 min read

CopilotKit — Frontend Stack for AI Copilots and Generative UI

React and Angular framework for embedding AI copilots with in-app chat, generative UI, and agent integration into any application.

Introduction

CopilotKit is a frontend framework for building AI copilot experiences into React and Angular applications. It provides components for in-app chat, generative UI, and agent coordination, letting developers add AI-powered assistance to existing apps without building the interaction layer from scratch.

What CopilotKit Does

  • Provides React and Angular components for embedding AI chat sidebars and popovers
  • Enables generative UI where AI responses render as interactive components instead of plain text
  • Connects frontend copilots to backend agents via the AG-UI protocol
  • Gives AI context about your application state through readable and actionable hooks
  • Supports text generation assistance for forms, editors, and text areas

Architecture Overview

CopilotKit splits into a frontend SDK and a runtime layer. The frontend SDK provides React hooks like useCopilotReadable and useCopilotAction that expose app state and capabilities to the AI. The runtime communicates with LLM providers and agent frameworks. The AG-UI (Agent-User Interaction) protocol standardizes how agents stream UI updates to the frontend.

Self-Hosting & Configuration

  • Install the npm packages for your framework (React or Angular)
  • Wrap your application root with the CopilotKit provider component
  • Configure the runtime endpoint pointing to your backend or Copilot Cloud
  • Use useCopilotReadable to expose application context to the AI
  • Define useCopilotAction hooks to let the AI trigger app-specific actions

Key Features

  • Drop-in UI components for chat, sidebars, and inline assistance
  • Generative UI that renders AI output as interactive React components
  • AG-UI protocol for standardized agent-to-frontend communication
  • Application-aware context through declarative hooks
  • Compatible with LangChain, LangGraph, and custom agent backends

Comparison with Similar Tools

  • Vercel AI SDK — lower-level streaming primitives; CopilotKit provides complete copilot UI components
  • LangChain — backend agent framework; CopilotKit is the frontend layer that connects to agents
  • Streamlit — Python-based data app builder; CopilotKit integrates into existing React/Angular apps
  • Chainlit — standalone chat UI for agents; CopilotKit embeds copilots inside your own application
  • Gradio — ML demo builder; CopilotKit adds AI assistance to production apps

FAQ

Q: Does CopilotKit work with any LLM? A: Yes. It supports OpenAI, Anthropic, Google, and any provider through the runtime configuration.

Q: Can I use it with an existing React app? A: Yes. Add the provider component and hooks incrementally without rewriting your app.

Q: What is the AG-UI protocol? A: It is an open protocol that standardizes how AI agents communicate UI updates and actions to frontend applications.

Q: Is there a hosted option? A: Copilot Cloud offers a managed runtime, but you can also self-host the runtime entirely.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets