Skip to content

SYSTEM Cited by 1 source

AG-UI protocol

AG-UI (agent-to-UI) is a protocol that standardizes streaming communication from AI agents to user interfaces. It defines a set of typed events streamed over Server-Sent Events (SSE) so that any agent framework can drive any frontend without bespoke, framework-specific integration code. Agent frameworks emit AG-UI events; frontends consume them — creating a universal contract that lets you swap agent frameworks (or add new agent capabilities) without rewriting the UI integration layer. (Source: sources/2026-09-29-aws-build-adaptive-ai-interfaces-with-the-ag-ui-protocol-agent-s-ff0dbca9)

Why it exists

Before AG-UI, connecting an agent to an interface meant building custom WebSocket formats, polling mechanisms, and bespoke integration code every time you switched agent frameworks or added new capabilities. That work is pure glue and has to be re-done per framework. AG-UI removes it by making the event stream a standard: the frontend subscribes once and reacts to a fixed event vocabulary regardless of which framework produced the events. This is the UI-side analogue of what MCP does for agent-to-tool integration — a standard contract that collapses N×M bespoke integrations.

Event types

The protocol defines events covering the agent-to-UI communication surface:

  • TEXT_MESSAGE_CONTENT — streams agent reasoning or responses token by token for real-time visibility into agent thinking.
  • STATE_DELTA — incremental state updates for bidirectional synchronization between agent and interface. This is the load-bearing event for human-in-the-loop: the frontend exposes its state (current findings, validation decisions) to agents, and agents update state through actions, so an agent can pause for human validation before proceeding.
  • TOOL_CALL_START / TOOL_CALL_END — surface tool execution when agents invoke external functions or APIs (e.g. streaming a browser-automation action log back to the UI).
  • UI_COMPONENT_SPEC — the agent controls which UI component appears and how it is configured, via an interface-element specification. In the reference architecture agents select from a predefined, themed, accessible component library (ROICard, DebatePanel, ConfidenceMeter) rather than emitting arbitrary HTML — a constrained-output discipline that balances flexibility with design consistency and security.

A minimal frontend handler is a switch on event.data.type: text_message_content → append agent text; state_delta → update application state; ui_component_spec → render the named component with its props.

Transport: SSE, not WebSockets

AG-UI streams over Server-Sent Events — a one-directional server→client stream over plain HTTP (Content-Type: text/event-stream, each event a data: {...}\n\n frame). In the AWS reference implementation an AWS Lambda "AG-UI handler" formats agent responses as SSE frames and a FastAPI StreamingResponse yields them; API Gateway carries both the REST requests and the SSE connection. SSE fits the agent-to-UI shape (server pushes a stream of typed events; the client's upstream messages are ordinary POSTs) and is simpler than a full-duplex WebSocket. The "bidirectional" state sync is logical (via STATE_DELTA down + client POSTs up), not a bidirectional socket.

Role in adaptive interfaces (2026-09-29)

AG-UI is one of three technologies in AWS's adaptive-interface reference architecture, alongside the Strands Swarm pattern and Nova Act. Its job is to adapt the interface to what the agents discover: because a swarm's output is variable (one scan → one finding, another → twenty), the agent drives which components render via UI_COMPONENT_SPEC, streams its debate via TEXT_MESSAGE_CONTENT, and keeps the human in the loop via STATE_DELTA. In the worked radiology example a React AG-UI client streams over SSE from an orchestrator that fronts the swarm; a specialized AG-UI handler inside Bedrock AgentCore formats agent responses as AG-UI events.

Use it when output variability is high and you can't predetermine interface requirements; a static UI is cheaper when the output space is known and consistent.

Caveats

  • Single-source, reference-architecture disclosure. The wiki's knowledge of AG-UI comes from one AWS Architecture Blog post; protocol internals beyond the four named event types, versioning, error semantics, backpressure/reconnection behavior, and the governing spec/steward are not characterized here.
  • Educational code. The AWS post's AG-UI endpoint samples are explicitly educational; production hardening (auth on the SSE endpoint, PHI masking) is called out separately.

Seen in

Last updated · 766 distilled / 2,225 read