Skip to content

Multi-Agent Teams

Any agent can be used as a tool by another agent:

@agent(
name="coordinator",
model="openai/gpt-4o",
tools=[researcher.as_tool(), writer.as_tool()],
pattern="plan_and_execute",
)
async def coordinator(ctx):
"""Coordinate research and writing."""
return None

Compose multiple agents with orchestration patterns:

from astromesh_adk import AgentTeam
team = AgentTeam(
name="content-team",
pattern="supervisor",
supervisor=coordinator,
workers=[researcher, writer],
)
result = await team.run("Write about AI in healthcare")
team = AgentTeam(
name="doc-pipeline",
pattern="pipeline",
agents=[extractor, summarizer, translator],
)
team = AgentTeam(
name="sales",
pattern="swarm",
agents=[qualifier, negotiator, closer],
entry_agent=qualifier,
)
team = AgentTeam(
name="research",
pattern="parallel",
agents=[market_analyst, tech_analyst, competitor_analyst],
)

The guardrails of the supervisor (or entry) agent apply to the team run; a block returns a RunResult with blocked=True.

requires_approval and mode="propose" tools work in local runs (see Creating Tools). In a team, or with other.as_tool(), the confirming “si” is read by the run that talks to the person, never by a member or sub-agent, and a member cannot propose. Remote children (bind()/connect()/remote()) declare origen: "agente" on every call, so the remote node never accepts the parent model’s “si” as human confirmation; the person confirms by talking to the remote agent directly.

Built by FAiNANSU