---
title: Shared State
description: Create a two-way connection between your UI and agent state.
icon: "lucide/Repeat"
hideTOC: true
---
import { IntegrationGrid } from "@/components/content/integration-grid";
import { ImageZoom } from "fumadocs-ui/components/image-zoom";

## What is shared state?

Agentic Copilots maintain a shared state that seamlessly connects your UI with the agent's execution. This shared state system allows you to:

- Display the agent's current progress and intermediate results
- Update the agent's state through UI interactions
- React to state changes in real-time across your application

<ImageZoom
  src="https://cdn.copilotkit.ai/docs/copilotkit/images/coagents/SharedStateCoAgents.gif"
  alt="Shared State Demo"
  width={1000}
  height={1000}
  className="rounded-lg shadow-lg border mt-0"
/>

## When should I use this?

Use shared state when you want to facilitate collaboration between your agent and the user. Updates flow both ways — the agent's outputs are automatically reflected in the UI, and any inputs the user updates in the UI are automatically reflected in the agent's execution.

<OpsPlatformCTA
  variant="inline"
  title="Building stateful agents?"
  body="Persistent threads ship with the Enterprise Intelligence Platform on the free Developer tier."
  surface="docs_shared_state"
/>

## Get started by choosing your AI backend

<IntegrationGrid path="shared-state" exclude={["agno", "agent-spec"]} />
