01pattern 01 of 05
One surface. Agent and user, same state.
Chat is an input, not the product. Shared state lets your agent read and write the same surface your users work on. Sidebar chatbots summarize. Agent-native apps act — same canvas, same state, human in the loop.
New to CopilotKit? It's the open-source frontend stack for AI agents: you bring the agent, CopilotKit connects it to the people using your app. This page shows one of the five patterns it makes possible. What it is, in 30 seconds ↓
Connect any agent to any user.
CopilotKit is the open-source frontend stack for AI agents: it puts an agent to work inside a real product, not in a chat window next to it. Bring the agent you have; reach the people where they already are.























Any framework, unchanged
CopilotKit speaks AG-UI, the open protocol it created. The agent side stays yours.
Inside your product
Hooks and components for every pattern on this site. This page is one of them.
Production-ready runtime
Streaming, concurrency, retries, and state sync handled. Open source, 37,000+ GitHub stars.
import { useAgent, UseAgentUpdate } from "@copilotkit/react-core/v2";
const { agent } = useAgent({
agentId: "shared-state-read-write",
updates: [UseAgentUpdate.OnStateChanged],
});
// READ — the UI re-renders whenever the agent writes state
const notes = agent.state?.notes ?? [];
// WRITE — every edit in your UI lands in agent state
agent.setState({ preferences: next, notes });
npm install @copilotkit/react-core @copilotkit/runtime
Subscribe
useAgent hands you the agent and re-renders your components on every state change it emits.
Read
Render from agent.state like any other prop. Notes the agent writes show up in your panels, not in a chat bubble.
Write
Call agent.setState from your UI. On its next turn the agent reads it back — your users steer the model without typing.
Building this?
Tell us in one click. We'll point you at the demo source, the right guide, and the people in the community shipping the same pattern — and skip everything else.
Got it.
We'll tailor what we send you from here. The fastest way to go deeper is the live demo above.
That didn't save. The demo and guide links above still work — or email hello@copilotkit.ai and a human will send them.
Already built one? See if it's production-ready.
Fourteen questions across the five bottlenecks that bite after the demo — concurrency, state-sync, streaming, retries, failure modes. Two minutes, scored, with the one thing to fix first.
Generative UI: components, not paragraphs.
Agents render real components from tool calls — whatever the moment needs.
Multi-agent flows that stay coherent.
Specialized sub-agents behind one UI — handoffs, interrupts, shared state.
One agent. Every channel.
Ship the agent you already built to Slack, Teams, and beyond.
Copilots that act — with approval.
The agent proposes, your user approves. Guardrails and an audit trail by default.
Production readiness, scored.
Fourteen questions, five bottlenecks, one thing to fix first.