Skip to Content

Team facade

Coming from LangGraph, CrewAI, AutoGen, or the OpenAI Agents SDK, you’d expect to construct a multi-agent team like this:

team = create_supervisor([researcher, writer], model="gpt-4") result = await team.invoke(...)

In Loom the same shape is Team:

from loomflow.team import Team team = Team.supervisor( workers={"researcher": researcher, "writer": writer}, instructions="manage the pipeline", model="gpt-4.1-mini", ) result = await team.run("write me a blog post")

Under the hood Team returns a regular Agent. Exactly what Agent(architecture=Supervisor(...)) would produce. The two shapes are interchangeable; Team is the “familiar-from-other-frameworks” facade for the common case, while the nested Agent(architecture=...) form remains the path for recursive composition.

Provided builders

BuilderArchitecture
Team.supervisor(workers=, ...)Supervisor
Team.router(routes=, ...)Router
Team.swarm(agents=, entry_agent=, ...)Swarm
Team.actor_critic(actor=, critic=, ...)ActorCritic
Team.debate(debaters=, judge=, ...)Multi-Agent Debate
Team.blackboard(agents=, coordinator=, decider=, ...)Blackboard

Each method exposes every Agent constructor kwarg explicitly (rather than forwarding through **kwargs) so IDEs and type-checkers surface the full parameter list with proper types, defaults, and docstrings on hover.

Examples

from loomflow import Agent from loomflow.architecture import RouterRoute, Handoff from loomflow.team import Team # Coordinator + workers team = Team.supervisor( workers={"researcher": researcher, "writer": writer, "reviewer": reviewer}, instructions="manage the pipeline", model="claude-opus-4-7", ) # Classify-and-dispatch 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", ) # Peer agents passing control via typed handoffs team = Team.swarm( agents={"triage": triage, "billing": billing, "tech": tech}, entry_agent="triage", model="claude-opus-4-7", ) # Actor + critic with different models team = Team.actor_critic( actor=Agent("...", model="claude-opus-4-7"), critic=Agent("...", model="gpt-4o"), max_rounds=3, approval_threshold=0.9, model="claude-opus-4-7", ) # N debaters + optional judge team = Team.debate( debaters=[optimist, skeptic, analyst], judge=cio, rounds=2, convergence_similarity=0.85, model="claude-opus-4-7", ) # Coordinator + agents share a workspace; decider synthesizes team = Team.blackboard( agents={"hypothesis": h_agent, "evidence": e_agent, "critic": c_agent}, coordinator=coord_agent, decider=decider_agent, model="claude-opus-4-7", )

Standalone testing

run_architecture(arch, prompt, model=...) builds a minimal Agent shell around any Architecture instance and runs it. Useful for testing orchestrators in isolation:

from loomflow.architecture import Supervisor from loomflow.team import run_architecture sup = Supervisor(workers={"a": agent_a}) result = await run_architecture(sup, "do the thing", model="claude-opus-4-7")

Team or Agent(architecture=...)? Use Team for single-level teams (matches the muscle memory from LangGraph / CrewAI). Use the nested Agent(architecture=...) form when you need to wrap one architecture inside another. See Recursive composition.

Last updated on