AG-UI Protocol Documentation — Agent-User Interaction Protocol
by CopilotKit / AG-UI Protocol
The missing protocol layer between your agent backend and the screen a human is actually looking at.
Overview
AG-UI is an open, event-based protocol from CopilotKit that standardises how an agent backend talks to a user-facing frontend, and the documentation is organised as protocol reference plus per-language SDKs. The Docs section opens with an overview and an explicit 'MCP, A2A, and AG-UI' page positioning it against the other agent protocols, then moves through Build applications (server, middleware, build clients, production support) and Core architecture, which is the substantive part: Events, Agents, Middleware, Messages, Reasoning, State Management, Interrupts, Serialization, Tools and Capabilities, followed by Generative UI, Developing with Cursor, Debugging, What's New and the Roadmap. The Events reference is the core of the protocol — roughly 26 typed events split into lifecycle (RunStarted, RunFinished, RunError, StepStarted, StepFinished), text message, tool call, state management (StateSnapshot, StateDelta, MessagesSnapshot), activity, reasoning and the Raw/Custom escape hatches. Separate SDK sections document JavaScript (core types, client AbstractAgent and HttpAgent, middleware, AgentSubscriber, stream compaction, @ag-ui/encoder and @ag-ui/proto), Python and .NET, with an OpenAPI API reference. The protocol grew out of CopilotKit's partnership with LangGraph and CrewAI and now lists first-party integrations for Microsoft Agent Framework, Google ADK, AWS Strands Agents, AWS Bedrock AgentCore, Mastra, Pydantic AI, Agno, LlamaIndex and AG2, plus a community Claude Agent SDK adapter and community SDKs in Kotlin, Go, Dart, Java, Rust, Ruby and C++. MIT-licensed, 15.3k GitHub stars.
At a Glance
- Topic
- Agentic
- Level
- Intermediate
- Format
- Documentation
- Cost
- Free
- Duration
- ~3-4 hours to read the protocol reference and wire up a first agent; ongoing reference thereafter
- Provider
- CopilotKit / AG-UI Protocol
- Hands-on
- Yes — code/exercises
- Certificate
- None
What You’ll Learn
- ✓Stream agent output to a UI using AG-UI's lifecycle, text-message and tool-call events
- ✓Synchronise agent state with a frontend using StateSnapshot and StateDelta patch events
- ✓Implement an AG-UI server endpoint and consume it with HttpAgent or a custom AbstractAgent
- ✓Handle human-in-the-loop interrupts and resume a paused agent run cleanly
- ✓Render generative UI driven by tool calls instead of hand-coding chat components
- ✓Stream reasoning traces separately from user-facing text using the Reasoning event family
- ✓Position AG-UI against MCP and A2A so each protocol covers the layer it was designed for
- ✓Apply middleware and stream compaction for logging, auth and long-running conversations
Highlights
- •Fills the layer MCP and A2A leave open: MCP connects agents to tools, A2A to other agents, AG-UI to the human's screen
- •Roughly 26 typed events cover streaming text, tool calls, state deltas, reasoning and interrupts, so the frontend needs no framework-specific glue
- •First-party adapters for Microsoft Agent Framework, Google ADK, AWS Strands, AWS Bedrock AgentCore, Mastra, Pydantic AI, Agno, LlamaIndex and AG2, plus LangGraph and CrewAI partnerships
- •Official TypeScript, Python and .NET SDKs with community Kotlin, Go, Dart, Java, Rust, Ruby and C++ ports — MIT-licensed, 15.3k GitHub stars
- •The AG-UI Dojo provides runnable examples per feature rather than one monolithic demo app
Who It’s For
Best For
- ✓Full-stack engineers putting an agent behind a real product UI
- ✓Teams that swapped agent frameworks and had to rewrite the frontend each time
- ✓Developers building generative or human-in-the-loop interfaces over streaming agents
- ✓Framework authors who need a standard transport to expose their runtime to clients
Prerequisites
- •Working TypeScript or Python, plus comfort with HTTP streaming or WebSockets
- •Having built at least one agent with a framework such as LangGraph, CrewAI or Pydantic AI
- •Basic frontend experience (React or equivalent) to consume and render the event stream
FAQ
What is AG-UI Protocol Documentation — Agent-User Interaction Protocol?
AG-UI is an open, MIT-licensed protocol that standardises the event stream between an agent backend and the user interface it drives. It is for full-stack engineers who have built an agent and now have to render it — streaming text, tool calls, reasoning, shared state and human-in-the-loop interrupts — without writing bespoke glue for every framework. After working through the docs you can expose any agent runtime over a standard event stream and consume it from a React, Python or .NET client.
Is AG-UI Protocol Documentation — Agent-User Interaction Protocol free?
AG-UI Protocol Documentation — Agent-User Interaction Protocol is free to access.
What level is AG-UI Protocol Documentation — Agent-User Interaction Protocol for?
AG-UI Protocol Documentation — Agent-User Interaction Protocol is aimed at a intermediate audience. Recommended background: Working TypeScript or Python, plus comfort with HTTP streaming or WebSockets, Having built at least one agent with a framework such as LangGraph, CrewAI or Pydantic AI, Basic frontend experience (React or equivalent) to consume and render the event stream.
How long does AG-UI Protocol Documentation — Agent-User Interaction Protocol take?
Expect roughly ~3-4 hours to read the protocol reference and wire up a first agent; ongoing reference thereafter. Most learners work through it at their own pace.
What will I learn from AG-UI Protocol Documentation — Agent-User Interaction Protocol?
You'll learn: Stream agent output to a UI using AG-UI's lifecycle, text-message and tool-call events; Synchronise agent state with a frontend using StateSnapshot and StateDelta patch events; Implement an AG-UI server endpoint and consume it with HttpAgent or a custom AbstractAgent; Handle human-in-the-loop interrupts and resume a paused agent run cleanly; Render generative UI driven by tool calls instead of hand-coding chat components; Stream reasoning traces separately from user-facing text using the Reasoning event family; Position AG-UI against MCP and A2A so each protocol covers the layer it was designed for; Apply middleware and stream compaction for logging, auth and long-running conversations.
Topics
Sources
This page was written from 4 sources, 1 on domains other than docs.ag-ui.com.
- 1.docs.ag-ui.com — introductionvendor
- 2.docs.ag-ui.com — llms.txtvendor
- 3.docs.ag-ui.com — eventsvendor
- 4.github.com — ag ui