ag-ui-protocol/ag-ui
AG-UI AGENT-USER INTERACTION PROTOCOL
Open event-based protocol for connecting AI agents to frontend applications. Standardizes bidirectional stream of typed events between agent and any client.
// KEY FEATURES
- Bidirectional stream of typed events between agent and client
- SDK for TypeScript, Python and .NET generated from JSON Schema
- One agent works with web, mobile apps, terminal and Slack
- CLI create-ag-ui-app scaffolds Next.js or terminal client project
// DEEP DIVE: HOW IT WORKS
AG-UI defines a single interaction protocol: the agent accepts RunAgentInput and returns an event stream (RunStarted, TextMessageContent, ToolCall, RunFinished, etc.). Transport is HTTP with Server-Sent Events or WebSocket; event encoding is described in JSON Schema from which SDKs for TypeScript, Python and .NET are generated. This eliminates the need to write adapters for each agent framework.
Unlike MCP (tools and context) and A2A (agent-to-agent), AG-UI focuses exclusively on the agent–user boundary. Protocol version 1.0 is frozen, backwards compatible with 0.x and covered by a migration guide. The ecosystem includes ready integrations with CopilotKit, LangGraph, CrewAI, Mastra, PydanticAI and others.
Running requires Node.js 20+ or Python 3.9+. The CLI `create-ag-ui-app` scaffolds a Next.js app with CopilotKit or a terminal client, pre-wired to the chosen framework. API keys (e.g., OpenAI) are set via environment variables. No specific hardware or OS requirements are mentioned in the README.
// USE CASES
Best for: Frontend and backend developers integrating AI agents into applications
- Connect one agent to web interface, mobile app and terminal simultaneously
- Replace custom WebSocket adapters with standard event-based protocol
- Rapidly prototype chat interface via CLI and swap agent framework without frontend changes
// QUICK START
npx create-ag-ui-app@latest
export OPENAI_API_KEY="sk-..."
npm run dev
pip install ag-ui-protocol fastapi uvicorn
uvicorn server:app --port 8000Commands are taken from the repository README — check the current version on GitHub before running.
New repositories every 30 minutes
REDDYX AI scans GitHub 24/7 and ships the best AI/ML/Web3 projects to Telegram.
Join on Telegram