Multi-agent
Hierarchical teams
A manager splits work across team leads, who delegate.
A hierarchy is supervisors of supervisors. A manager splits the goal into team briefs; each team lead turns its brief into a task for its own worker; results flow back up and the manager decides.
Each agent sees only its level: the manager never reads raw worker output it does not need, which keeps prompts short as the system grows.
- Use it when
- Big problems with separable areas (research, finance, legal…)
- Teams with their own tools and rules
- Keeping each prompt small
- Skip it when
- Small tasks: every level adds calls and latency
- Areas that must constantly talk to each other
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.hierarchicalfootfall = Agent(MODEL, instructions="Estimate footfall and nearby competitors.")
costs = Agent(MODEL, instructions="Estimate rent, staff and break-even.")
# Nested mappings become team leads (sub-coordinators) with their own workers.
manager = patterns.hierarchical(
MODEL,
{
"research": {"_description": "market research", "footfall": footfall},
"finance": {"_description": "money questions", "costs": costs},
},
instructions="You manage a research team and a finance team. Decide from their reports.",
)
result = await manager.run("Should our bakery open a second shop downtown?")
print(result.text)const footfall = new Agent({ model: MODEL, instructions: "Estimate footfall and nearby competitors." });
const costs = new Agent({ model: MODEL, instructions: "Estimate rent, staff and break-even." });
// Nested objects become team leads (sub-coordinators) with their own workers.
const manager = patterns.hierarchical(
MODEL,
{
research: { _description: "market research", footfall },
finance: { _description: "money questions", costs },
},
{ instructions: "You manage a research team and a finance team. Decide from their reports." },
);
const result = await manager.run(task);
console.log(result.text);