> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Teams

> Multiple agents working together

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

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    subgraph "Agent Team"
        A[👤 User] --> B[🤖 Manager]
        B --> C[📝 Researcher]
        B --> D[✍️ Writer]
        B --> E[✅ Reviewer]
    end
    
    classDef manager fill:#F59E0B,stroke:#7C90A0,color:#fff
    classDef worker fill:#10B981,stroke:#7C90A0,color:#fff
    
    class A user
    class B manager
    class C,D,E worker

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class C agent
    class A,B user
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff
```

## Quick Start

**1. Simple Usage**

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
const team = new Team({
  agents: [researcher, writer],
  process: 'hierarchical',
  manager: new Agent({ instructions: 'You coordinate the team' })
});
```

***

## User Interaction Flow

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
sequenceDiagram
    participant User
    participant Team
    participant R as Researcher
    participant W as Writer
    
    User->>Team: "Write article about AI"
    Team->>R: Research AI
    R-->>Team: Research findings
    Team->>W: Write using research
    W-->>Team: Draft article
    Team-->>User: Final article
```

***

## Configuration Levels

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
// 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
});
```

> [!NOTE]
>
> `runOn` is **refused** on a team — passing it throws a `TypeError` at construction, matching Python. Put `runOn` on an individual `Agent` instead. See [AgentTeam](https://praison.ai/docs/docs/js/agent-team#team-level-options) for the full list of team-level options.

***

## 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

> [card] [TeamStructure](https://praison.ai/docs/sdk/reference/typescript/classes/TeamStructure.md)
>
> Team configuration

> [card] [MultiAgentExecutionConfig](https://praison.ai/docs/sdk/reference/typescript/classes/MultiAgentExecutionConfig.md)
>
> Multi-agent execution options

***

## Best Practices

> [accordion] Give each agent one role
>
> Specialized agents produce better results than generalists.

> [accordion] Use sequential for dependencies
>
> When one agent needs another's output, use sequential process.

> [accordion] 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 theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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');
```

> [!NOTE]
>
> When both `model` and `llm` are set on a team, **`model` wins** (Python parity). Prefer one or the other to avoid confusion.

***

## Related

> [card] [Handoffs](https://praison.ai/docs/js/handoffs.md)
>
> Transfer between agents

> [card] [Workflows](https://praison.ai/docs/js/workflows.md)
>
> Multi-step workflows


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.