ag-ui-protocol
AG-UI (Agent-User Interaction) protocol reference for building AI agent frontends. Use when implementing AG-UI events (RUN_STARTED, TEXT_MESSAGE_*, TOOL_CALL_*, STATE_*), building agents that communicate with frontends, implementing streaming responses, state management with snapshots/deltas, tool call lifecycles, or debugging AG-UI event flows.
How do I install this agent skill?
npx skills add https://github.com/meetsmore/use-ai --skill ag-ui-protocolIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides comprehensive documentation for the AG-UI (Agent-User Interaction) protocol, standardizing communication between AI agents and frontends. It includes architectural diagrams, event specifications, and implementation guides. No security issues were detected; findings related to data ingestion are inherent to the protocol's purpose and include standard safety mechanisms like JSON Schema validation.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
- Runlayerwarn
13/13 files flagged
What does this agent skill do?
AG-UI Protocol
The Agent-User Interaction (AG-UI) Protocol is an open, lightweight, event-based protocol that standardizes how AI agents connect to user-facing applications.
When to Use This Skill
Use this skill when:
- Implementing AG-UI protocol events in your code
- Building agents that communicate with frontends via AG-UI
- Understanding the event types and their structure
- Implementing state management, tool calls, or message streaming
- Debugging AG-UI event flows
Documentation
See the docs/2025-11-27/ directory for complete AG-UI protocol documentation:
introduction.md- Protocol overview and integrationsconcepts/architecture.md- Core architecture and designconcepts/events.md- Event types and patternsconcepts/messages.md- Message structure and typesconcepts/state.md- State management and synchronizationconcepts/tools.md- Tool definitions and lifecycleconcepts/agents.md- Agent implementationconcepts/middleware.md- Middleware patternsconcepts/serialization.md- Event serialization and compactionquickstart/introduction.md- Getting started guidequickstart/server.md- Server implementationquickstart/clients.md- Client implementation
Quick Reference
Event Types
enum EventType {
// Lifecycle
RUN_STARTED = "RUN_STARTED",
RUN_FINISHED = "RUN_FINISHED",
RUN_ERROR = "RUN_ERROR",
STEP_STARTED = "STEP_STARTED",
STEP_FINISHED = "STEP_FINISHED",
// Text Messages
TEXT_MESSAGE_START = "TEXT_MESSAGE_START",
TEXT_MESSAGE_CONTENT = "TEXT_MESSAGE_CONTENT",
TEXT_MESSAGE_END = "TEXT_MESSAGE_END",
// Tool Calls
TOOL_CALL_START = "TOOL_CALL_START",
TOOL_CALL_ARGS = "TOOL_CALL_ARGS",
TOOL_CALL_END = "TOOL_CALL_END",
// State
STATE_SNAPSHOT = "STATE_SNAPSHOT",
STATE_DELTA = "STATE_DELTA",
MESSAGES_SNAPSHOT = "MESSAGES_SNAPSHOT",
// Custom
RAW = "RAW",
CUSTOM = "CUSTOM",
}
Event Patterns
- Start-Content-End: Streams content incrementally (text, tool arguments)
- Snapshot-Delta: State synchronization using complete snapshots + JSON Patch updates
- Lifecycle: Run monitoring with mandatory start/end events
Message Roles
user- User messages (text and multimodal)assistant- AI responses (text and tool calls)system- Instructions or contexttool- Tool execution resultsactivity- Progress updatesdeveloper- Internal debugging
Tool Definition Structure
interface Tool {
name: string; // Unique identifier
description: string; // Purpose explanation
parameters: JSONSchema; // Accepted arguments
}
Tool Call Lifecycle
TOOL_CALL_START- Initiates with unique IDTOOL_CALL_ARGS- Streams JSON argumentsTOOL_CALL_END- Marks completion
State Synchronization
- STATE_SNAPSHOT - Complete state replacement
- STATE_DELTA - Incremental JSON Patch (RFC 6902) updates
Source
Documentation downloaded from: https://github.com/ag-ui-protocol/ag-ui/tree/main/docs
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/meetsmore/use-ai/ag-ui-protocol">View ag-ui-protocol on skillZs</a>