Skip to main content

Pydantic-AI based Multi-Agent Framework with YAML-based Agents, Teams, Workflows & Extended ACP / AGUI integration

Project description

AgentPool

PyPI License Package status Monthly downloads Python version Github Stars

A unified agent orchestration hub that lets you configure and manage heterogeneous AI agents via YAML and expose them through standardized protocols.

Documentation

The Problem

You want to use multiple AI agents together - Claude Code for refactoring, Codex for code editing with advanced reasoning, a custom analysis agent, maybe Goose for specific tasks. But each has different APIs, protocols, and integration patterns. Coordinating them means writing glue code for each combination.

The Solution

AgentPool acts as a protocol bridge. Define all your agents in one YAML file - whether they're native (PydanticAI-based), direct integrations (Claude Code, Codex), external ACP agents (Goose), or AG-UI agents. Then expose them all through ACP or AG-UI protocols, letting them cooperate, delegate, and communicate through a unified interface.

flowchart TB
    subgraph AgentPool
        subgraph config[YAML Configuration]
            native[Native Agents<br/>PydanticAI]
            direct[Direct Integrations<br/>Claude Code, Codex]
            acp_agents[ACP Agents<br/>Goose, etc.]
            agui_agents[AG-UI Agents]
            workflows[Teams & Workflows]
        end
        
        subgraph interface[Unified Agent Interface]
            delegation[Inter-agent delegation]
            routing[Message routing]
            context[Shared context]
        end
        
        config --> interface
    end
    
    interface --> acp_server[ACP Server]
    interface --> opencode_server[OpenCode Server]
    interface --> agui_server[AG-UI Server]
    
    acp_server --> clients1[Zed, Toad, ACP Clients]
    opencode_server --> clients2[OpenCode TUI/Desktop]
    agui_server --> clients3[AG-UI Clients]

Quick Start

uv tool install agentpool

Minimal Configuration

# agents.yml
agents:
  assistant:
    type: native
    model: openai:gpt-4o
    system_prompt: "You are a helpful assistant."
# Run via CLI
agentpool run assistant "Hello!"

# Or start as ACP server (for Zed, Toad, etc.)
agentpool serve-acp agents.yml

Integrating External Agents

The real power comes from mixing agent types:

agents:
  # Native PydanticAI-based agent
  coordinator:
    type: native
    model: openai:gpt-4o
    tools:
      - type: subagent  # Can delegate to all other agents
    system_prompt: "Coordinate tasks between available agents."

  # Claude Code agent (direct integration)
  claude:
    type: claude_code
    description: "Claude Code for complex refactoring"

  # Codex agent (direct integration)
  codex:
    type: codex
    model: gpt-5.1-codex-max
    reasoning_effort: medium
    description: "Codex for code editing with advanced reasoning"

  # ACP protocol agents
  goose:
    type: acp
    provider: goose
    description: "Goose for file operations"

  # AG-UI protocol agent
  agui_agent:
    type: agui
    url: "http://localhost:8000"
    description: "Custom AG-UI agent"

Now coordinator can delegate work to any of these agents, and all are accessible through the same interface.

Key Features

Multi-Agent Coordination

Agents can form teams (parallel) or chains (sequential):

teams:
  review_pipeline:
    mode: sequential
    members: [analyzer, reviewer, formatter]

  parallel_coders:
    mode: parallel
    members: [claude, goose]
async with AgentPool("agents.yml") as pool:
    # Parallel execution
    team = pool.get_agent("analyzer") & pool.get_agent("reviewer")
    results = await team.run("Review this code")

    # Sequential pipeline
    chain = analyzer | reviewer | formatter
    result = await chain.run("Process this")

Rich YAML Configuration

Everything is configurable - models, tools, connections, triggers, storage:

agents:
  analyzer:
    type: native
    model:
      type: fallback
      models: [openai:gpt-4o, anthropic:claude-sonnet-4-0]
    tools:
      - type: subagent
      - type: resource_access
    mcp_servers:
      - "uvx mcp-server-filesystem"
    knowledge:
      paths: ["docs/**/*.md"]
    connections:
      - type: node
        name: reporter
        filter_condition:
          type: word_match
          words: [error, warning]

Server Protocols

AgentPool can expose your agents through multiple server protocols:

Server Command Use Case
ACP agentpool serve-acp IDE integration (Zed, Toad) - bidirectional communication with tool confirmations
OpenCode agentpool serve-opencode OpenCode TUI/Desktop - supports remote filesystems via fsspec
MCP agentpool serve-mcp Expose tools to other agents
AG-UI agentpool serve-agui AG-UI compatible frontends
OpenAI API agentpool serve-api Drop-in OpenAI API replacement

The ACP server is ideal for IDE integration - it provides real-time tool confirmations and session management. The OpenCode server enables the OpenCode TUI to control AgentPool agents, including agents operating on remote environments (Docker, SSH, cloud sandboxes).

Additional Capabilities

  • Structured Output: Define response schemas inline or import Python types
  • Storage & Analytics: Track all interactions with configurable providers
  • File Abstraction: UPath-backed operations work on local and remote sources
  • Triggers: React to file changes, webhooks, or custom events
  • Streaming TTS: Voice output support for all agents

Usage Patterns

CLI

agentpool run agent_name "prompt"           # Single run
agentpool serve-acp config.yml              # ACP server for IDEs
agentpool serve-opencode config.yml         # OpenCode TUI server
agentpool serve-mcp config.yml              # MCP server
agentpool watch --config agents.yml         # React to triggers
agentpool history stats --group-by model    # View analytics

Programmatic

from agentpool import AgentPool

async with AgentPool("agents.yml") as pool:
    agent = pool.get_agent("assistant")

    # Simple run
    result = await agent.run("Hello")

    # Streaming
    async for event in agent.run_stream("Tell me a story"):
        print(event)

    # Multi-modal
    result = await agent.run("Describe this", Path("image.jpg"))

Documentation

For complete documentation including advanced configuration, connection patterns, and API reference, visit phil65.github.io/agentpool.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentpool-2.9.18.tar.gz (10.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agentpool-2.9.18-py3-none-any.whl (11.1 MB view details)

Uploaded Python 3

File details

Details for the file agentpool-2.9.18.tar.gz.

File metadata

  • Download URL: agentpool-2.9.18.tar.gz
  • Upload date:
  • Size: 10.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentpool-2.9.18.tar.gz
Algorithm Hash digest
SHA256 bdc7baaa4b32739580cb69035e208af83edc7a666261598cac6a24ffec93ec10
MD5 fff85c60767b938d042c65d3908fba69
BLAKE2b-256 dd0423b1164d0780788a8db7492c064085d03a07e7fd1bf2f9748c229d692a2f

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentpool-2.9.18.tar.gz:

Publisher: build.yml on phil65/agentpool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agentpool-2.9.18-py3-none-any.whl.

File metadata

  • Download URL: agentpool-2.9.18-py3-none-any.whl
  • Upload date:
  • Size: 11.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for agentpool-2.9.18-py3-none-any.whl
Algorithm Hash digest
SHA256 700fab909c69b30fb02c2f62c31184dc0a699cd6c49d3b34e37c0d7d9c4cb287
MD5 e079337ae47e80a3d92539fe654b4a3e
BLAKE2b-256 f38fa4e55ae4b302f237b3fce46060177a18f55ec0c104ece59806aa55ae0a43

See more details on using hashes here.

Provenance

The following attestation bundles were made for agentpool-2.9.18-py3-none-any.whl:

Publisher: build.yml on phil65/agentpool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page