fan_out_merge

Function fan_out_merge 

Source
pub fn fan_out_merge(
    agents: Vec<AgentBuilder>,
    merger: AgentBuilder,
) -> Composable
Expand description

Fan-out-merge: run agents in parallel, then merge results with a merger agent.

All agents execute concurrently via fan-out. Their combined output is then fed into the merger agent, which synthesizes a final result.

§Arguments

  • agents — Agents to run in parallel.
  • merger — Agent that merges the parallel results.

§Example

let research = fan_out_merge(
    vec![
        AgentBuilder::new("web-search").instruction("Search the web"),
        AgentBuilder::new("db-lookup").instruction("Query the database"),
    ],
    AgentBuilder::new("synthesizer").instruction("Combine research findings"),
);