Concepts / agent ↔ user interface

AG-UI changing

Agent–User Interaction Protocol · CopilotKit and agent framework partners; open source

Spec
open spec · SDKs for major frameworks
Published
Reviewed

What it is

AG-UI fills the gap between an agent that runs on a server and the app a person is looking at. It defines a single stream of typed events so any frontend can render any agent’s progress, and send input back, without the two being built together. CopilotKit published it in May 2025 with LangGraph, CrewAI, Mastra, Pydantic AI and other frameworks as launch partners.

How it works

The frontend POSTs a run request with the message history and current state. The backend answers with a stream of events over SSE or a binary channel. Event types cover:

  • Lifecycle: run started, run finished, step started, step finished.
  • Text: message start, content chunk, message end.
  • Tool calls: start, argument chunks, end, result.
  • State: full snapshots and JSON Patch deltas, so the UI mirrors the agent’s working state.
  • Custom events for anything else.

Because state flows both ways, the user can edit something mid-run and the agent sees it. That is the basis for human-in-the-loop approvals in the UI.

When to use it

You are building a product UI on top of an agent and do not want the frontend coupled to one framework. If you are building for a code editor, use ACP instead. If you need the agent to describe what UI to show, pair AG-UI with A2UI.

Watch out for

  • AG-UI is the transport. It does not tell you what the UI looks like.
  • The spec is versioned by SDK release rather than dated spec revisions. Pin your SDK.

Related

Sources

  1. AG-UI overview
  2. AG-UI on GitHub
  3. AG-UI and A2UI: understanding the differences

Suggest a fix to this page →