ag-ui-protocol
What it is and what it does
ag-ui-protocol is a Python SDK that implements the Agent-User Interaction Protocol, providing strongly-typed Pydantic models for representing agent-server communication events and user messages. It handles encoding these structures with automatic camelCase conversion for frontend compatibility, and supports multimodal content including text, images, audio, video, and documents.
You would use this package when building a Python backend for an agent application that needs to stream real-time events to a frontend client following the AG-UI specification. The package abstracts away protocol details and serialization concerns, letting you work with idiomatic Python types while ensuring your messages conform to the expected wire format.
Use it for:
- Build a Python agent server that streams events to a web frontend in real time.
- Encode multimodal user input into AG-UI-compliant message structures for agent processing.
- Implement Server-Sent Events streaming with automatic JSON serialization.
- Validate agent event payloads at runtime using Pydantic's type checking.
- Integrate with agent frameworks that need to emit AG-UI protocol events.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides strongly-typed Python data structures and event encoding for building servers compatible with the Agent-User Interaction (AG-UI) Protocol, with Pydantic validation and automatic camelCase serialization.
Yes, if you are building a Python agent server that must communicate with an AG-UI-compatible frontend. The package has low install friction, active maintenance, permissive MIT licensing, and no known vulnerabilities. The pre-1.0 version number warrants attention to release notes before upgrading, but the core offering is solid for its stated purpose.
Install
ag-ui-protocol on PyPI
pip
pip install ag-ui-protocoluv
uv add ag-ui-protocolpoetry
poetry add ag-ui-protocolInstalling ag-ui-protocol
Before you install
Low install friction with a single runtime dependency (pydantic). Package is actively maintained with recent releases; supports current Python versions.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
pip install ag-ui-protocol
from ag_ui_protocol import TextMessageContentEvent, EventType, EventEncoder
event = TextMessageContentEvent(
type=EventType.TEXT_MESSAGE_CONTENT,
message_id="msg_123",
delta="Hello from Python!"
)
encoder = EventEncoder()
sse_data = encoder.encode(event)
Requires Python 3.9 or later.
Verify before relying
- Whether the 16 core event types cover all use cases for your specific agent architecture.
- Performance characteristics and throughput limits for high-frequency streaming scenarios.
- Stability guarantees given the package is at version 0.1.19 (pre-1.0).
- Exact module structure and import paths for core types and encoder utilities.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pydantic |
| Maintenance | actively maintained — 73 days since the last release |
| First released | |
| Downloads | 7,407,094/month — #1,744 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ag_ui_protocol-0.1.19-py3-none-any.whl
Tags
More Application Frameworks packages
FastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
textualTextual is a Python framework for building…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
mcpBuild and connect to Model Context Protocol…
permissive · top 1,000 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
ag_ui_adkBridges Google ADK agents to the AG-UI…
permissive · top 15,000 on PyPI
ag-ui-langgraphBridges LangGraph agent workflows to the AG-UI…
permissive · top 15,000 on PyPI
agent-framework-ag-uiConnects Agent Framework agents and workflows…
permissive · top 15,000 on PyPI
aiohttp-sse-clientProvides an async Python client for consuming…
permissive · top 15,000 on PyPI
pydantic-aiPydantic AI is a Python framework for building…
permissive · top 5,000 on PyPI
langchain-protocolProvides Python type definitions (TypedDict,…
permissive · top 1,000 on PyPI
aiohttp-sse-client2Provides an async Python client for consuming…
permissive · top 15,000 on PyPI
aegra-apiAegra API is a self-hosted Agent Protocol…
permissive · top 15,000 on PyPI
fasta2aFastA2A converts an AI agent into an…
permissive · top 15,000 on PyPI
pydantic-deepA Python framework and terminal assistant for…
permissive · top 15,000 on PyPI