Skip to main content
Prefer YAML? Each composite maps directly to a type: key under the composer’s agents: block. See Composer → agent types for the YAML equivalents of every pattern on this page.

SequentialAgent

Chains sub-agents in order. The final answer of each agent becomes the input to the next.
Stops early if any event carries actions.escalate=True.

ParallelAgent

Runs sub-agents concurrently. Events from all agents are merged into a single stream.
Each sub-agent gets a derived context with an isolated branch so their state and events don’t collide.

LoopAgent

Repeats its sub-agents until a termination condition is met.
LoopAgent stops when:
  • An event has actions.escalate=True (set by exit_loop_tool)
  • max_iterations is reached
  • Optional should_continue(event) -> bool callback returns False