Metadata-Version: 2.4
Name: agentpool
Version: 2.6.4
Summary: Pydantic-AI based Multi-Agent Framework with YAML-based Agents, Teams, Workflows & Extended ACP / AGUI integration
Keywords: 
Author: Philipp Temminghoff
Author-email: Philipp Temminghoff <philipptemminghoff@googlemail.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Pydantic
Classifier: Framework :: Pydantic :: 2
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Documentation
Classifier: Topic :: Internet
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Dist: anyenv[httpx]>=0.3.0
Requires-Dist: clawd-code-sdk>=0.1.19
Requires-Dist: docler>=1.0.3
Requires-Dist: docstring-parser>=0.17.0
Requires-Dist: epregistry
Requires-Dist: evented>=1.0.5
Requires-Dist: exxec>=0.1.0
Requires-Dist: fastapi
Requires-Dist: fastmcp>=2.12.4
Requires-Dist: fsspec
Requires-Dist: httpx
Requires-Dist: jinja2
Requires-Dist: jinjarope
Requires-Dist: keyring>=25.6.0
Requires-Dist: llmling-models>=1.4.1
Requires-Dist: logfire[fastapi]
Requires-Dist: mcp>=1.2.0
Requires-Dist: pillow>=11.3.0
Requires-Dist: platformdirs
Requires-Dist: promptantic>=0.4.5
Requires-Dist: psygnal>=0.11.1
Requires-Dist: pydantic>=2.10.0
Requires-Dist: pydantic-ai-slim[openai,google,anthropic,mistral,retries]>=1.0.0
Requires-Dist: pydocket>=0.16.1
Requires-Dist: python-dotenv>=1.0.1
Requires-Dist: rich
Requires-Dist: schemez[codegen]
Requires-Dist: searchly[all]>=2.0.1
Requires-Dist: slashed>=0.1.0
Requires-Dist: sqlalchemy[aiosqlite]
Requires-Dist: sqlmodel>=0.0.22
Requires-Dist: structlog>=25.5.0
Requires-Dist: sublime-search>=0.1.2
Requires-Dist: tokonomics>=0.1.2
Requires-Dist: toprompt>=0.0.1
Requires-Dist: typer
Requires-Dist: upathtools[httpx]>=0.1.0
Requires-Dist: uvicorn[standard]
Requires-Dist: watchfiles>=1.1.1
Requires-Dist: websockets>=15.0
Requires-Dist: yamling>=2.0.2
Requires-Dist: fasta2a ; extra == 'a2a'
Requires-Dist: starlette ; extra == 'a2a'
Requires-Dist: ag-ui-protocol>=0.1.10 ; extra == 'ag-ui'
Requires-Dist: braintrust ; extra == 'braintrust'
Requires-Dist: autoevals ; extra == 'braintrust'
Requires-Dist: copykitten ; extra == 'clipboard'
Requires-Dist: rustworkx>=0.17.1 ; extra == 'coding'
Requires-Dist: grep-ast ; extra == 'coding'
Requires-Dist: ast-grep-py>=0.40.0 ; extra == 'coding'
Requires-Dist: tree-sitter>=0.25.2 ; extra == 'coding'
Requires-Dist: tree-sitter-python>=0.25.0 ; extra == 'coding'
Requires-Dist: tree-sitter-c>=0.24.1 ; extra == 'coding'
Requires-Dist: tree-sitter-javascript>=0.25.0 ; extra == 'coding'
Requires-Dist: tree-sitter>=0.25.2 ; extra == 'coding'
Requires-Dist: tree-sitter-typescript>=0.23.0 ; extra == 'coding'
Requires-Dist: tree-sitter-cpp>=0.23.0 ; extra == 'coding'
Requires-Dist: tree-sitter-rust>=0.23.0 ; extra == 'coding'
Requires-Dist: tree-sitter-go>=0.23.0 ; extra == 'coding'
Requires-Dist: tree-sitter-json>=0.24.0 ; extra == 'coding'
Requires-Dist: tree-sitter-yaml>=0.6.0 ; extra == 'coding'
Requires-Dist: composio ; extra == 'composio'
Requires-Dist: evented[all] ; extra == 'events'
Requires-Dist: fsspec[git] ; extra == 'git'
Requires-Dist: langfuse ; extra == 'langfuse'
Requires-Dist: markitdown ; python_full_version < '3.14' and extra == 'markitdown'
Requires-Dist: fastembed>=0.7.4 ; python_full_version < '3.14' and extra == 'mcp-discovery'
Requires-Dist: lancedb>=0.26.0 ; python_full_version < '3.14' and extra == 'mcp-discovery'
Requires-Dist: pyarrow>=19.0.0 ; python_full_version < '3.14' and extra == 'mcp-discovery'
Requires-Dist: mcpx-py>=0.7.0 ; extra == 'mcp-run'
Requires-Dist: apprise>=1.9.5 ; extra == 'notifications'
Requires-Dist: promptlayer ; extra == 'promptlayer'
Requires-Dist: textual>=1.0.0 ; extra == 'textual'
Requires-Dist: tiktoken ; extra == 'tiktoken'
Requires-Dist: anyvoice[tts-edge,openai]>=0.0.2 ; extra == 'tts'
Requires-Dist: zstandard>=0.23.0 ; extra == 'zed'
Requires-Python: >=3.13
Project-URL: Code coverage, https://app.codecov.io/gh/phil65/agentpool
Project-URL: Discussions, https://github.com/phil65/agentpool/discussions
Project-URL: Documentation, https://phil65.github.io/agentpool/
Project-URL: Issues, https://github.com/phil65/agentpool/issues
Project-URL: Source, https://github.com/phil65/agentpool
Provides-Extra: a2a
Provides-Extra: ag-ui
Provides-Extra: braintrust
Provides-Extra: clipboard
Provides-Extra: coding
Provides-Extra: composio
Provides-Extra: events
Provides-Extra: git
Provides-Extra: langfuse
Provides-Extra: markitdown
Provides-Extra: mcp-discovery
Provides-Extra: mcp-run
Provides-Extra: notifications
Provides-Extra: promptlayer
Provides-Extra: textual
Provides-Extra: tiktoken
Provides-Extra: tts
Provides-Extra: zed
Description-Content-Type: text/markdown

# AgentPool

[![PyPI License](https://img.shields.io/pypi/l/agentpool.svg)](https://pypi.org/project/agentpool/)
[![Package status](https://img.shields.io/pypi/status/agentpool.svg)](https://pypi.org/project/agentpool/)
[![Monthly downloads](https://img.shields.io/pypi/dm/agentpool.svg)](https://pypi.org/project/agentpool/)
[![Python version](https://img.shields.io/pypi/pyversions/agentpool.svg)](https://pypi.org/project/agentpool/)
[![Github Stars](https://img.shields.io/github/stars/phil65/agentpool)](https://github.com/phil65/agentpool/stars)

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

[Documentation](https://phil65.github.io/agentpool/)

## 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. 

```mermaid
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

```bash
uv tool install agentpool

```

### Minimal Configuration

```yaml
# agents.yml
agents:
  assistant:
    type: native
    model: openai:gpt-4o
    system_prompt: "You are a helpful assistant."
```

```bash
# 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:

```yaml
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):

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

  parallel_coders:
    mode: parallel
    members: [claude, goose]
```

```python
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:

```yaml
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

```bash
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

```python
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](https://phil65.github.io/agentpool/).
