criogenai

Multi-agent

Supervisor

A coordinator calls workers in turn until done.

A supervisor agent holds the goal and decides, turn by turn, which worker to call next and with what instruction. Workers report back; the supervisor reads the result and either calls another worker or answers.

Unlike a router it can call several workers, in any order, more than once. The price is a model call for every decision.

Use it when
Requests that need several specialists
The order of work is not known in advance
Workers with separate prompts, tools or models
Skip it when
A fixed order always works (a sequential pipeline is cheaper)
Tight latency budgets

Run it

Scripted model · no key needed · CriogenAI engine in your browser
Ready
finalRequestSupervisorResearcherWriterReviewerAnswer
The runmodel 0 · tools 0
  1. 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.coordinator
researcher = Agent(MODEL, instructions="Find facts. Be brief and precise.")
writer = Agent(MODEL, instructions="Write clear, short text from notes.")
reviewer = Agent(MODEL, instructions="Check the text for errors.")

# The supervisor calls workers as tools, in any order, until it can answer.
boss = patterns.coordinator(
    MODEL,
    {
        "researcher": (researcher, "finds facts"),
        "writer": (writer, "writes text"),
        "reviewer": (reviewer, "checks text"),
    },
    limits={"model_calls": 8},
)
result = await boss.run("Three bullet points on why teams adopt TypeScript.")
print(result.text)
const researcher = new Agent({ model: MODEL, instructions: "Find facts. Be brief and precise." });
const writer = new Agent({ model: MODEL, instructions: "Write clear, short text from notes." });
const reviewer = new Agent({ model: MODEL, instructions: "Check the text for errors." });

// The supervisor calls workers as tools, in any order, until it can answer.
const boss = patterns.coordinator(
  MODEL,
  { researcher: [researcher, "finds facts"], writer: [writer, "writes text"], reviewer: [reviewer, "checks text"] },
  { limits: { modelCalls: 8 } },
);
const result = await boss.run(task);
console.log(result.text);