Table of Contents
Open Table of Contents
Why This Repo, Why Now
Checking github.com/trending today, the top repository is ag-ui-protocol/ag-ui — described in its README as “an open, lightweight, event-based protocol that standardizes how AI agents connect to user-facing applications.”
The problem it targets is one every team building agent-powered products runs into: agents don’t fit the request/response model. They stream tokens, call tools mid-response, update shared state, pause for a human to approve or reject a step, and spawn subagents — and per the README, “every framework does it differently.” AG-UI replaces custom, framework-specific wiring with a single bi-directional event stream: the agent emits typed events, and any client renders them, regardless of which framework built the agent. That means the same agent backend can power a web app, a mobile app, a terminal, or Slack without rewriting the integration layer each time.
Part of why it’s resonating now is the README’s note that AG-UI 1.0 recently shipped — a stable, frozen specification backed by a JSON Schema, with TypeScript, Python, and .NET SDKs generated directly from it, and documented backwards compatibility in both directions between 0.x and 1.0. The README also states the protocol is “adopted by Google, Microsoft, Amazon, and Oracle, and built into most agent frameworks,” including LangChain, CrewAI, Mastra, Google ADK, Pydantic AI, and AWS Strands Agents. As always, a trending position reflects visibility and momentum at a point in time, not an independent verdict on quality, security, or production-readiness — those are reviewed separately below.
What the Technology Actually Is
Per the project’s README and spec, AG-UI is a protocol with official SDKs in three languages:
- TypeScript —
npm install @ag-ui/client, the primary client-side SDK (source). - Python —
pip install ag-ui-protocol, used to build agent-side servers (source). - .NET —
dotnet add package AGUI.Client(source).
Community SDKs also exist for Kotlin, Go, Java, Dart, Rust, Ruby, C++, and Swift.
Documented architectural pieces:
- A single request,
RunAgentInput. A client starts a run by sending the agent one payload: the conversation, the tools the frontend offers, shared state, and context. - 31 typed events across eight families. Per the README’s event reference, the agent streams back events from: run lifecycle (
RUN_STARTED,RUN_FINISHED,RUN_ERROR,STEP_STARTED,STEP_FINISHED), text messages, tool calls, state (STATE_SNAPSHOT,STATE_DELTAvia JSON Patch,MESSAGES_SNAPSHOT), reasoning, activity, subagents, and passthrough (RAW,CUSTOM). Only the run lifecycle events are required, so a minimal agent can emit a handful of events and grow from there. - Transport-agnostic. The spec defines an HTTP + SSE binding and a binary HTTP + Protobuf binding; middleware can adapt events from other sources.
- Complementary to MCP and A2A. Per the README’s protocol-stack diagram, MCP gives agents tools and context, A2A lets agents coordinate with other agents, and AG-UI is the layer that brings an agent to the user-facing app. A single agent commonly uses all three.
- Framework middleware, not a framework itself. AG-UI ships integrations and middleware (in
integrations/andmiddlewares/) for LangChain, CrewAI, Mastra, Google ADK, Microsoft Agent Framework, Pydantic AI, AWS Strands Agents, LlamaIndex, Agno, AG2, Claude Agent SDK, and others, rather than requiring a rewrite of the agent itself.
At a high level, any HTTP endpoint that accepts a RunAgentInput and streams back typed events over SSE (or Protobuf) is a valid AG-UI agent — the README’s own 30-line Python/FastAPI example demonstrates this directly, with a matching TypeScript HttpAgent client consuming the stream.
Purpose and Use Cases
Per the README, AG-UI’s primary purpose is standardizing agent-to-frontend communication so that teams building agent UIs don’t have to hand-roll a custom streaming protocol per framework.
Documented use cases and target users:
- Streaming chat — token-by-token messages across multi-turn sessions, with cancel and resume, demoed live in the AG-UI Dojo.
- Generative UI — agents render typed components, or declarative UI via A2UI and MCP Apps payloads carried over AG-UI.
- Shared state — a typed store the agent and app both read and write, synced via snapshots and JSON Patch deltas.
- Frontend tools — the agent calls tools that execute in the app itself and gets the result back.
- Human in the loop — runs can end with an
interruptoutcome; the user approves, edits, or rejects, and the next run resumes from that point. - Reasoning and subagents — surfacing an agent’s reasoning trace, including encrypted reasoning round-trips, and nested delegation where every event is attributed to the subagent run that produced it.
- Multimodal input — images, audio, video, and documents in user input and tool results.
Target users are frontend, platform, and AI/agent engineering teams building production chat or copilot-style interfaces on top of agent frameworks like LangChain, CrewAI, Mastra, Google ADK, or Pydantic AI, who want the frontend (React, mobile, Slack/Teams, or terminal) decoupled from whichever agent framework or model the backend happens to use.
Installation
Per the README’s Quick start section, the maintainers document a CLI scaffold as the primary path, with a manual protocol walkthrough as an alternative.
Prerequisites
- Node.js 20+ for the TypeScript client and CLI scaffold.
- Python 3.9+ if building a Python-based agent server with the
ag-ui-protocolpackage. - An API key for whichever model provider the scaffolded template calls (the generated templates call OpenAI by default).
Recommended: scaffold a new app with the CLI
npx create-ag-ui-app@latest
This scaffolds a frontend (CopilotKit on Next.js, or a terminal client) wired to the agent framework you pick. Follow the printed next steps, then set the required key before starting the dev server:
export OPENAI_API_KEY="sk-..."
Minimal getting-started example: a 30-line agent server and client
Per the README, an AG-UI agent is any HTTP endpoint that accepts a RunAgentInput and streams events back — no API keys required for this example.
1. The agent (Python).
pip install ag-ui-protocol fastapi uvicorn
# server.py
import uuid
from fastapi import FastAPI, Request
from fastapi.responses import StreamingResponse
from ag_ui.core import (
PROTOCOL_VERSION,
RunAgentInput,
RunStartedEvent,
RunFinishedEvent,
TextMessageStartEvent,
TextMessageContentEvent,
TextMessageEndEvent,
)
from ag_ui.encoder import EventEncoder
app = FastAPI()
@app.post("/")
async def run_agent(input_data: RunAgentInput, request: Request):
encoder = EventEncoder(accept=request.headers.get("accept"))
async def events():
yield encoder.encode(RunStartedEvent(
thread_id=input_data.thread_id,
run_id=input_data.run_id,
protocol_version=PROTOCOL_VERSION,
))
message_id = str(uuid.uuid4())
yield encoder.encode(TextMessageStartEvent(message_id=message_id, role="assistant"))
for chunk in ["Hello ", "from ", "AG-UI!"]:
yield encoder.encode(TextMessageContentEvent(message_id=message_id, delta=chunk))
yield encoder.encode(TextMessageEndEvent(message_id=message_id))
yield encoder.encode(RunFinishedEvent(thread_id=input_data.thread_id, run_id=input_data.run_id))
return StreamingResponse(events(), media_type=encoder.get_content_type())
uvicorn server:app --port 8000
2. The client (TypeScript), in a second terminal and a new folder.
npm init -y && npm pkg set type=module
npm install @ag-ui/client tsx
// client.ts
import { HttpAgent } from "@ag-ui/client";
const agent = new HttpAgent({ url: "http://localhost:8000/" });
agent.addMessage({
id: crypto.randomUUID(),
role: "user",
content: "Hi there!",
});
await agent.runAgent(
{},
{
onRunStartedEvent: ({ event }) =>
console.log(`run started (AG-UI ${event.protocolVersion})`),
onTextMessageContentEvent: ({ event }) => {
process.stdout.write(event.delta);
},
onRunFinishedEvent: () => console.log("\nrun finished"),
}
);
npx tsx client.ts
Quick Verification
Based on documented steps in the README:
- CLI scaffold runs —
npx create-ag-ui-app@latestshould print setup prompts and complete without error, confirming the CLI resolves. - Manual server/client pair — running the Python server above with
uvicorn server:app --port 8000, thennpx tsx client.tsin a second terminal, should printrun started (AG-UI 1.0...)followed by the streamed textHello from AG-UI!and finallyrun finished. This exact output is what the README documents as the expected result. - Live reference demos — the AG-UI Dojo hosts live demos of every feature (streaming chat, generative UI, shared state, human-in-the-loop, reasoning, subagents, multimodal) per framework, usable as a working reference to compare against a local setup.
Security Review
Verified from the repository itself (README, SECURITY.md, LICENSE, and the tags/releases list):
- The project publishes a
SECURITY.md, directing vulnerability reports tosecurity@copilotkit.aiand asking reporters not to discuss vulnerability details publicly before a fix ships. It documents a response process: acknowledgment within 48 hours, investigation within 5 business days, and a target fix/mitigation within 30 days of confirmation. - The project is licensed MIT (LICENSE), permissive and compatible with most commercial and open-source use.
- The repository has near-daily tagged releases (
release/2026-11-13,release/2026-11-12,release/2026-11-10,release/2026-11-09, and further back, per the tags list), consistent with active, ongoing maintenance rather than a dormant project. - AG-UI 1.0 is documented as a frozen specification backed by a JSON Schema, with the TypeScript, Python, and .NET SDKs generated from it — reducing the risk of hand-written SDK drift from the spec, and the README documents explicit two-way backwards compatibility between 0.x agents/1.0 clients and vice versa.
- No install script,
postinstallhook, or elevated/root privilege requirement is documented for the SDKs themselves; they are standard npm/pip/NuGet packages. The only privileged surface mentioned anywhere is for contributors (Node.js 20, per.node-version), not for consumers of the published packages. - The protocol is explicitly transport-agnostic and backend-agnostic: a project brings its own HTTP server (FastAPI, any Node server, etc.), so the actual network exposure, authentication, and secrets handling for any given deployment are entirely the responsibility of whoever implements the agent server — AG-UI itself does not define or enforce an authentication scheme.
Security considerations to weigh yourself (documented factors, not verified vulnerabilities):
- Because AG-UI defines the event protocol but not authentication, any production agent server built on it needs its own auth, rate limiting, and input validation layered on top — none of that comes from adopting the protocol itself.
- The quick-start Python/FastAPI example in the README has no authentication, CORS policy, or input sanitization — it’s explicitly a minimal demo, not a production-ready server template.
npx create-ag-ui-app@latestscaffolds a project that calls an external LLM provider (OpenAI by default) using an API key set as an environment variable; teams should treat that key with the same care as any other production secret.- As with any protocol adopted by major vendors (Google, Microsoft, Amazon, Oracle per the README), the breadth of integrations in
integrations/andmiddlewares/means the attack surface of a given deployment depends heavily on which third-party framework integration is used, not on AG-UI’s core SDK alone.
Practical recommendations:
- Pin
@ag-ui/client,ag-ui-protocol, orAGUI.Clientto a specific version in your dependency manifest rather than trackinglatest, and review release notes before upgrading. - Never deploy the README’s minimal FastAPI example as-is in production; add authentication, input validation, and rate limiting to any publicly reachable agent endpoint.
- Keep LLM provider API keys (e.g.,
OPENAI_API_KEY) out of source control and manage them through your existing secrets manager, not hardcoded or committed.envfiles. - Review which third-party framework integration (LangChain, CrewAI, Mastra, etc.) you adopt independently, since each carries its own dependency tree and security posture separate from AG-UI’s core SDKs.
- Report suspected vulnerabilities through the documented
security@copilotkit.aichannel perSECURITY.md, rather than filing a public issue. - Test any new agent framework integration in an isolated environment before exposing it to real user traffic, standard practice for any new protocol adoption regardless of this project’s track record.
Should You Use It?
Strengths: a genuinely open, documented, versioned specification (1.0 is frozen and schema-backed) rather than a single vendor’s proprietary SDK; broad adoption across major agent frameworks (LangChain, CrewAI, Mastra, Google ADK, Pydantic AI, AWS Strands, and more) and cited use by Google, Microsoft, Amazon, and Oracle; explicit backwards compatibility between 0.x and 1.0; a transport-agnostic design (SSE and Protobuf) that doesn’t lock a team into one network stack; a documented, responsive vulnerability-reporting process; an MIT license; and a near-daily release cadence showing active maintenance.
Limitations: AG-UI defines the event protocol only — authentication, authorization, rate limiting, and input validation for any given deployment are entirely left to the implementer, so adopting the protocol does not itself make an agent server secure; the README’s own quick-start example is a bare, unauthenticated demo; and because the protocol surface spans many third-party framework integrations, the actual security posture of a real deployment depends as much on the chosen framework integration as on AG-UI’s core SDKs.
Good fit for: teams building agent-powered chat, copilot, or generative-UI products who want the frontend decoupled from the agent framework and model provider; organizations already using one of the supported frameworks (LangChain, CrewAI, Mastra, Google ADK, Pydantic AI, AWS Strands, and others) that want a standard streaming contract instead of custom per-framework glue; and teams that need the same agent backend to power multiple surfaces (web, mobile, Slack/Teams, terminal) without re-implementing the integration layer for each.
Evaluate alternatives if: your team needs a single vendor-managed, fully hosted agent-UI solution with authentication and infrastructure included out of the box rather than a protocol you implement yourself; you’re not using (and don’t plan to use) any of the supported agent frameworks, making the integration benefit moot; or your use case doesn’t need streaming, shared state, or human-in-the-loop interrupts and a simple request/response API would be sufficient.
Primary sources used: GitHub repository · README · AG-UI 1.0 spec · Migration guide · SECURITY.md · LICENSE · Tags/Releases · AG-UI Dojo