Multi-agent
Multi-agent collaboration
Specialists pass the work along a pipeline.
Collaboration in its simplest form: each agent has one job and hands its output to the next. Here a researcher gathers facts, a writer turns them into text for the audience, and an editor tightens it.
Each agent can have its own prompt, model and tools. Because the order is fixed, the run is predictable and each stage is easy to test on its own.
- Use it when
- Work that naturally flows through stages
- Different skills per stage (or a cheaper model for one)
- Easy-to-test, predictable runs
- Skip it when
- Stages that need to go back and forth (Debate, Reflexion)
- When one capable agent can do it all in one call
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.sequentialresearcher = Agent(MODEL, instructions="List the key facts as three bullet points.")
writer = Agent(MODEL, instructions="Write the answer for the audience, from these facts only.")
editor = Agent(MODEL, instructions="Make it shorter and clearer. Keep the meaning.")
# Each output is the next one's input.
flow = patterns.sequential([("researcher", researcher), ("writer", writer), ("editor", editor)])
result = await flow.run("Explain why the sky is blue, for a 10-year-old.")
print(result.output)
print(result.explain()) # each step and what it returnedconst researcher = new Agent({ model: MODEL, instructions: "List the key facts as three bullet points." });
const writer = new Agent({ model: MODEL, instructions: "Write the answer for the audience, from these facts only." });
const editor = new Agent({ model: MODEL, instructions: "Make it shorter and clearer. Keep the meaning." });
// Each output is the next one's input.
const flow = patterns.sequential([["researcher", researcher], ["writer", writer], ["editor", editor]]);
const result = await flow.run(task);
console.log(result.output);
console.log(result.explain()); // each step and what it returned