Skip to content

Latest commit

History

7,388 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

AgentPool

PyPI LicensePackage statusMonthly downloadsPython versionGithub 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]
Loading

Quick Start

uv tool install agentpool

Minimal Configuration

# agents.ymlagents:
assistant:
type: nativemodel: openai:gpt-4osystem_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 agentcoordinator:
type: nativemodel: openai:gpt-4otools:
- type: subagent # Can delegate to all other agentssystem_prompt: "Coordinate tasks between available agents."# Claude Code agent (direct integration)claude:
type: claude_codedescription: "Claude Code for complex refactoring"# Codex agent (direct integration)codex:
type: codexmodel: gpt-5.1-codex-maxreasoning_effort: mediumdescription: "Codex for code editing with advanced reasoning"# ACP protocol agentsgoose:
type: acpprovider: goosedescription: "Goose for file operations"# AG-UI protocol agentagui_agent:
type: aguiurl: "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: sequentialmembers: [analyzer, reviewer, formatter]parallel_coders:
mode: parallelmembers: [claude, goose]
asyncwithAgentPool("agents.yml") aspool:
# Parallel executionteam=pool.get_agent("analyzer") &pool.get_agent("reviewer")
results=awaitteam.run("Review this code")
# Sequential pipelinechain=analyzer|reviewer|formatterresult=awaitchain.run("Process this")

Rich YAML Configuration

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

agents:
analyzer:
type: nativemodel:
type: fallbackmodels: [openai:gpt-4o, anthropic:claude-sonnet-4-0]tools:
- type: subagent
- type: resource_accessmcp_servers:
- "uvx mcp-server-filesystem"knowledge:
paths: ["docs/**/*.md"]connections:
- type: nodename: reporterfilter_condition:
type: word_matchwords: [error, warning]

Server Protocols

AgentPool can expose your agents through multiple server protocols:

ServerCommandUse Case
ACPagentpool serve-acpIDE integration (Zed, Toad) - bidirectional communication with tool confirmations
OpenCodeagentpool serve-opencodeOpenCode TUI/Desktop - supports remote filesystems via fsspec
MCPagentpool serve-mcpExpose tools to other agents
AG-UIagentpool serve-aguiAG-UI compatible frontends
OpenAI APIagentpool serve-apiDrop-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

fromagentpoolimportAgentPoolasyncwithAgentPool("agents.yml") aspool:
agent=pool.get_agent("assistant")
# Simple runresult=awaitagent.run("Hello")
# Streamingasyncforeventinagent.run_stream("Tell me a story"):
print(event)
# Multi-modalresult=awaitagent.run("Describe this", Path("image.jpg"))

Documentation

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

About

A unified agent orchestration hub that lets you configure and manage multiple AI agents (native, ACP, AGUI, Claude Code) via YAML, and exposes them through standardized protocols (ACP/OpenCode Server).

Topics

Resources

Stars

183 stars

Watchers

6 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages