wiki / concepts / ag-ui-protocol
AG-UI Protocol
loading…
AG-UI Protocol
AG-UI (Agent–User Interaction Protocol) is an open, event-based specification that standardizes communication between backend agent execution loops and user-facing frontend applications. Originated by copilotkit in partnership with ecosystem frameworks (LangChain, CrewAI, Microsoft Agent Framework, AWS Bedrock AgentCore), AG-UI defines the frontend interaction layer alongside MCP (tools) and A2A (agent coordination). [source: ag-ui-protocol-specification-2026]
The Three Agentic Protocols
graph LR
User[User / Frontend UI] <-- "AG-UI (Agent-User Interaction)" --> Agent[Agent Runtime / Backend]
Agent <-- "MCP (Model Context Protocol)" --> Tools[External Tools & Data]
Agent <-- "A2A (Agent to Agent)" --> Subagents[Distributed Agents]
| Layer | Protocol | Primary Origin / Backers | Purpose |
|---|---|---|---|
| Agent ↔ User | AG-UI | copilotkit, LangChain, AWS, Microsoft | Standardizes streaming state, generative UI, client tools, and human-in-the-loop gates. |
| Agent ↔ Tools & Data | MCP | anthropic | Standardizes tool definitions, context injection, and resource prompts. |
| Agent ↔ Agent | A2A | Standardizes distributed agent discovery, delegation, and message routing. |
[source: ag-ui-protocol-specification-2026]
Protocol Primitives & Lifecycle Events
AG-UI models agent execution as a stateful, bi-directional event stream transported over Server-Sent Events (SSE) or WebSockets:
- Lifecycle & Text Streaming:
RUN_STARTED,TEXT_MESSAGE_START,TEXT_MESSAGE_CONTENT,TEXT_MESSAGE_END,RUN_FINISHED. - Tool Execution Tracing:
TOOL_CALL_START,TOOL_CALL_ARGS,TOOL_CALL_END,TOOL_CALL_RESULT. - Reasoning & Thinking:
REASONING_START,REASONING_DELTA,REASONING_ENDto display progress signals without leaking raw chain-of-thought tokens. - Shared State Sync: Streamed event-sourced snapshots and delta updates (
STATE_SNAPSHOT,STATE_DELTA) between client state and agent memory. - Human-in-the-Loop (HITL) Interrupts: Protocol-level pause, approve, reject, or edit capabilities enabling gated tool execution.
Architectural Patterns
1. Pure Event-to-Message Fold
Frontends (such as assistant-ui or CopilotKit) maintain a pure reducer that projects the session event log into the client message model. Replaying stored historical events and tailing live SSE streams execute through the exact same fold function, ensuring state consistency across page reloads. [source: assistant-ui-claude-managed-agents-2026]
2. Generative UI (Static & Declarative)
Rather than raw markdown alone, agent backends emit structured intents that client components mount as typed, interactive widgets (charts, forms, parameter selectors). [source: ag-ui-protocol-specification-2026]
3. Multi-Surface Transport
Because AG-UI defines an event stream rather than a DOM rendering engine, it operates across React, React Native (native mobile components), Angular, and messaging platforms (Slack, Microsoft Teams) via channel adapters. [source: copilotkit-cma-agui-2026]
Cross-links
- agent native infrastructure — underlying platform and runtime tier
- claude managed agents — cloud-hosted agent loop implementing AG-UI adapters
- copilotkit — originating organization
- anthropic — MCP and CMA ecosystem partner
| ag-ui-protocol-specification-2026 | https://docs.ag-ui.com/introduction | ingested 2026-08-30 sha256:8b80410f6964… |
| copilotkit-cma-agui-2026 | https://www.copilotkit.ai/blog/claude-managed-agents-agui-compatible | ingested 2026-08-30 sha256:fd039f20d339… |
| assistant-ui-claude-managed-agents-2026 | https://www.assistant-ui.com/docs/runtimes/claude-managed-agents | ingested 2026-08-30 sha256:4dedb8e6f8c0… |