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

<Steps>
  <Step title="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
    ```
  </Step>

  <Step title="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' })
    });
    ```
  </Step>
</Steps>

***

## 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](/docs/docs/js/agent-team#team-level-options) for the full list of team-level options.
</Note>

***

## 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 title="TeamStructure" icon="code" href="/docs/sdk/reference/typescript/classes/TeamStructure">
  Team configuration
</Card>

<Card title="MultiAgentExecutionConfig" icon="robot" href="/docs/sdk/reference/typescript/classes/MultiAgentExecutionConfig">
  Multi-agent execution options
</Card>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Give each agent one role">
    Specialized agents produce better results than generalists.
  </Accordion>

  <Accordion title="Use sequential for dependencies">
    When one agent needs another's output, use sequential process.
  </Accordion>

  <Accordion title="Use hierarchical for complex tasks">
    A manager helps coordinate when tasks require judgment calls.
  </Accordion>
</AccordionGroup>

***

## 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.
</Note>

***

## Related

<CardGroup cols={2}>
  <Card title="Handoffs" icon="hand" href="/docs/js/handoffs">
    Transfer between agents
  </Card>

  <Card title="Workflows" icon="diagram-project" href="/docs/js/workflows">
    Multi-step workflows
  </Card>
</CardGroup>
