skillfed

ag-ui-protocol

ag-ui-protocol v0.1.19 7.4M downloads/30d#1,744 on PyPI
Permissive license MIT Active released

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-protocol

uv

uv add ag-ui-protocol

poetry

poetry add ag-ui-protocol

Installing 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

agent-user interaction protocolag-ui protocol python sdkstreaming event encodingagent server communicationpydantic event modelsserver-sent eventsmultimodal agent messages
agent-frameworkstreaming-eventsprotocol-sdk

More Application Frameworks packages