Skip to main content

Documentation Index

Fetch the complete documentation index at: https://agno-v2-fix-deploy-docs-restructure.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

AG-UI (Agent-User Interaction Protocol) is an open, event-based protocol for connecting AI agents to frontend applications. Unlike messaging platforms that require app setup and webhooks, AG-UI is code-first. Run your agent and connect any compatible frontend.
from agno.agent.agent import Agent
from agno.models.openai import OpenAIChat
from agno.os import AgentOS
from agno.os.interfaces.agui import AGUI

agent = Agent(
    name="Assistant",
    model=OpenAIChat(id="gpt-4o"),
    instructions="You are a helpful assistant.",
    markdown=True,
)

agent_os = AgentOS(
    agents=[agent],
    interfaces=[AGUI(agent=agent)],
)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="agent:app", port=9001)
Install the dependency: uv pip install 'agno[agui]'

The Protocol Stack

AG-UI is one layer of a three-protocol stack adopted by AWS, Google, Microsoft, and major AI frameworks:
ProtocolPurpose
MCPAgents ↔ Tools & Data
A2AAgents ↔ Agents
AG-UIAgents ↔ Users
MCP connects agents to external tools. A2A enables cross-agent coordination. AG-UI delivers real-time, interactive experiences to users.

Quick Start

1

Run your agent

python agui_agent.py
Your agent is available at http://localhost:9001/agui.
2

Connect a frontend

Clone and run Dojo locally:
git clone https://github.com/ag-ui-protocol/ag-ui.git
cd ag-ui/typescript-sdk && pnpm install
cd ../integrations/agno && pnpm run build
Open http://localhost:3000 and connect to http://localhost:9001/agui.
dojo.ag-ui.com is a hosted demo. It cannot connect to localhost.

Features

AG-UI provides bidirectional streaming between your agent and the frontend:
FeatureDescription
Live streamingToken-by-token responses with cancel/resume
Tool executionFrontend displays tool calls, arguments, and results
Reasoning tracesChain-of-thought from reasoning models
Generative UIStatic and declarative UI rendering from agent output
State syncBidirectional agent ↔ app state with conflict resolution
Human-in-the-loopPause, approve, edit, or retry before actions
MultimodalFiles, images, audio, and transcripts
Custom eventsStream structured data to the frontend
Custom events let you stream structured data (customer profiles, search results, charts) in real time. See Custom Events.

User Identification

Pass user_id via forwarded_props from your frontend:
{
  "thread_id": "session-123",
  "forwarded_props": {
    "user_id": "user@example.com"
  },
  "messages": [...]
}
The agent receives this in run_context.user_id for per-user memory and credentials.

Developer Resources