--- id: ag-ui-protocol version: "0.1.19" license: MIT license_treatment: permissive maintenance: active --- # ag-ui-protocol License: permissive · Maintenance: active · Downloads: 7.4M/mo ## 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 above — 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 pip install ag-ui-protocol uv add ag-ui-protocol 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_current - Install friction: low - Maintenance: active - Downloads: 7.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags agent-user interaction protocol, ag-ui protocol python sdk, streaming event encoding, agent server communication, pydantic event models, server-sent events, multimodal agent messages, agent-framework, streaming-events, protocol-sdk [View on SkillFed](https://skillfed.io/packages/ag-ui-protocol) · [View on PyPI](https://pypi.org/project/ag-ui-protocol/)