🤖 👥 Agent Teams
Agent Teams is a Python library for orchestrating teams of AI agents built on pydantic-ai with coordination over the A2A protocol. It brings production-grade patterns from distributed systems to multi-agent coordination.
Key Features
- Team Lifecycle Management — Create, start, stop, pause, resume, and delete agent teams via a REST API or CLI.
- Execution Modes — Sequential, parallel, and supervisor-driven task execution.
- Health Monitoring — Heartbeat-based liveness detection, stuck-agent identification, mass death handling, and exponential-backoff restarts.
- Reaction Engine — Automatic event handling with retry logic, escalation, and configurable responses (notify, reassign, restart).
- Lifecycle Hooks — Priority-ordered, short-circuit-capable hooks for every major team event.
- A2A Protocol Extensions — Team coordination metadata as a first-class A2A extension.
- Typer CLI — Full-featured command-line interface for managing teams without writing code.
- FastAPI REST API — Embeddable or standalone API server with SSE event streaming.
Architecture at a Glance
Installation
pip install agent-teams
For development (with test dependencies):
pip install -e ".[test]"
Quick Example
from agent_teams.types import TeamConfig, AgentMemberConfig, ExecutionMode
from agent_teams.manager import TeamManager
manager = TeamManager()
# Create a team
config = TeamConfig(
name="research-team",
execution_mode=ExecutionMode.PARALLEL,
members=[
AgentMemberConfig(name="researcher", model="openai:gpt-4o"),
AgentMemberConfig(name="writer", model="anthropic:claude-sonnet-4-20250514"),
],
)
team = await manager.create_team(config)
# Start and assign work
await manager.start_team(team.team_id)
result = await manager.assign_task(team.team_id, "Analyse recent AI papers")
Or use the CLI:
# Start the server
agent-teams serve --port 8765
# Create and run a team
agent-teams create team.yaml
agent-teams start <team-id>
agent-teams assign <team-id> "Analyse recent AI papers"
Documentation
📄️ Agent Teams
Agent Teams is a Python library for orchestrating teams of AI agents built on pydantic-ai with coordination over the A2A protocol. It brings production-grade patterns from distributed systems to multi-agent coordination.
📄️ Architecture
Agent Teams is structured as a layered system with clean separation between orchestration, protocol, and transport.
📄️ Getting Started
This guide walks you through installing Agent Teams, creating your first team, and running tasks.
📄️ Health Monitoring
The HealthMonitor provides heartbeat-based liveness detection, stuck-agent identification, and automatic recovery for team members.
📄️ Reactions
The ReactionEngine provides automatic event handling with retry logic, escalation, and configurable responses. It is inspired by the agent-orchestrator's reaction system.
📄️ Hooks
The HookRegistry lets you attach handlers to team lifecycle events. Hooks are priority-ordered and can block or modify operations.
📄️ Protocols
Agent Teams implements coordination as an A2A protocol extension, enabling teams to communicate over the standard Agent-to-Agent protocol with additional team-specific metadata.
📄️ CLI Reference
Agent Teams provides a command-line interface built with Typer. The CLI communicates with the Agent Teams REST API server.
📄️ API Reference
Agent Teams exposes a REST API built with FastAPI. Below is the full endpoint reference.