Teams
Multiple agents working together
Agents can work together as a team to solve complex problems.
Quick Start
- Simple Usage
typescript import { Agent, Team } from 'praisonai'; const researcher = new Agent({ name: 'Researcher', instructions: 'You research topics thoroughly' }); const writer = new Agent({ name: 'Writer', instructions: 'You write clear, engaging content' }); const team = new Team({ agents: [researcher, writer], process: 'sequential' }); await team.start('Write an article about AI'); // Researcher gathers info → Writer creates article - With Configuration
typescript const team = new Team({ agents: [researcher, writer], process: 'hierarchical', manager: new Agent({ instructions: 'You coordinate the team' }) });
User Interaction Flow
Configuration Levels
// Level 1: Array - Simple team
const team = new Team({
agents: [researcher, writer]
});
// Level 2: String - Named process
const team = new Team({
agents: [researcher, writer],
process: 'sequential' // or 'parallel', 'hierarchical'
});
// Level 3: Dict - Full configuration
const team = new Team({
agents: [researcher, writer],
process: 'hierarchical',
managerLlm: 'gpt-4o', // model for the hierarchical manager
memory: true, // one shared store for the team
planning: true, // plan first, then run the steps
execution: 'balanced', // iteration/retry limits
hooks: { // team lifecycle callbacks
onTaskComplete: (task, output) => {},
},
verbose: true
});Team Processes
| Process | How It Works |
|---|---|
sequential | Agents work one after another |
parallel | Agents work at the same time |
hierarchical | Manager coordinates agents |
API Reference
TeamStructureTeam configuration
MultiAgentExecutionConfigMulti-agent execution options
Best Practices
Give each agent one role
Specialized agents produce better results than generalists.
Use sequential for dependencies
When one agent needs another’s output, use sequential process.
Use hierarchical for complex tasks
A manager helps coordinate when tasks require judgment calls.
Python-Parity Aliases
To keep Python examples copy-pasteable, PraisonAIAgents and Agents are silent aliases of AgentTeam — same constructor, same behaviour.
import { Agent, PraisonAIAgents } from 'praisonai';
const researcher = new Agent({ name: 'Researcher', instructions: 'Research the topic.' });
const writer = new Agent({ name: 'Writer', instructions: 'Write the report.' });
// PraisonAIAgents === AgentTeam
const team = new PraisonAIAgents({ agents: [researcher, writer], process: 'sequential' });
await team.start('Write a report on renewable energy');