Teams

Multiple agents working together

Agents can work together as a team to solve complex problems.

Diagram

Agent Team

👤 User

🤖 Manager

📝 Researcher

✍️ Writer

✅ Reviewer

Quick Start

  1. 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
  2. With Configuration
    typescript
    const team = new Team({
      agents: [researcher, writer],
      process: 'hierarchical',
      manager: new Agent({ instructions: 'You coordinate the team' })
    });

User Interaction Flow

Diagram
WriterResearcherTeamUserWriterResearcherTeamUser“Write article about AI”Research AIResearch findingsWrite using researchDraft articleFinal article

Configuration Levels

typescript
// 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

ProcessHow It Works
sequentialAgents work one after another
parallelAgents work at the same time
hierarchicalManager coordinates agents

API Reference

TeamStructure

Team configuration

MultiAgentExecutionConfig

Multi-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.

typescript
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');

Related