Overview
The Agent User Interaction Protocol Client SDK provides agent connectivity options for AI systems. This package builds on the core types and events to deliver flexible connection methods to agent implementations.
cargo add ag-ui-clientAgent Trait
Agent is the trait to implement for custom agent
connectivity. Implementing run() lets you bridge your
own service or agent implementation to AG-UI.
- Configuration - Setup with agent ID, messages, and state
- Core Methods - Run, abort, and clone functionality
- Protected Methods - Extensible hooks for custom implementations
- Properties - State and message tracking
Trait for creating custom agent connections
HttpAgent
Agent implementation for HTTP-based agent connectivity:
- Configuration - URL and header setup
- Methods - HTTP-specific execution and cancellation
- Protected Methods - Customizable HTTP request handling
- Properties - Connection management
Ready-to-use HTTP implementation for agent connectivity, using a highly efficient event encoding format
AgentSubscriber
Event-driven subscriber system for handling agent lifecycle events and state mutations during agent execution:
- Event Handlers - Lifecycle, message, tool call, and state events
- State Management - Mutation control and propagation handling
- Usage Examples - Logging, persistence, and error handling patterns
- Integration - Registering and using subscribers with agents
Comprehensive event system for reactive agent interaction and middleware-style functionality
