Multi-agent
Parallel fan-out
Several agents work at once; one combines.
Fan-out sends the same input to several agents at the same time and waits for all of them; a synthesizer combines their answers. The wall-clock time is that of the slowest branch, not the sum.
Each branch does one narrow job, so its prompt stays short and its output is easy to check.
- Use it when
- Independent analyses of the same input
- Latency matters: branches overlap
- Ensembles: several opinions, one answer
- Skip it when
- Branches that need each other's results (chain them instead)
- Rate-limited APIs: all calls land at once
Run it
Scripted model · no key needed · CriogenAI engine in your browserThe runmodel 0 · tools 0
- Press Run to watch the pattern work, step by step.
Try it with your own key optional: a real model makes the decisions; the tools stay simulated
- Your key stays in this tab's memory: not saved, not in cookies or the address bar. Reload or close the tab and it is gone.
- Your browser calls OpenAI directly. Nothing passes through criogenai.com, and nothing is logged.
- Each run makes at most 16 short model calls, billed to your account. Tools, data and side effects are simulated.
This run is the TypeScript code below, running on the CriogenAI engine in your browser (WebAssembly). Without a key, a scripted model stands in for MODEL; with your key, your provider answers, called from this tab. The tools return made-up data.
Build it with CriogenAI
Ready-made:patterns.parallelflow = patterns.parallel(
{
"sentiment": Agent(MODEL, instructions="Overall sentiment and one reason."),
"topics": Agent(MODEL, instructions="Topics mentioned, with + or − each."),
"reply": Agent(MODEL, instructions="Draft a two-sentence reply to the customer."),
},
synthesizer=Agent(MODEL, instructions="Combine the analyses into a short report."),
)
result = await flow.run("Battery lasts forever, but the app keeps logging me out.")
print(result.output) # the branches ran at the same timeconst flow = patterns.parallel(
{
sentiment: new Agent({ model: MODEL, instructions: "Overall sentiment and one reason." }),
topics: new Agent({ model: MODEL, instructions: "Topics mentioned, with + or − each." }),
reply: new Agent({ model: MODEL, instructions: "Draft a two-sentence reply to the customer." }),
},
{ synthesizer: new Agent({ model: MODEL, instructions: "Combine the analyses into a short report." }) },
);
const result = await flow.run(task);
console.log(result.output); // the branches ran at the same time