Skip to main content
AgentTeam coordinates multiple agents working together, executing tasks sequentially or in parallel.
AgentTeam replaces Agents and PraisonAIAgents as the recommended class name. The old names still work as silent aliases.

Quick Start

1

Install

npm install praisonai
2

Create Team

import { Agent, AgentTeam } from 'praisonai';

const researcher = new Agent({
  name: 'Researcher',
  instructions: 'Research the topic thoroughly'
});

const writer = new Agent({
  name: 'Writer',
  instructions: 'Write based on research findings'
});

const team = new AgentTeam({
  agents: [researcher, writer]
});

const results = await team.start();

How It Works

ModeBehavior
SequentialEach agent runs after the previous completes, sharing context
ParallelAll agents run simultaneously, results collected together

Configuration Options

import { Agent, AgentTeam } from 'praisonai';

const team = new AgentTeam({
  agents: [agent1, agent2],
  tasks: ['Research AI trends', 'Write summary'],
  process: 'sequential',
  verbose: true,
  pretty: true
});
OptionTypeDefaultDescription
agentsAgent[]requiredArray of agents to orchestrate
tasksstring[][]Custom tasks for each agent
process'sequential' | 'parallel''sequential'Execution mode
verbosebooleantrueEnable logging output
prettybooleanfalseEnable formatted output
llmstringAgent defaultDefault LLM for all agents

Common Patterns

import { Agent, AgentTeam } from 'praisonai';

const agent1 = new Agent({ instructions: 'Analyze data' });
const agent2 = new Agent({ instructions: 'Summarize analysis' });

// Simple array syntax
const team = new AgentTeam([agent1, agent2]);
const results = await team.start();

Best Practices

When agents need context from previous agents, use sequential mode.
const team = new AgentTeam({
  agents: [researcher, writer],
  process: 'sequential'  // Writer gets research context
});
When tasks are independent, parallel mode is faster.
const team = new AgentTeam({
  agents: [analyzer1, analyzer2, analyzer3],
  process: 'parallel'  // All analyze simultaneously
});
Provide one task per agent for explicit control.
const team = new AgentTeam({
  agents: [agent1, agent2, agent3],
  tasks: ['Task 1', 'Task 2', 'Task 3']
});

Backward Compatibility

All old names work as silent aliases with no deprecation warnings.
// All of these are equivalent
import { AgentTeam, Agents, PraisonAIAgents } from 'praisonai';

const team1 = new AgentTeam([agent1, agent2]);
const team2 = new Agents([agent1, agent2]);
const team3 = new PraisonAIAgents([agent1, agent2]);

// They are the same class
console.log(AgentTeam === Agents);           // true
console.log(AgentTeam === PraisonAIAgents);  // true