Demonstrates advanced agent patterns including multi-agent coordination and streaming execution.
- Multiple specialized agents
- Agent swarm coordination
- Streaming execution
- Tool composition
npm install
export ANTHROPIC_API_KEY=your-key
npm run startEach agent has a specific role:
- Researcher - Gathers information using web search
- Analyst - Analyzes data and provides insights
- Writer - Creates clear, engaging content
The swarm automatically:
- Routes tasks to appropriate agents
- Coordinates multi-step workflows
- Synthesizes results from multiple agents
Watch agents work in real-time:
- See reasoning steps as they happen
- Monitor tool calls
- Track progress
This pattern is ideal for:
- Research and analysis workflows
- Content creation pipelines
- Complex decision-making tasks
- Multi-step problem solving
Add more agents:
const codeAgent = new AgentExecutor({
name: 'Coder',
systemPrompt: 'You write clean, efficient code',
tools: [codeAnalysisTool, testGeneratorTool],
})
swarm.addAgent(codeAgent)