The open protocol that connects any agent to any app.
Docs · Examples · Spec · Discord
AG-UI is an open, lightweight, event-based protocol that standardizes how AI agents connect to user-facing applications.
Agents don't fit the request/response model. They stream tokens, call tools mid-response, update shared state, pause for a human, and spawn subagents, and every framework does it differently. AG-UI replaces that custom wiring with one bi-directional event stream: the agent emits typed events, and any client can render them, no matter which framework built the agent. The same agent can power a web app, a mobile app, a terminal, or Slack.
Important
AG-UI 1.0 is here. The protocol now has a stable, frozen specification backed by a JSON Schema, and the TypeScript, Python, and .NET SDKs are generated from it. 1.0 is backwards compatible in both directions: 0.x agents work with 1.0 clients and vice versa.
Quick start
Start a new app. The CLI scaffolds a frontend (CopilotKit on Next.js, or a terminal client) wired to the agent framework you pick:
npx create-ag-ui-app@latest Then follow the printed next steps. The generated templates call OpenAI, so set your key before npm run dev:
export OPENAI_API_KEY="sk-..." An AG-UI agent is any HTTP endpoint that accepts a RunAgentInput and streams events back. No API keys needed for this one.
1. The agent (Python). Requires Python 3.9+.
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=") Limitations & Trade-offs
AG-UI may present challenges in managing overlapping event streams, as indicated by community discussions about unresolved pending_tool_calls. Users should ensure proper implementation to avoid such issues.
Originally published on GitTrending — Explore daily architectural deep-dives and quality scores for trending open-source GitHub projects.
![Motion Planning and Navigation — Ch.04: Optimization Based Planning [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqyrjjn7tc2h8vbe5rduk.png)
![Motion Planning and Navigation — Ch.05: Local Planners [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0tuhfqde1o6zcyskw7f4.png)
![Motion Planning and Navigation — Ch.07: Multi Robot Navigation [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwj9k0uan25q7slmyqpoo.png)
![Motion Planning and Navigation — Ch.10: Navigation2 Stack [KR]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6asnejhpxvcrd68qhrfg.png)
