Skip to content

AG-UI (Agent User Interface) agents connect to remote HTTP endpoints that implement the AG-UI protocol, enabling integration of any AG-UI compatible server into the AgentPool pool.

Overview

AG-UI is a protocol for building agent interfaces that provides:

  • HTTP-based communication: Simple REST endpoints for agent interaction
  • Streaming support: Real-time response streaming
  • Standardized interface: Consistent API across different agent implementations

AG-UI agents are useful for:

  • Integrating existing AG-UI compatible services
  • Building distributed agent architectures
  • Connecting to remote agent deployments
  • Testing with locally spawned servers

Configuration Reference

AG-UI Agent Configuration

Configuration for AG-UI protocol agents.

AG-UI agents connect to remote HTTP endpoints that implement the AG-UI protocol, enabling integration of any AG-UI compatible server into the agentpool pool.

Example:

agents:
  remote_assistant:
    type: agui
    endpoint: http://localhost:8000/agent/run
    timeout: 30.0
    headers:
      X-API-Key: ${API_KEY}
    tools:
      - import_path: mymodule.my_tool_function

  managed_agent:
    endpoint: http://localhost:8765/agent/run
    startup_command: "uv run ag-ui-server config.yml"
    tools:
      - import_path: package.tool_one
      - import_path: package.tool_two

AG-UI Agent Configuration (YAML)
type: agui  # Top-level discriminator for agent type.
endpoint: http://localhost:8000/agent/run  # HTTP endpoint for the AG-UI agent server.
timeout: 60.0  # Request timeout in seconds.
headers: {}  # Additional HTTP headers to send with requests.
startup_command: null  # Optional shell command to start the AG-UI server automatically.
startup_delay: 0.0  # Extra seconds to wait after starting the server.
startup_timeout: 30.0  # Seconds to wait until the server accepts connections on the endpoint's host and port.
tools: []  # Tools to expose to the remote agent for client-side execution.
requires_tool_confirmation: per_tool  # How to handle tool confirmation:
hooks:  # Hooks for intercepting and customizing agent behavior at key lifecycle points.
  pre_run: []  # Hooks executed before agent.run() processes a prompt.
  post_run: []  # Hooks executed after agent.run() completes.
  pre_tool_use: []  # Hooks executed before a tool is called. Can block or modify the call.
  post_tool_use: []  # Hooks executed after a tool completes.
environment: null  # Execution environment config for the agent's own toolsets.
name: null  # Identifier for the node. Set from dict key, not from YAML.
display_name: null  # Human-readable display name for the node.
description: null  # Optional description of the agent / team.
triggers: []  # Event sources that activate this agent / team
connections: []  # Targets to forward results to.
mcp_servers: []  # List of MCP server configurations:
input_provider: null  # Provider for human-input-handling.
event_handlers: []  # Event handlers for processing agent stream events.

Basic Usage

agents:
  remote_assistant:
    type: agui
    endpoint: http://localhost:8000/agent/run
    timeout: 30.0
    headers:
      X-API-Key: ${API_KEY}

  managed_agent:
    type: agui
    endpoint: http://localhost:8765/agent/run
    startup_command: "uv run agentpool serve-agui config.yml --port 8765"
    startup_timeout: 30.0

Configuration Notes

  • The endpoint field specifies the HTTP URL for the AG-UI agent server
  • Use headers for authentication tokens or custom routing headers
  • Environment variables can be used in header values: ${VAR_NAME}
  • When startup_command is provided, AgentPool will spawn the server process
  • The server process is automatically terminated when the agent pool closes
  • AgentPool waits up to startup_timeout seconds until the server accepts connections; startup_delay adds extra seconds after that
  • The timeout setting controls the maximum time for agent responses