Skip to Content

Team

from loomflow.team import Team

Sibling-style builders that mirror the shape every other framework uses (create_supervisor / Crew / GroupChatManager). Each method returns a regular Agent whose architecture is the corresponding multi-agent strategy.

For the conceptual page see Team facade.

Team is a namespace class. You don’t construct it. All methods are class-level builders.


Team.supervisor

@classmethod def supervisor( cls, workers: dict[str, Agent], *, instructions: str = "", # forwarded Agent kwargs model: Model | str | None = None, memory: Memory | str | Mapping[str, Any] | None = None, runtime: Runtime | None = None, budget: Budget | None = None, permissions: Permissions | None = None, hooks: HookRegistry | None = None, tools: list[Tool | Callable] | ToolHost | Tool | Callable | None = None, telemetry: Telemetry | None = None, audit_log: AuditLog | None = None, max_turns: int = 50, auto_consolidate: bool = False, skills: list[Any] | None = None, # supervisor-specific instructions_template: str | None = None, delegate_tool_name: str = "delegate", forward_tool_name: str = "forward_message", ) -> Agent: ...

Returns an Agent whose architecture is Supervisor(workers=..., instructions_template=..., delegate_tool_name=..., forward_tool_name=...).

ParameterDefaultNote
workersrequiredRole-name → Agent mapping.
instructions""Coordinator system prompt (prepended to the supervisor template).
model / memory / etc.per-Agent defaultsForwarded to the underlying Agent constructor.
instructions_template / delegate_tool_name / forward_tool_nameSupervisor’s defaultsForwarded to the architecture.
team = Team.supervisor( workers={"researcher": researcher, "writer": writer}, instructions="manage the pipeline", model="claude-opus-4-7", ) result = await team.run("write me a blog post")

Team.swarm

@classmethod def swarm( cls, agents: dict[str, Agent | Handoff], *, entry_agent: str, max_handoffs: int = 8, detect_cycles: bool = True, pass_full_history: bool = True, handoff_tool_name: str = "handoff", instructions: str = "", # forwarded Agent kwargs (model, memory, etc.) ... ) -> Agent: ...

Returns an Agent whose architecture is Swarm(agents=..., entry_agent=..., ...).

team = Team.swarm( agents={"triage": triage, "billing": billing, "tech": tech}, entry_agent="triage", model="claude-opus-4-7", )

Team.router

@classmethod def router( cls, routes: list[RouterRoute], *, fallback_route: str | None = None, require_confidence_above: float = 0.0, classifier_prompt: str | None = None, instructions: str = "", # forwarded Agent kwargs ... ) -> Agent: ...

Returns an Agent whose architecture is Router(routes=..., ...).

team = Team.router( routes=[ RouterRoute(name="billing", agent=billing, description="..."), RouterRoute(name="tech", agent=tech, description="..."), ], instructions="customer support entry point", model="claude-haiku-4-5", )

Team.debate

@classmethod def debate( cls, debaters: list[Agent], *, judge: Agent | None = None, rounds: int = 2, convergence_check: bool = True, convergence_similarity: float = 0.85, debater_instructions: str | None = None, judge_instructions: str | None = None, instructions: str = "", # forwarded Agent kwargs ... ) -> Agent: ...

Returns an Agent whose architecture is MultiAgentDebate(debaters=..., judge=..., ...).

team = Team.debate( debaters=[optimist, skeptic, analyst], judge=cio, rounds=2, convergence_similarity=0.85, model="claude-opus-4-7", )

Team.actor_critic

@classmethod def actor_critic( cls, *, actor: Agent, critic: Agent, max_rounds: int = 3, approval_threshold: float = 0.9, critique_template: str | None = None, refine_template: str | None = None, instructions: str = "", # forwarded Agent kwargs ... ) -> Agent: ...

Returns an Agent whose architecture is ActorCritic(actor=..., critic=..., ...).

team = Team.actor_critic( actor=Agent("Generate", model="claude-opus-4-7"), critic=Agent("Critique", model="gpt-4o"), max_rounds=3, approval_threshold=0.9, model="claude-opus-4-7", )

Team.blackboard

@classmethod def blackboard( cls, agents: dict[str, Agent], *, coordinator: Agent | None = None, decider: Agent | None = None, max_rounds: int = 10, coordinator_instructions: str | None = None, decider_instructions: str | None = None, instructions: str = "", # forwarded Agent kwargs ... ) -> Agent: ...

Returns an Agent whose architecture is BlackboardArchitecture(agents=..., coordinator=..., decider=..., ...).

team = Team.blackboard( agents={"hypothesis": h, "evidence": e, "critic": c}, coordinator=coord, decider=decider, model="claude-opus-4-7", )

Why explicit kwargs (not **kwargs)?

Each Team builder spells out every Agent constructor kwarg plus the architecture-specific ones rather than forwarding through **kwargs. The trade-off is verbosity vs IDE support. Explicit kwargs let Pylance / Pyright / mypy surface the full parameter list with proper types, defaults, and docstrings on hover. Worth it.


When to skip Team and use Agent(architecture=...)

The Team builders are for single-level teams. Supervisors that delegate to leaf workers, swarms of peers, etc. For recursive composition (Reflexion-of-Supervisor, Supervisor-of-Supervisor) use the explicit Agent(architecture=...) form so you can pass an architecture as a field of another architecture.

# Single-level — use Team team = Team.supervisor(workers={...}, model="...") # Recursive — use the nested form agent = Agent( "...", model="...", architecture=Reflexion( base=Supervisor(workers={...}), ), )

See Recursive composition.


Source

loomflow/team.py

Team and Agent(architecture=...) are interchangeable. Team.supervisor(workers={...}) returns exactly what Agent(architecture=Supervisor(workers={...})) would. The only difference is ergonomics. Team for the muscle memory from LangGraph / CrewAI, the explicit form for composition.

Last updated on