TL;DR
AG-UI (Agent–User Interaction Protocol, open source, born from CopilotKit's work with LangChain and CrewAI) standardizes the connection between an agent backend and the application a person uses. It fills the third slot next to MCP (agent to tools and data) and A2A (agent to agent): agent to user. It came up in Sam Keen's post as an approach to UI and AI integration.
The core idea is that an agent run is not a request and response but a typed event stream: lifecycle, streamed text, streamed tool calls, state snapshots and JSON Patch deltas, reasoning, sub-agents and interrupts. Any frontend that understands the stream (a web app, a terminal, a mobile app, Slack or Teams) can drive any backend that emits it. Support is broad: LangChain, CrewAI, Microsoft Agent Framework, Google ADK, AWS Strands and Bedrock AgentCore, Mastra, Pydantic AI, LlamaIndex, the Claude Agent SDK and OpenAI Agents SDK, with SDKs in about ten languages.
Why a separate protocol
The docs argue that agents break the REST/GraphQL model because they:
run long and stream intermediate work across multi-turn sessions;
are nondeterministic and can drive the UI nondeterministically;
mix structured and unstructured IO (text, voice, tool calls, state updates) at once;
compose sub-agents, often recursively, and need a person in the loop mid-flow.
Without a shared contract, every agent framework and every frontend wires these ad hoc.
Architecture
Event-driven. The agent emits standardized events during a run; the client consumes them.
Bidirectional. The client sends input, state and frontend tool definitions; the agent can hand control back to the frontend.
Transport-agnostic. SSE, WebSockets, webhooks or others; the protocol defines events, not the wire.
Middleware. Native framework events only need to be AG-UI-compatible, and a middleware layer adapts them, which is how so many frameworks joined quickly.
Clients are not only web apps. Because it is an event stream rather than a rendering target, a terminal or chat platform can be a client.
The event model
| Family | Events | Pattern |
|---|---|---|
| Lifecycle | RunStarted, RunFinished, RunError, StepStarted, StepFinished | Run boundaries; RunFinished can end in success or interrupt with the pending interrupts |
| Text | TextMessageStart, Content, End (or Chunk) | Start, content, end |
| Tool calls | ToolCallStart, Args, End, Result (or Chunk) | Start, content, end; args stream as they are generated |
| State | StateSnapshot, StateDelta, MessagesSnapshot | Snapshot then JSON Patch (RFC 6902) deltas |
| Activity | ActivitySnapshot, ActivityDelta | Snapshot then delta |
| Reasoning | ReasoningStart, message events, ReasoningEnd, ReasoningEncryptedValue | Visible summaries, or encrypted reasoning carried opaquely |
| Sub-agents | SubagentStarted, Finished, Error | Nested delegation with scoped state |
| Escape hatches | Raw, Custom | Anything the protocol does not cover |
Events sharing an ID (a messageId or toolCallId) form one logical stream, so text and several tool calls can interleave. On top of the events sit higher-level building blocks: shared read-write state with conflict resolution, frontend-executed tool calls, rendering of backend tool output, generative UI (static typed components, or a small declarative language the app validates before mounting), human-in-the-loop interrupts (pause, approve, edit, retry, escalate without losing state) and live agent steering.
Tradeoffs and failure modes
State sync is the hard part. JSON Patch deltas are cheap, but a missed or reordered delta silently corrupts the client's view. The spec tells clients to request a fresh snapshot when they detect inconsistency and to tolerate out-of-order delivery; the client has to implement both.
Shared read-write state is a concurrency problem. Agent and user editing the same store needs real conflict resolution; the docs promise it, but each integration decides how well it works.
Frontend tool calls widen the trust boundary. Letting the agent invoke actions that run in the user's client is powerful and needs the same allowlisting and confirmation as any tool.
Lowest-common-denominator risk. Adapting each framework through middleware hides framework-specific features, and the Raw and Custom events can become a back door to non-portable behavior.
Spec churn. Deprecated thinking events, draft events and extended lifecycle fields show it is still moving; pin versions.
Ecosystem gravity. It originated with a vendor whose hosted service (threads, memory, chat-platform delivery) sits next to, not inside, the protocol. The protocol is open; some of the convenient pieces around it are not.
Reasoning exposure. Streaming reasoning to users needs a policy: summaries only, or encrypted values passed through unread.
Review checklist
Is the UI driven by a typed event stream rather than polling or ad hoc websockets?
Does the client handle snapshot and delta, detect gaps, and re-request a snapshot?
Are interrupts first-class (run ends in
interrupt, state preserved, resumable) rather than modeled as chat messages?Are frontend-executed tools allowlisted and confirmed like backend tools?
Is there a policy for what reasoning reaches the user?
Is use of Raw and Custom events tracked so portability is a choice, not an accident?
Are protocol and SDK versions pinned on both sides?
Related entries
R021 DeepSeek's Super-agent: one router and a ticket per task; AG-UI's sub-agent events and interrupts are a standard way to show that kind of delegation to a person.
R016 Do humans still need to check AI's facts?: interrupts and approval steps are where human verification plugs into a running agent.
R006 6 must-know terms for AI agent harnesses: AG-UI standardizes the harness's outward-facing edge.
Sources
AG-UI overview, core architecture and events reference, docs.ag-ui.com
Sam Keen's LinkedIn post, 2026-11-11