Skip to main content

ag-ui-client

The Java Client SDK provides agent connectivity options for AI systems. It builds on the core types and events to deliver flexible connection methods to agent implementations.

AbstractAgent

AbstractAgent is the base agent class for implementing custom agent connectivity. Extend this class and implement run to bridge your service to AG-UI.
  • Configuration — agent ID, messages, and state
  • Core Methods — runAgent, subscribe, message/state helpers
  • Protected Methods — event handling hooks
  • Properties — state and message tracking

AbstractAgent Reference

Base class for creating custom agent connections

HttpAgent

Concrete implementation for HTTP-based agent connectivity using an injected BaseHttpClient implementation.
  • Configuration — agentId, threadId, httpClient
  • Methods — run via HTTP streaming, close
  • Builder — fluent configuration with validation

HttpAgent Reference

Ready-to-use HTTP implementation for agent connectivity

AgentSubscriber

Event-driven subscriber system for handling agent lifecycle events and state mutations during execution.
  • Event Handlers — lifecycle, message, tool call, and state events
  • Usage Examples — logging, persistence, error handling patterns
  • Integration — register and use subscribers with agents

AgentSubscriber Reference

Comprehensive event system for reactive agent interaction