# AG-UI Protocol

> An open, event-based protocol connecting AI agents to user-facing apps

- Category: App UIs & Builders / Generative UI SDKs
- Licence: MIT
- Repository: https://github.com/ag-ui-protocol/ag-ui
- Website: https://ag-ui.com
- Canonical page: https://ai-tldr.dev/tools/ag-ui-protocol/

## In short

AG-UI Protocol is an open, event-based protocol connecting AI agents to user-facing apps. It sits in the Generative UI SDKs category of the App UIs & Builders tools and is open-source, licensed MIT. To get started: scaffold a new app.

## Overview

AG-UI (the Agent-User Interaction Protocol) is an open, event-based standard for connecting AI agents to user-facing applications. During a run, agent backends emit events that match one of about 16 standard AG-UI event types, and they accept a small set of standard inputs, so a frontend can render streaming chat, state updates, and generative UI without bespoke glue code for each agent.

It is aimed at developers building in-app agent experiences who want one consistent contract between their agent backend and their UI. A middleware layer keeps it compatible across transports (SSE, WebSockets, webhooks) and allows loose event-format matching, so different agents and apps can interoperate. A reference HTTP implementation and a default connector help teams start quickly.

In the agentic protocol stack, AG-UI is complementary to MCP and A2A: MCP gives agents tools, A2A lets agents talk to other agents, and AG-UI brings agents into user-facing applications. It ships with SDKs and first-party or partner integrations for frameworks including LangGraph, CrewAI, Mastra, Pydantic AI, Agno, LlamaIndex, and the Claude Agent SDK.

## What it does

- Real-time agentic chat with token streaming
- Bi-directional state synchronization between agent and UI
- Generative UI and structured messages
- Real-time context enrichment from the running app
- Frontend tool integration and human-in-the-loop collaboration
- Transport-agnostic middleware (SSE, WebSockets, webhooks) with a reference HTTP implementation

## Getting started

The fastest way to start is the project scaffolder, which sets up an AG-UI application for you.

1. Scaffold a new app

   Run the create command to generate a new AG-UI application. It prompts you through the setup.

```bash
npx create-ag-ui-app my-agent-app
```

2. Explore integrations and demos

   Pick a supported framework (LangGraph, CrewAI, Mastra, Pydantic AI, Agno, LlamaIndex, Claude Agent SDK, and more) and try live feature demos in the AG-UI Dojo at dojo.ag-ui.com before wiring up your own backend.

3. Read the quickstart docs

   Follow the official quickstart at docs.ag-ui.com to connect your agent backend and emit AG-UI events to your frontend.

## When to use it

- Adding a streaming, agentic chat interface to a web app without writing custom event plumbing for each agent framework
- Keeping agent state and frontend state in sync so the UI reflects what the agent is doing in real time
- Rendering generative UI and structured messages emitted by an agent backend
- Standardizing the agent-to-frontend contract across multiple frameworks (e.g. LangGraph, CrewAI, Mastra) in one product
