Agent-to-User Interaction (AG-UI) Protocol

Written by
Clara Bennett
Updated on:June-28th-2025
Recommendation

Explore innovative solutions for the Agent-to-User Interaction Protocol (AG-UI).

Core content:
1. The necessity and background of the AG-UI protocol
2. The integration issues of the agent toolkit solved by the AG-UI protocol
3. Technical details of the AG-UI protocol and SDK support

Yang Fangxian
Founder of 53AI/Most Valuable Expert of Tencent Cloud (TVP)

1 Agent-to-User Interaction (AG-UI) Protocol

In the Agent field:

1. MCP  standardizes the communication between Agent  and Tool  .


2. The A2A ( Agent2Agent  ) protocol standardizes Agent  to Agent  communication.


But there is still a piece missing ...


This is the protocol for agent-to-user communication:



Let’s understand why this is important.


2Why  is the problem behind the Agent-to-User Protocol ( AG-UI )?


Today, we can build powerful multi-step agent workflows using agent toolkits such as LangGraph , CrewAI , Mastra  , dify , AutoGen, Hiagent (Byte), etc.

However, when you try to introduce this agent  into a real application, things fall apart:


1.You want to stream LLM  responses token by token without building a custom WebSocket  server.


2.You want to display tool execution progress as it happens, pausing to get human feedback, without blocking or losing context.


3.You want to synchronize large, constantly changing objects, such as code or tables, without resending everything to the UI .


4.You want to allow the user to interrupt, cancel, or reply to the agent in progress without losing context.


Here is another question:


Each agent backend has its own tool invocation, ReAct  style planning, state diffing, and output formatting mechanisms.


So if you use LangGraph , your frontend will implement custom WebSocket  logic, messy JSON  formatting, and LangGraph  - specific UI  adapters.


But to migrate to CrewAI/Dify etc. , everything has to be adapted.


This will not scale.


3Solution  AG-  UI Agreement


AG-UI (Agent - User Interaction Protocol) is an open source protocol launched by CopilotKit  to solve this problem.


It standardizes the interaction layer between the backend agent and the frontend UI  (the green layer below).


Think of it this way:


1.Just like REST  is a standard for client to server requests ...


2.AG-UI  is a standard for streaming real-time agent updates back to the UI  .


Technically speaking ...


It uses Server Sent Events( SSE )Stream structured JSON  events to the front end.


Each event has an explicit payload (as keys in a Python  dictionary ), for example:


1.TEXT_MESSAGE_CONTENT is used for token streaming.


2.TOOL_CALL_START to show tool execution.


3.STATE_DELTA updates shared state (code, data, etc.)


4.AGENT_HANDOFFSmoothly transfer control between agents


And it comes with SDKs for TypeScript  and Python  , making this plug-and-play for any stack, like this:



In the above image, the response from the Agent  is not specific to any toolkit. It is a standardized AG-UI  response.


This means you need to write your backend logic once and hook it into AG-UI  and everything will work:


1.LangGraph , CrewAI , Mastra —  can all emit AG-UI  events.


2.The UI can be built using CopilotKit  components or your own React  stack .


3.You can swap GPT-4  for Llama-3/DeepSeek V3 locally without changing anything in the frontend.


This is the layer that makes your Agent  application feel like real software and not just a glorified chatbot.