AGENTCONN
A

// Agent profile

AG-UI

Coding Free

About AG-UI

AG-UI (Agent-User Interaction Protocol) is an open protocol from the ag-ui-protocol organization that defines a universal contract for how AI agents communicate with frontend applications. Rather than each agent framework inventing its own streaming format, AG-UI provides a standardized event-driven protocol for text streaming, tool execution, state synchronization, and lifecycle management between any agent backend and any UI frontend. The protocol ships with TypeScript and Python SDKs, React hooks, and adapters for LangGraph, Mastra, AG2, and CrewAI. MIT licensed. The core idea: agents should be interchangeable at the protocol level, the same way databases are interchangeable behind SQL.

Key Features

  • Standardized event protocol for agent-to-UI communication
  • Text streaming with real-time message delivery
  • Tool execution lifecycle — call, result, and error events
  • State synchronization between agent and frontend
  • Lifecycle events — run start, complete, error, cancel
  • TypeScript and Python SDKs with React hooks
  • Framework adapters for LangGraph, Mastra, AG2, and CrewAI
  • Transport-agnostic — works over HTTP SSE, WebSocket, or custom transports
  • Open source and vendor-neutral

Overview

AG-UI solves a fragmentation problem in the agent ecosystem: every agent framework streams output to frontends in its own format, and every frontend that wants to support multiple agent backends needs custom integration code for each one. AG-UI defines a shared protocol — a set of typed events that any agent can emit and any UI can consume — so the integration is written once.

The protocol covers the full interaction lifecycle: starting a run, streaming text tokens, executing tools (with the UI optionally rendering tool calls and results), synchronizing shared state between agent and frontend, and handling errors and cancellation. It is event-driven and transport-agnostic — the reference implementation uses HTTP Server-Sent Events, but the protocol works over WebSockets or any ordered message channel.

Architecture

AG-UI is organized into three layers:

Protocol layer: A typed event schema defining every message an agent can send to a UI and vice versa. Events include TEXT_MESSAGE_START, TOOL_CALL_START, TOOL_CALL_RESULT, STATE_SNAPSHOT, RUN_STARTED, RUN_FINISHED, and others. Each event has a defined shape, making the protocol self-documenting and statically verifiable.

SDK layer: TypeScript and Python packages that handle serialization, event dispatch, and connection management. The TypeScript SDK includes React hooks (useAgent, useAgentStream) that make it straightforward to build reactive UIs that respond to agent events. The Python SDK provides both client and server utilities.

Adapter layer: Pre-built adapters for popular agent frameworks — LangGraph, Mastra, AG2, CrewAI — that translate each framework’s native output into AG-UI events. Adding support for a new framework means writing one adapter, not modifying the protocol.

Key Capabilities

Framework interoperability: A frontend built on AG-UI can switch between LangGraph, CrewAI, or a custom agent backend without changing the UI code. The adapter layer handles translation.

Streaming-first design: Text arrives token by token, tool calls stream their progress, and state updates are pushed incrementally. The protocol is designed for real-time interfaces, not request-response polling.

State synchronization: Agents and frontends can share structured state — form fields, document content, configuration — through the protocol. Changes propagate bidirectionally, enabling collaborative interfaces where both the human and the agent edit the same artifact.

Tool rendering: When an agent calls a tool, the UI receives structured events describing the call, its arguments, and its result. This enables rich tool-call visualization — showing a code execution tool’s output, a search tool’s results, or a file-edit tool’s diff inline in the conversation.

Use Cases

Teams building agent-powered applications that need to support multiple agent backends. Developers creating reusable UI components for agent interactions. Organizations standardizing how agents communicate with their frontend platform. Framework authors who want their agents to work with any compliant UI without custom integration.

Considerations

AG-UI is a protocol, not a framework — it defines the contract but does not make architectural decisions about how agents work internally. Teams still choose their agent framework independently. The adapter ecosystem is growing but does not yet cover every framework. The protocol favors streaming interfaces; request-response-only use cases may not benefit as much.

Who It’s For

Frontend developers building UIs for AI agents. Backend teams shipping agent services that need a stable frontend contract. Platform teams standardizing agent integration across multiple products. Framework authors who want out-of-the-box UI compatibility.

Similar Agents