Framework · Agent SDKs

CopilotKit

CopilotKit gives a web frontend the components and protocol to connect to an agent backend so the agent can stream text, render UI, share state, and pause for the user.

Description

CopilotKit is an open-source frontend stack for agent-powered user interfaces, built by the CopilotKit team. It supplies React components and hooks plus the AG-UI protocol, which carries events in both directions between the application and any agentic backend. Over that channel the agent streams responses, renders React components as tool output, syncs shared state with the page, and can pause execution to ask the user for input or approval.

Solution

A bidirectional event stream between frontend and agent: the application POSTs user input and state to the agent, and the agent emits a stream of typed events (text, tool calls, state deltas) over AG-UI. The agent's loop runs on the backend; CopilotKit drives the UI from the event stream and can send the agent back into the loop after a human responds.

Primary use cases

  • in-app copilot and chat interfaces
  • generative UI rendered from agent tool calls
  • shared state between frontend and agent
  • human-in-the-loop approval and confirmation flows
  • connecting React/Angular/mobile frontends to agent backends

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.