multi-agent systems
Architectures where multiple specialized agents collaborate to solve complex tasks. Patterns include orchestrator-worker, peer-to-peer, and hierarchical.
Syntax
ai-agents
orchestrator -> [worker_1, worker_2, worker_3] -> aggregate resultsExample
ai-agents
// Multi-agent pattern:
const orchestrator = new Agent({
name: "Orchestrator",
instructions: "Break tasks into subtasks and delegate to specialists"
});
const researchers = [
new Agent({ name: "WebResearcher", tools: [searchTool] }),
new Agent({ name: "CodeAnalyst", tools: [codeTool] }),
new Agent({ name: "Writer", tools: [formatTool] })
];
const result = await orchestrator.run(task, { workers: researchers });