Problem
Today the only available topology is independent parallel fan-out. But the design space for agent orchestration is richer: pipelines (A→B→C), diamonds (N→1 integrator→M), speculative execution (try N approaches, pick best), critique loops (implement→review→fix), and waterfall waves (each wave depends on previous completions). There is no way to declare these topologies.
Scope
Add topology primitives that the conductor agent (#4010) can use:
- Fan-out — Spawn N agents in parallel, wait for all, collect results (already possible, needs formalization)
- Pipeline — Run agents sequentially: A completes → B receives A's output → C receives B's output
- Diamond — N parallel agents → 1 integrator that merges/synthesizes → M verifiers
- Speculative — Spawn N agents with different approaches, one verifier judges and picks the best
- Critique loop — Implement → reviewer critiques → implementer fixes → repeat until pass
- Waterfall — N waves, each wave starts only after the previous wave fully completes
API shape
These could be exposed as:
- Higher-level tool primitives:
agent_batch, agent_pipeline, agent_diamond
- Declarative in WhaleFlow DAG:
WorkflowNode already has depends_on and strategy fields
- Inline in the conductor prompt: "run these in a pipeline"
Non-goals
- Not replacing the existing sub-agent tool. Topologies compose on top of it.
- Not requiring WhaleFlow config for simple cases.
agent_pipeline([A, B, C]) should work inline.
Acceptance
- Each topology is usable from a conductor agent (manual invocation or WhaleFlow config)
- Pipeline: B receives A's output as context, C receives B's output
- Diamond: integrator receives all N outputs before dispatching M verifiers
- Speculative: verifier selects the best result and explains why
- Critique loop: iterates up to N rounds or until reviewer passes
- Tests cover each topology with mock agents
Related
Problem
Today the only available topology is independent parallel fan-out. But the design space for agent orchestration is richer: pipelines (A→B→C), diamonds (N→1 integrator→M), speculative execution (try N approaches, pick best), critique loops (implement→review→fix), and waterfall waves (each wave depends on previous completions). There is no way to declare these topologies.
Scope
Add topology primitives that the conductor agent (#4010) can use:
API shape
These could be exposed as:
agent_batch,agent_pipeline,agent_diamondWorkflowNodealready hasdepends_onandstrategyfieldsNon-goals
agent_pipeline([A, B, C])should work inline.Acceptance
Related
crates/whaleflow/src/lib.rs(WorkflowNode,WorkflowSpec)