AG-UI Protocol Explained: The Missing Frontend Layer After MCP & A2A (2026)
AgDex Engineering Editorial••14 min read•Agentic Protocols • Dec 2026
TL;DR: Why AG-UI 1.0 Completes the Agentic Protocol Stack
By late 2026, MCP standardized how agents call tools and A2A standardized how agents delegate tasks to each other—yet frontends were still glued together with brittle, framework-specific SSE hacks. AG-UI (Agent–User Interaction Protocol)—an MIT-licensed open standard with 22.3k GitHub stars, 31 typed events across 8 families, and native JSON Patch (RFC 6902) state synchronization—provides the missing runtime wire between backend agents and user-facing apps.
Modern agentic systems are no longer simple request-response chatbots. A single user prompt in a coding workspace, analytics dashboard, or enterprise copilot can trigger multi-minute reasoning, subagent delegation, tool execution, and mid-flight human approval. While Anthropic's Model Context Protocol (MCP) solved Agent ↔ Tools connectivity and Google's Agent-to-Agent (A2A) protocol solved Agent ↔ Agent orchestration, neither protocol was designed to manage the stateful, high-frequency, bi-directional UI loop between an agent and a human user.
Without a shared frontend wire standard, every team rebuilding an AI product ends up inventing proprietary JSON-over-SSE schemas for token streaming, tool-call progress, reasoning traces, and mutable UI state. Every time the backend migrates—for example from LangGraph to Google ADK, Mastra, CrewAI, or Pydantic AI—the React or mobile client breaks.
AG-UI 1.0 solves this exact boundary. Maintained as an MIT-licensed open protocol at ag-ui-protocol/ag-ui (22.3k stars, 2.1k forks, 168+ contributors), AG-UI sits cleanly alongside MCP and A2A so one agent can speak MCP to databases, A2A to peer agents, and AG-UI to the user interface.
2. AG-UI 1.0 Wire Architecture: 31 Events Across 8 Families
AG-UI is transport-agnostic: HTTP + Server-Sent Events (SSE) is the mandatory default binding for HTTP servers, with an optional binary HTTP + Protobuf binding and support for WebSockets, webhooks, or in-process pipes. Every message emitted by the agent conforms to a lightweight BaseEvent envelope containing a required type plus optional timestamp, rawEvent, metadata, and subagentRunId.
According to the AG-UI 1.0 specification, the protocol defines 31 typed events organized into 8 clean families:
Runs, Steps & Subagents: RUN_STARTED, RUN_FINISHED, RUN_ERROR, STEP_STARTED, STEP_FINISHED, plus SUBAGENT_STARTED, SUBAGENT_FINISHED, and SUBAGENT_ERROR for multi-agent attribution via subagentRunId.
Text & Reasoning Streams: TEXT_MESSAGE_START/CONTENT/END/CHUNK for assistant output, alongside REASONING_START/END, REASONING_MESSAGE_*, and REASONING_ENCRYPTED_VALUE (replacing deprecated THINKING_* events).
Tool Calls & Passthrough: TOOL_CALL_START, TOOL_CALL_ARGS, TOOL_CALL_END, TOOL_CALL_CHUNK, and TOOL_CALL_RESULT for backend or frontend tools, plus RAW and CUSTOM passthrough events.
State & Activity Snapshots: STATE_SNAPSHOT, STATE_DELTA, MESSAGES_SNAPSHOT, ACTIVITY_SNAPSHOT, and ACTIVITY_DELTA to synchronize rich application state without re-transmitting full payloads.
Because the wire contract is strictly typed across TypeScript (@ag-ui/[email protected]), Python (ag-ui-protocol), and .NET (AGUI.Client), frontend components can subscribe to lifecycle, reasoning, tool, and state events deterministically.
3. Shared State (RFC 6902), Human-in-the-Loop & Python SSE Server
Two capabilities separate AG-UI from basic LLM chat wrappers: incremental state synchronization and interruptible tool loops. Instead of forcing the agent to re-emit a 50 KB JSON document on every step, AG-UI emits an initial STATE_SNAPSHOT followed by compact STATE_DELTA arrays formatted as standard JSON Patch (RFC 6902) operations (add, remove, replace, move, copy, test).
On the server side, standing up a compliant AG-UI FastAPI endpoint takes under 35 lines of Python using ag_ui.core and EventEncoder. EventEncoder(accept=request.headers.get("accept")) automatically negotiates text/event-stream (SSE) or Protobuf based on the client's Accept header.
For Human-in-the-Loop (HITL) workflows—such as approving a production database migration or editing an email draft—the backend emits TOOL_CALL_START, streams arguments via TOOL_CALL_ARGS, and closes with TOOL_CALL_END. The frontend renders an interactive confirmation card, awaits user input, and sends the resulting TOOL_CALL_RESULT back on the next RunAgentInput turn.
On the client side, @ag-ui/[email protected] ships HttpAgent for Node.js 20+ and browser runtimes. You attach bearer headers, append user messages, and pass typed event callbacks such as onRunStartedEvent, onTextMessageContentEvent, and onRunFinishedEvent.
Following the Release 2026-11-17 (core 1.0.5 + @ag-ui/[email protected]), Release 2026-11-21 (ag_ui_adk==0.14.0, ag-ui-openai-agents==0.2.0), and Release 2026-11-27 (@ag-ui/[email protected], ag-ui-langgraph==0.1.0) updates, AG-UI now spans virtually every major agent runtime:
+─────────────────────────────────────────────────────────────────────────────────────────────────+
| Table 2: Frontend-to-Agent Transport Comparison (AG-UI 1.0 vs Alternatives) |
+──────────────────────────┬──────────────────────┬───────────────────────┬───────────────────────+
| Capability | Custom Ad-Hoc SSE | Raw WebSockets | AG-UI 1.0 Protocol |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Event Taxonomy | Proprietary JSON per | Unstandardized frames | 31 typed events across|
| | backend framework | & custom reconnects | 8 standard families |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Shared Mutable State | Re-send full JSON or | Manual diffing & | Native STATE_SNAPSHOT |
| | custom Redux actions | conflict handling | + STATE_DELTA RFC 6902|
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Frontend Tool & HITL | Fragile polling or | Custom RPC correlation| Built-in TOOL_CALL_* |
| Approval Loops | ad-hoc callbacks | IDs & state machines | & TOOL_CALL_RESULT |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Framework Portability | Rewritten per agent | Tightly coupled to | Official adapters for |
| | framework upgrade | socket server code | LangGraph/ADK/Mastra+ |
+──────────────────────────┴──────────────────────┴───────────────────────┴───────────────────────+
Supported frameworks include LangGraph, CrewAI, Google ADK, Microsoft Agent Framework, AWS Strands Agents, Mastra, Pydantic AI, LlamaIndex, Agno, AG2, Claude Agent SDK, OpenAI Agents SDK, Spring AI, and Cloudflare Agents—alongside community SDKs for Kotlin, Go, Java, Rust, Swift, and Dart.
5. AG-UI vs Generative UI Specs (A2UI, MCP Apps, Open-JSON-UI)
A common architectural misconception is treating AG-UI as a competitor to declarative UI schemas like Google's A2UI, OpenAI's Open-JSON-UI, or Microsoft & Shopify's MCP Apps. In reality, they operate at different layers of the stack:
Declarative UI Specs (What to Render): A2UI, MCP Apps, and Open-JSON-UI describe the layout, fields, and actions of dynamic widgets, cards, and interactive forms.
AG-UI Runtime Protocol (How It Streams & Syncs): AG-UI is the bi-directional transport and event loop that carries those declarative payloads alongside text tokens, reasoning traces, and RFC 6902 state deltas.
First-Class Middleware Support: The repository ships official bridges such as @ag-ui/[email protected] so teams can render A2UI or MCP Apps components directly inside CopilotKit, React, Angular, Vue, or terminal clients.
Think of AG-UI as the WebSocket/SSE nervous system, while A2UI or MCP Apps are the visual payload cards riding across it.
6. Production Deployment Checklist & Stack Integration
To adopt AG-UI 1.0 cleanly in production without rewriting your agent logic, follow this four-step rollout:
Step 1 — Scaffold or Add Core Packages: Use npx create-ag-ui-app@latest for new projects, or add @ag-ui/[email protected] and ag-ui-protocol to an existing frontend/backend pair.
Step 2 — Use Official Framework Middleware: Pick the native adapter for your orchestrator (e.g., ag-ui-langgraph==0.1.0, ag_ui_adk==0.14.0, or @ag-ui/[email protected]) instead of hand-rolling event encoders.
Step 3 — Isolate Subagent Events with subagentRunId: When delegating tasks over A2A or parallel worker graphs, tag nested events with subagentRunId so the UI can render collapsible subagent timelines cleanly.
Step 4 — Pair with MCP, A2A & Typed State Guards: Validate incoming RunAgentInput payloads and keep STATE_DELTA patches idempotent so client reconnects never corrupt shared UI state.
No. MCP connects agents to tools and data, A2A connects agents to other agents, and AG-UI connects agents to user-facing frontends. Production agents commonly run all three together.
Q2: Why does AG-UI default to HTTP + SSE instead of requiring WebSockets?
HTTP POST + SSE works seamlessly through corporate proxies, CDNs, serverless edge workers, and standard load balancers, while still allowing optional Protobuf or custom WebSocket bindings when ultra-low-latency binary streaming is required.
Q3: How does AG-UI prevent huge JSON payloads when agent state changes?
AG-UI pairs an initial STATE_SNAPSHOT with incremental STATE_DELTA events encoded as JSON Patch (RFC 6902) operations, transmitting only the exact keys or array indices that changed.
Q4: Which client frameworks and languages are supported?
Official SDKs cover TypeScript (@ag-ui/client), Python (ag-ui-protocol), and .NET (AGUI.Client), with CopilotKit UI integrations for React, Angular, Vue, and React Native, plus community SDKs for Kotlin, Go, Java, Rust, Swift, and Dart.
Protocolo AG-UI explicado: la capa frontend que faltaba tras MCP y A2A (2026)
Equipo Editorial de Ingeniería AgDex••14 min de lectura•Protocolos Agénticos • Dic 2026
Resumen ejecutivo: por qué AG-UI 1.0 completa el stack de protocolos
A finales de 2026, MCP estandarizó cómo los agentes invocan herramientas y A2A cómo delegan tareas entre sí, pero las interfaces seguían atadas con parches SSE propietarios. AG-UI (Agent–User Interaction Protocol)—estándar abierto bajo licencia MIT con 22.3k estrellas en GitHub, 31 eventos tipados en 8 familias y sincronización de estado con JSON Patch (RFC 6902)—provee el cableado en tiempo real entre agentes y aplicaciones.
Los sistemas agénticos modernos ya no son simples chats de petición-respuesta. Un solo prompt en un entorno de desarrollo o panel analítico puede disparar razonamiento prolongado, delegación a subagentes, ejecución de herramientas y aprobaciones humanas en medio del flujo. Aunque Model Context Protocol (MCP) de Anthropic resolvió Agente ↔ Herramientas y Agent-to-Agent (A2A) de Google resolvió Agente ↔ Agente, ninguno gestiona el bucle UI bidireccional y con estado entre agente y usuario.
Sin un estándar compartido para el frontend, cada equipo termina inventando esquemas JSON sobre SSE propios para streaming de tokens, progreso de herramientas, trazas de razonamiento y estado mutable. Cada vez que el backend migra—por ejemplo de LangGraph a Google ADK, Mastra, CrewAI o Pydantic AI—el cliente React o móvil se rompe.
AG-UI 1.0 resuelve exactamente esa frontera. Mantenido bajo licencia MIT en ag-ui-protocol/ag-ui (22.3k estrellas, 2.1k forks, 168+ colaboradores), AG-UI convive con MCP y A2A para que un mismo agente hable MCP con bases de datos, A2A con otros agentes y AG-UI con la interfaz.
2. Arquitectura AG-UI 1.0: 31 eventos en 8 familias
AG-UI es agnóstico al transporte: HTTP + Server-Sent Events (SSE) es el enlace obligatorio por defecto en servidores HTTP, con un enlace binario opcional HTTP + Protobuf y soporte para WebSockets, webhooks o pipes locales. Cada mensaje emitido por el agente sigue el sobre BaseEvent con type obligatorio y campos opcionales timestamp, rawEvent, metadata y subagentRunId.
Según la especificación AG-UI 1.0, el protocolo define 31 eventos tipados organizados en 8 familias:
Runs, Steps y Subagentes: RUN_STARTED, RUN_FINISHED, RUN_ERROR, STEP_STARTED, STEP_FINISHED, además de SUBAGENT_STARTED, SUBAGENT_FINISHED y SUBAGENT_ERROR con trazabilidad vía subagentRunId.
Streams de Texto y Razonamiento: TEXT_MESSAGE_START/CONTENT/END/CHUNK para la respuesta, junto con REASONING_START/END, REASONING_MESSAGE_* y REASONING_ENCRYPTED_VALUE (que reemplazan los eventos obsoletos THINKING_*).
Tool Calls y Passthrough: TOOL_CALL_START, TOOL_CALL_ARGS, TOOL_CALL_END, TOOL_CALL_CHUNK y TOOL_CALL_RESULT para herramientas de backend o frontend, más RAW y CUSTOM.
Snapshots de Estado y Actividad: STATE_SNAPSHOT, STATE_DELTA, MESSAGES_SNAPSHOT, ACTIVITY_SNAPSHOT y ACTIVITY_DELTA para sincronizar estado complejo sin reenviar payloads completos.
Al estar estrictamente tipado en TypeScript (@ag-ui/[email protected]), Python (ag-ui-protocol) y .NET (AGUI.Client), los componentes frontend se suscriben al ciclo de vida de forma determinista.
3. Estado compartido (RFC 6902), Human-in-the-Loop y servidor FastAPI
Dos capacidades distinguen a AG-UI de un simple chat LLM: la sincronización incremental de estado y los bucles de herramientas interrumpibles. En lugar de reenviar un JSON de 50 KB en cada paso, AG-UI envía un STATE_SNAPSHOT inicial seguido de compactos STATE_DELTA en formato estándar JSON Patch (RFC 6902) (add, remove, replace, move, copy, test).
En el servidor, levantar un endpoint FastAPI compatible con AG-UI requiere menos de 35 líneas usando ag_ui.core y EventEncoder. EventEncoder(accept=request.headers.get("accept")) negocia automáticamente text/event-stream (SSE) o Protobuf según la cabecera Accept.
Para flujos Human-in-the-Loop (HITL)—como aprobar una migración de base de datos o editar un borrador—el backend emite TOOL_CALL_START, transmite argumentos con TOOL_CALL_ARGS y cierra con TOOL_CALL_END. El frontend muestra la tarjeta de confirmación, espera al usuario y devuelve el TOOL_CALL_RESULT en el siguiente turno de RunAgentInput.
4. Cliente TypeScript HttpAgent y ecosistema de finales de 2026
En el cliente, @ag-ui/[email protected] incluye HttpAgent para Node.js 20+ y navegadores. Basta configurar la URL, cabeceras de autorización, añadir mensajes y registrar callbacks tipados como onRunStartedEvent, onTextMessageContentEvent y onRunFinishedEvent.
Tras las entregas Release 2026-11-17 (core 1.0.5 + @ag-ui/[email protected]), Release 2026-11-21 (ag_ui_adk==0.14.0, ag-ui-openai-agents==0.2.0) y Release 2026-11-27 (@ag-ui/[email protected], ag-ui-langgraph==0.1.0), AG-UI cubre prácticamente todo el ecosistema:
+─────────────────────────────────────────────────────────────────────────────────────────────────+
| Table 2: Frontend-to-Agent Transport Comparison (AG-UI 1.0 vs Alternatives) |
+──────────────────────────┬──────────────────────┬───────────────────────┬───────────────────────+
| Capability | Custom Ad-Hoc SSE | Raw WebSockets | AG-UI 1.0 Protocol |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Event Taxonomy | Proprietary JSON per | Unstandardized frames | 31 typed events across|
| | backend framework | & custom reconnects | 8 standard families |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Shared Mutable State | Re-send full JSON or | Manual diffing & | Native STATE_SNAPSHOT |
| | custom Redux actions | conflict handling | + STATE_DELTA RFC 6902|
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Frontend Tool & HITL | Fragile polling or | Custom RPC correlation| Built-in TOOL_CALL_* |
| Approval Loops | ad-hoc callbacks | IDs & state machines | & TOOL_CALL_RESULT |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Framework Portability | Rewritten per agent | Tightly coupled to | Official adapters for |
| | framework upgrade | socket server code | LangGraph/ADK/Mastra+ |
+──────────────────────────┴──────────────────────┴───────────────────────┴───────────────────────+
Incluye integraciones oficiales con LangGraph, CrewAI, Google ADK, Microsoft Agent Framework, AWS Strands Agents, Mastra, Pydantic AI, LlamaIndex, Agno, AG2, Claude Agent SDK, OpenAI Agents SDK, Spring AI y Cloudflare Agents, junto con SDKs comunitarios en Kotlin, Go, Java, Rust, Swift y Dart.
5. AG-UI frente a especificaciones de UI generativa (A2UI, MCP Apps)
Un error común es ver a AG-UI como competidor de esquemas declarativos de interfaz como A2UI (Google), Open-JSON-UI (OpenAI) o MCP Apps (Microsoft y Shopify). En realidad operan en capas complementarias:
Especificaciones UI declarativas (Qué renderizar): A2UI, MCP Apps y Open-JSON-UI describen la estructura, campos y acciones de tarjetas y formularios dinámicos.
Protocolo de ejecución AG-UI (Cómo fluye y sincroniza): AG-UI es el transporte bidireccional y bucle de eventos que transporta esos payloads junto con tokens, razonamiento y deltas RFC 6902.
Middleware oficial incluido: El repositorio incluye puentes como @ag-ui/[email protected] para renderizar componentes A2UI o MCP Apps en CopilotKit, React, Angular, Vue o terminal.
AG-UI actúa como el sistema nervioso de transporte SSE/Protobuf, mientras que A2UI o MCP Apps son las tarjetas visuales que viajan sobre él.
6. Checklist de despliegue en producción e integración
Para adoptar AG-UI 1.0 en producción sin reescribir la lógica de tus agentes, sigue estos cuatro pasos:
Paso 1 — Inicializar o instalar paquetes base: Usa npx create-ag-ui-app@latest en proyectos nuevos o añade @ag-ui/[email protected] y ag-ui-protocol a tu stack actual.
Paso 2 — Usar adaptadores oficiales del framework: Emplea el middleware nativo (ag-ui-langgraph==0.1.0, ag_ui_adk==0.14.0 o @ag-ui/[email protected]) en lugar de codificar eventos manualmente.
Paso 3 — Aislar subagentes con subagentRunId: Al delegar tareas vía A2A o grafos paralelos, etiqueta los eventos con subagentRunId para renderizar líneas de tiempo limpias.
Paso 4 — Combinar con MCP, A2A y validación de parches: Valida cada RunAgentInput entrante y mantén idempotentes los parches STATE_DELTA ante reconexiones.
No. MCP conecta agentes con herramientas y datos, A2A conecta agentes entre sí y AG-UI conecta agentes con la interfaz de usuario. En producción suelen usarse los tres juntos.
P2: ¿Por qué AG-UI usa HTTP + SSE por defecto en lugar de exigir WebSockets?
HTTP POST + SSE atraviesa sin fricción proxies corporativos, CDNs, edge workers y balanceadores estándar, permitiendo igualmente Protobuf o WebSockets cuando se requiere baja latencia binaria.
P3: ¿Cómo evita AG-UI reenviar JSON enormes cuando cambia el estado?
Combina un STATE_SNAPSHOT inicial con eventos incrementales STATE_DELTA en formato JSON Patch (RFC 6902), transmitiendo solo las claves o índices modificados.
P4: ¿Qué lenguajes y frameworks frontend son compatibles?
Los SDKs oficiales cubren TypeScript (@ag-ui/client), Python (ag-ui-protocol) y .NET (AGUI.Client), con integración CopilotKit para React, Angular, Vue y React Native, además de SDKs comunitarios en Kotlin, Go, Java, Rust, Swift y Dart.
AG-UI-Protokoll erklärt: Die fehlende Frontend-Schicht nach MCP & A2A (2026)
AgDex Engineering-Redaktion••14 Min. Lesezeit•Agentic Protocols • Dez 2026
Kurzfassung: Warum AG-UI 1.0 den Agenten-Protokollstack schließt
Ende 2026 hat MCP den Zugriff von Agenten auf Tools und A2A die Agent-zu-Agent-Delegation standardisiert – doch Frontends hingen weiterhin an fragilen, framework-spezifischen SSE-Hacks. AG-UI (Agent–User Interaction Protocol) – ein MIT-lizenziertes Open-Source-Protokoll mit 22.3k GitHub-Stars, 31 typisierten Events in 8 Familien und JSON Patch (RFC 6902) State-Sync – liefert die fehlende Laufzeitverbindung zwischen Agent und UI.
Moderne Agenten-Systeme sind keine einfachen Request-Response-Chatbots mehr. Ein einziger Prompt in einer IDE oder einem Analyse-Dashboard kann mehrminütiges Reasoning, Subagent-Delegation, Tool-Aufrufe und menschliche Freigaben auslösen. Während Anthropics Model Context Protocol (MCP)Agent ↔ Tools und Googles Agent-to-Agent (A2A)Agent ↔ Agent löste, verwaltet keines von beiden die zustandsbehaftete, bidirektionale UI-Schleife zum Nutzer.
Ohne einheitlichen Frontend-Standard baut jedes Team eigene JSON-über-SSE-Formate für Token-Streaming, Tool-Fortschritt, Reasoning-Traces und veränderlichen UI-State. Sobald das Backend von LangGraph zu Google ADK, Mastra, CrewAI oder Pydantic AI wechselt, bricht der React- oder Mobile-Client.
AG-UI 1.0 schließt genau diese Lücke. Als MIT-Projekt unter ag-ui-protocol/ag-ui (22.3k Stars, 2.1k Forks, 168+ Mitwirkende) ergänzt AG-UI bestehende Standards: Ein Agent nutzt MCP für Datenquellen, A2A für Partner-Agenten und AG-UI für das Frontend.
2. AG-UI 1.0 Wire-Architektur: 31 Events in 8 Familien
AG-UI ist transportagnostisch: HTTP + Server-Sent Events (SSE) ist das verpflichtende Standard-Binding für HTTP-Server, ergänzt durch optionales binäres HTTP + Protobuf sowie WebSockets, Webhooks oder In-Process-Pipes. Jedes Event nutzt den kompakten BaseEvent-Umschlag mit Pflichtfeld type sowie optional timestamp, rawEvent, metadata und subagentRunId.
Runs, Steps & Subagents: RUN_STARTED, RUN_FINISHED, RUN_ERROR, STEP_STARTED, STEP_FINISHED sowie SUBAGENT_STARTED, SUBAGENT_FINISHED und SUBAGENT_ERROR mit subagentRunId-Zuordnung.
Text- & Reasoning-Streams: TEXT_MESSAGE_START/CONTENT/END/CHUNK für Antworten sowie REASONING_START/END, REASONING_MESSAGE_* und REASONING_ENCRYPTED_VALUE (ersetzen veraltete THINKING_*-Events).
Tool Calls & Passthrough: TOOL_CALL_START, TOOL_CALL_ARGS, TOOL_CALL_END, TOOL_CALL_CHUNK und TOOL_CALL_RESULT für Backend- oder Frontend-Tools plus RAW und CUSTOM.
State- & Activity-Snapshots: STATE_SNAPSHOT, STATE_DELTA, MESSAGES_SNAPSHOT, ACTIVITY_SNAPSHOT und ACTIVITY_DELTA zur präzisen Synchronisation ohne Voll-Payloads.
Durch strikte Typisierung in TypeScript (@ag-ui/[email protected]), Python (ag-ui-protocol) und .NET (AGUI.Client) lassen sich UI-Komponenten deterministisch an den Agenten-Lebenszyklus binden.
3. Shared State (RFC 6902), Human-in-the-Loop & Python SSE-Server
Zwei Mechanismen heben AG-UI von simplen Chat-Wrappern ab: inkrementelle State-Synchronisation und unterbrechbare Tool-Loops. Statt bei jedem Schritt 50 KB JSON neu zu senden, überträgt AG-UI einen initialen STATE_SNAPSHOT gefolgt von schlanken STATE_DELTA-Arrays im Standardformat JSON Patch (RFC 6902) (add, remove, replace, move, copy, test).
Serverseitig genügt ein FastAPI-Endpunkt in unter 35 Zeilen Python mit ag_ui.core und EventEncoder. EventEncoder(accept=request.headers.get("accept")) verhandelt automatisch text/event-stream (SSE) oder Protobuf anhand des Accept-Headers.
Für Human-in-the-Loop (HITL) – etwa die Freigabe einer Datenbank-Migration – sendet das Backend TOOL_CALL_START, streamt Argumente per TOOL_CALL_ARGS und schließt mit TOOL_CALL_END. Das Frontend rendert eine Freigabekarte und sendet das TOOL_CALL_RESULT im nächsten RunAgentInput-Turn zurück.
4. TypeScript HttpAgent Client & Ökosystem Ende 2026
Clientseitig stellt @ag-ui/[email protected] den HttpAgent für Node.js 20+ und Browser bereit. URL und Auth-Header setzen, Nachricht hinzufügen und typisierte Callbacks wie onRunStartedEvent, onTextMessageContentEvent und onRunFinishedEvent übergeben.
Nach den Releases 2026-11-17 (Core 1.0.5 + @ag-ui/[email protected]), 2026-11-21 (ag_ui_adk==0.14.0, ag-ui-openai-agents==0.2.0) und 2026-11-27 (@ag-ui/[email protected], ag-ui-langgraph==0.1.0) deckt AG-UI nahezu jedes führende Framework ab:
+─────────────────────────────────────────────────────────────────────────────────────────────────+
| Table 2: Frontend-to-Agent Transport Comparison (AG-UI 1.0 vs Alternatives) |
+──────────────────────────┬──────────────────────┬───────────────────────┬───────────────────────+
| Capability | Custom Ad-Hoc SSE | Raw WebSockets | AG-UI 1.0 Protocol |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Event Taxonomy | Proprietary JSON per | Unstandardized frames | 31 typed events across|
| | backend framework | & custom reconnects | 8 standard families |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Shared Mutable State | Re-send full JSON or | Manual diffing & | Native STATE_SNAPSHOT |
| | custom Redux actions | conflict handling | + STATE_DELTA RFC 6902|
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Frontend Tool & HITL | Fragile polling or | Custom RPC correlation| Built-in TOOL_CALL_* |
| Approval Loops | ad-hoc callbacks | IDs & state machines | & TOOL_CALL_RESULT |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Framework Portability | Rewritten per agent | Tightly coupled to | Official adapters for |
| | framework upgrade | socket server code | LangGraph/ADK/Mastra+ |
+──────────────────────────┴──────────────────────┴───────────────────────┴───────────────────────+
Offiziell integriert sind LangGraph, CrewAI, Google ADK, Microsoft Agent Framework, AWS Strands Agents, Mastra, Pydantic AI, LlamaIndex, Agno, AG2, Claude Agent SDK, OpenAI Agents SDK, Spring AI und Cloudflare Agents – ergänzt durch Community-SDKs für Kotlin, Go, Java, Rust, Swift und Dart.
5. AG-UI vs. Generative UI Specs (A2UI, MCP Apps, Open-JSON-UI)
Häufig wird AG-UI fälschlich als Konkurrenz zu deklarativen UI-Schemas wie Googles A2UI, OpenAIs Open-JSON-UI oder Microsoft & Shopifys MCP Apps gesehen. Tatsächlich arbeiten sie auf unterschiedlichen Ebenen:
Deklarative UI-Specs (Was gerendert wird): A2UI, MCP Apps und Open-JSON-UI beschreiben Layout, Felder und Aktionen dynamischer Widgets und Formulare.
AG-UI Laufzeitprotokoll (Wie gestreamt & synchronisiert wird): AG-UI bildet den bidirektionalen Event-Kanal, der diese UI-Payloads zusammen mit Text-Tokens, Reasoning und RFC-6902-Deltas überträgt.
Offizielle Middleware-Brücken: Pakete wie @ag-ui/[email protected] binden A2UI- oder MCP-Apps-Komponenten direkt in CopilotKit, React, Angular, Vue oder CLI-Clients ein.
AG-UI ist das Transport-Nervensystem, während A2UI oder MCP Apps die visuellen Nutzlast-Karten darüber liefern.
6. Produktions-Checkliste & Stack-Integration
Für eine saubere Einführung von AG-UI 1.0 in Produktivsystemen empfiehlt sich dieses 4-Schritte-Vorgehen:
Schritt 1 — Projekt initialisieren oder Core-Pakete ergänzen: Starten Sie neu mit npx create-ag-ui-app@latest oder installieren Sie @ag-ui/[email protected] und ag-ui-protocol.
Nein. MCP verbindet Agenten mit Tools und Daten, A2A verbindet Agenten untereinander und AG-UI verbindet Agenten mit Benutzeroberflächen. Produktive Systeme kombinieren meist alle drei.
HTTP POST + SSE funktioniert problemlos über Unternehmens-Proxys, CDNs, Edge-Worker und Standard-Load-Balancer, lässt aber bei Bedarf binäres Protobuf oder WebSockets zu.
F3: Wie vermeidet AG-UI riesige JSON-Payloads bei State-Änderungen?
Ein initialer STATE_SNAPSHOT wird über kompakte STATE_DELTA-Events im Format JSON Patch (RFC 6902) aktualisiert – übertragen werden nur geänderte Pfade.
F4: Welche Client-Frameworks und Sprachen werden unterstützt?
Offizielle SDKs existieren für TypeScript (@ag-ui/client), Python (ag-ui-protocol) und .NET (AGUI.Client), mit CopilotKit-Integrationen für React, Angular, Vue und React Native sowie Community-SDKs für Kotlin, Go, Java, Rust, Swift und Dart.
بحلول أواخر عام 2026، وحّد بروتوكول MCP اتصال الوكيل بالأدوات ووحّد A2A تنسيق المهام بين الوكلاء—لكن الواجهات الأمامية ظلت تعتمد على ترقيعات SSE خاصة بكل إطار عمل. يقدّم AG-UI (Agent–User Interaction Protocol)—المعيار المفتوح بترخيص MIT مع 22.3k نجمة على GitHub و31 نوع حدث ضمن 8 عائلات ومزامنة حالة عبر JSON Patch (RFC 6902)—حلقة الوصل القياسية بين الوكلاء والتطبيقات.
لم تعد أنظمة الوكلاء الحديثة مجرد نوافذ دردشة بسيطة. فطلب واحد من المستخدم داخل بيئة برمجة أو لوحة تحليلات قد يطلق دقائق من الاستدلال، وتفويض وكلاء فرعيين، وتشغيل أدوات، وطلب موافقة بشرية في منتصف التنفيذ. وبينما عالج MCP من Anthropic ربط الوكيل بالأدوات وعالج A2A من Google التنسيق بين الوكلاء، لم يُصمم أي منهما لإدارة حلقة التفاعل ثنائية الاتجاه والمحافظة على الحالة مع المستخدم.
بدون معيار موحد للواجهة الأمامية، يضطر كل فريق إلى ابتكار صيغ JSON مخصصة فوق SSE لبث الرموز وتتبع الأدوات ومزامنة الحالة. وفي كل مرة يتغير فيها إطار الخلفية—مثلاً من LangGraph إلى Google ADK أو Mastra أو CrewAI أو Pydantic AI—تتعطل واجهة React أو تطبيق الجوال.
يعالج AG-UI 1.0 هذه الحدود بدقة. وبصفته بروتوكولاً مفتوح المصدر بترخيص MIT عبر ag-ui-protocol/ag-ui (22.3k نجمة و2.1k تفرع و168+ مساهماً)، يعمل AG-UI جنباً إلى جنب مع MCP وA2A ليتحدث الوكيل الواحد مع قواعد البيانات عبر MCP ومع الوكلاء عبر A2A ومع الواجهة عبر AG-UI.
2. معمارية AG-UI 1.0: 31 حدثاً ضمن 8 عائلات
بروتوكول AG-UI مستقل عن طبقة النقل: يُعد HTTP + Server-Sent Events (SSE) الربط الافتراضي الإلزامي لخوادم HTTP، مع دعم ربط ثنائي اختياري عبر HTTP + Protobuf وكذلك WebSockets والـ webhooks. يتبع كل حدث مغلفاً خفيفاً باسم BaseEvent يحتوي على الحقل الإلزامي type وحقول اختيارية مثل timestamp وrawEvent وmetadata وsubagentRunId.
وفق مواصفة AG-UI 1.0، يحدد البروتوكول 31 حدثاً مصنفاً في 8 عائلات:
التشغيل والخطوات والوكلاء الفرعيون: أحداث RUN_STARTED وRUN_FINISHED وRUN_ERROR وSTEP_STARTED وSTEP_FINISHED، إضافة إلى SUBAGENT_STARTED وSUBAGENT_FINISHED وSUBAGENT_ERROR عبر subagentRunId.
بث النصوص والاستدلال: أحداث TEXT_MESSAGE_START/CONTENT/END/CHUNK للنص، مع REASONING_START/END وREASONING_MESSAGE_* وREASONING_ENCRYPTED_VALUE بدلاً من أحداث THINKING_* القديمة.
استدعاء الأدوات والتمرير المباشر: أحداث TOOL_CALL_START وTOOL_CALL_ARGS وTOOL_CALL_END وTOOL_CALL_CHUNK وTOOL_CALL_RESULT لأدوات الخلفية أو الواجهة، إلى جانب RAW وCUSTOM.
لقطات الحالة والنشاط: أحداث STATE_SNAPSHOT وSTATE_DELTA وMESSAGES_SNAPSHOT وACTIVITY_SNAPSHOT وACTIVITY_DELTA لمزامنة حالة التطبيق دون إعادة إرسال الحمولات كاملة.
ونظراً لأن العقد البرمجي معرف بدقة عبر TypeScript (@ag-ui/[email protected]) وPython (ag-ui-protocol) و.NET (AGUI.Client)، يمكن لمكونات الواجهة الاشتراك في دورة حياة الوكيل بشكل حتمي.
3. الحالة المشتركة (RFC 6902) والتدخل البشري وخادم Python SSE
يميز AG-UI عن أغلفة الدردشة البسيطة ميزتان أساسيتان: المزامنة التزايدية للحالة وحلقات الأدوات القابلة للمقاطعة. بدلاً من إجبار الوكيل على إعادة إرسال مستند JSON بحجم 50 كيلوبايت في كل خطوة، يرسل AG-UI لقطة أولية STATE_SNAPSHOT تتبعها تحديثات STATE_DELTA بصيغة JSON Patch (RFC 6902) القياسية (add، remove، replace، move، copy، test).
على جانب الخادم، يتطلب بناء نقطة نهاية FastAPI متوافقة مع AG-UI أقل من 35 سطراً من Python باستخدام ag_ui.core وEventEncoder. حيث يتفاوض EventEncoder(accept=request.headers.get("accept")) تلقائياً بين text/event-stream (SSE) وProtobuf بناءً على ترويسة Accept.
وفي مسارات التدخل البشري (HITL)—مثل اعتماد ترحيل قاعدة بيانات—يبث الخادم TOOL_CALL_START ثم المعاملات عبر TOOL_CALL_ARGS ثم TOOL_CALL_END، فتُظهر الواجهة بطاقة تأكيد وتعيد النتيجة عبر TOOL_CALL_RESULT في جولة RunAgentInput التالية.
4. عميل TypeScript HttpAgent ومنظومة أواخر 2026
على جانب العميل، يوفر @ag-ui/[email protected] الفئة HttpAgent لبيئات Node.js 20+ والمتصفحات. يكفي تمرير عنوان الخادم وترويسات التفويض وإضافة رسائل المستخدم مع دوال استدعاء مثل onRunStartedEvent وonTextMessageContentEvent وonRunFinishedEvent.
عقب إصدارات Release 2026-11-17 (النواة 1.0.5 + @ag-ui/[email protected]) وRelease 2026-11-21 (ag_ui_adk==0.14.0، ag-ui-openai-agents==0.2.0) وRelease 2026-11-27 (@ag-ui/[email protected]، ag-ui-langgraph==0.1.0)، بات البروتوكول يغطي معظم المنصات:
+─────────────────────────────────────────────────────────────────────────────────────────────────+
| Table 2: Frontend-to-Agent Transport Comparison (AG-UI 1.0 vs Alternatives) |
+──────────────────────────┬──────────────────────┬───────────────────────┬───────────────────────+
| Capability | Custom Ad-Hoc SSE | Raw WebSockets | AG-UI 1.0 Protocol |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Event Taxonomy | Proprietary JSON per | Unstandardized frames | 31 typed events across|
| | backend framework | & custom reconnects | 8 standard families |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Shared Mutable State | Re-send full JSON or | Manual diffing & | Native STATE_SNAPSHOT |
| | custom Redux actions | conflict handling | + STATE_DELTA RFC 6902|
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Frontend Tool & HITL | Fragile polling or | Custom RPC correlation| Built-in TOOL_CALL_* |
| Approval Loops | ad-hoc callbacks | IDs & state machines | & TOOL_CALL_RESULT |
+──────────────────────────┼──────────────────────┼───────────────────────┼───────────────────────+
| Framework Portability | Rewritten per agent | Tightly coupled to | Official adapters for |
| | framework upgrade | socket server code | LangGraph/ADK/Mastra+ |
+──────────────────────────┴──────────────────────┴───────────────────────┴───────────────────────+
تشمل التكاملات الرسمية كلاً من LangGraph وCrewAI وGoogle ADK وMicrosoft Agent Framework وAWS Strands Agents وMastra وPydantic AI وLlamaIndex وAgno وAG2 وClaude Agent SDK وOpenAI Agents SDK وSpring AI وCloudflare Agents، مع حزم مجتمعية للغات Kotlin وGo وJava وRust وSwift وDart.
5. مقارنة AG-UI مع مواصفات الواجهات التوليدية (A2UI وMCP Apps)
من المفاهيم الخاطئة الشائعة اعتبار AG-UI منافساً لمخططات الواجهات التصريحية مثل A2UI من Google أو Open-JSON-UI من OpenAI أو MCP Apps من Microsoft وShopify. في الواقع، يعمل كل منها في طبقة مختلفة:
بروتوكول تشغيل AG-UI (كيف يتدفق ويتزامن): يمثل AG-UI قناة النقل ثنائية الاتجاه التي تحمل تلك الحمولات جنباً إلى جنب مع بث النصوص والاستدلال وتحديثات RFC 6902.
جسر وسطي رسمي جاهز: يوفر المستودع حزماً مثل @ag-ui/[email protected] لعرض مكونات A2UI أو MCP Apps مباشرة داخل CopilotKit وReact وAngular وVue أو الطرفية.
يمكن تشبيه AG-UI بالجهاز العصبي للنقل عبر SSE/Protobuf، بينما تمثل A2UI وMCP Apps بطاقات العرض المرئية التي تنتقل عبره.
6. قائمة فحص النشر الإنتاجي والتكامل
لاعتماد AG-UI 1.0 في بيئة الإنتاج دون إعادة كتابة منطق الوكلاء، اتبع هذه الخطوات الأربع:
الخطوة 1 — تهيئة المشروع أو تثبيت الحزم الأساسية: استخدم npx create-ag-ui-app@latest للمشاريع الجديدة، أو أضف @ag-ui/[email protected] وag-ui-protocol لتطبيقك الحالي.
الخطوة 2 — استخدام محولات الأطر الرسمية: اعتمد المحول الرسمي لإطارك مثل ag-ui-langgraph==0.1.0 أو ag_ui_adk==0.14.0 أو @ag-ui/[email protected] بدلاً من كتابة مرمّز أحداث يدوياً.
الخطوة 3 — عزل الوكلاء الفرعيين عبر subagentRunId: عند تفويض المهام عبر A2A أو تنفيذ رسوم بيانية متوازية، وسّم الأحداث بمعرّف subagentRunId لعرض خط زمني منظم.
الخطوة 4 — الدمج مع MCP وA2A وحماية دلتا الحالة: تحقق من صحة حمولات RunAgentInput واجعل رقع STATE_DELTA متكافئة التكرار (idempotent) عند إعادة الاتصال.
لا. يربط MCP الوكلاء بالأدوات والبيانات، ويربط A2A الوكلاء ببعضهم، بينما يربط AG-UI الوكلاء بواجهة المستخدم. تعتمد الأنظمة الإنتاجية على الثلاثة معاً.
س2: لماذا يعتمد AG-UI على HTTP + SSE افتراضياً بدلاً من فرض WebSockets؟
يعمل HTTP POST + SSE بسلاسة عبر وكلاء الشبكات المؤسسية وشبكات CDN وموازنات الأحمال القياسية، مع إتاحة Protobuf أو WebSockets اختيارياً عند الحاجة لزمن استجابة ثنائي فائق الانخفاض.
س3: كيف يتجنب AG-UI إرسال حمولات JSON ضخمة عند تغير الحالة؟
يدمج AG-UI بين لقطة أولية STATE_SNAPSHOT وأحداث STATE_DELTA التزايدية بصيغة JSON Patch (RFC 6902) لإرسال المفاتيح أو الفهارس المتغيرة فقط.
س4: ما اللغات وأطر الواجهة المدعومة؟
تغطي الحزم الرسمية TypeScript (@ag-ui/client) وPython (ag-ui-protocol) و.NET (AGUI.Client)، مع دعم CopilotKit لـ React وAngular وVue وReact Native، إضافة لحزم مجتمعية لـ Kotlin وGo وJava وRust وSwift وDart.
We use cookies to improve your experience and analyze traffic. Privacy Policy