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

# AutoAgents

> Automatic agent generation from task descriptions

Generate multi-agent teams automatically from a plain-language task description.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Task([Task]) --> Auto[AutoAgents]
    Auto --> Team[Agent Team]
    Team --> Out([Plan])

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

    class Auto,Team agent
    class Task,Out tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff
```

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    npm install praisonai
    ```

    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    import { AutoAgents } from 'praisonai';

    const auto = new AutoAgentTeam();
    const team = await auto.generate('Build a web scraper that extracts product prices');
    console.log('Agents:', team.agents.length);
    ```
  </Step>

  <Step title="With Configuration">
    ```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    const auto = new AutoAgentTeam({
      llm: 'openai/gpt-4o',
      pattern: 'parallel',
      verbose: true,
    });
    const team = await auto.generate('Create a data pipeline');
    ```
  </Step>
</Steps>

***

## Installation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
npm install praisonai
```

## Basic Usage

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { AutoAgents } from 'praisonai';

const auto = new AutoAgentTeam();

const team = await auto.generate('Build a web scraper that extracts product prices');

console.log('Agents:', team.agents.length);
console.log('Tasks:', team.tasks.length);
console.log('Pattern:', team.pattern);
```

## With Configuration

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { AutoAgents } from 'praisonai';

const auto = new AutoAgentTeam({
  llm: 'openai/gpt-4o',
  pattern: 'parallel',
  singleAgent: false,
  verbose: true
});

const team = await auto.generate('Create a data pipeline');
```

## Pattern Recommendation

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { AutoAgents } from 'praisonai';

const auto = new AutoAgentTeam();

// Get recommended pattern for a task
const pattern = auto.recommendPattern('Run tasks in parallel');
console.log(pattern); // 'parallel'

const pattern2 = auto.recommendPattern('Route requests to different handlers');
console.log(pattern2); // 'routing'
```

## Complexity Analysis

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { AutoAgents } from 'praisonai';

const auto = new AutoAgentTeam();

const simple = auto.analyzeComplexity('Write code');
console.log(simple); // 'simple'

const complex = auto.analyzeComplexity(
  'Build a multi-step data pipeline with validation, transformation, and multiple output formats'
);
console.log(complex); // 'complex'
```

## Available Patterns

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { AutoAgents } from 'praisonai';

// Sequential - tasks run one after another
const sequential = new AutoAgentTeam({ pattern: 'sequential' });

// Parallel - tasks run simultaneously
const parallel = new AutoAgentTeam({ pattern: 'parallel' });

// Routing - tasks routed based on conditions
const routing = new AutoAgentTeam({ pattern: 'routing' });

// Orchestrator-workers - one agent coordinates others
const orchestrator = new AutoAgentTeam({ pattern: 'orchestrator-workers' });

// Evaluator-optimizer - iterative improvement
const evaluator = new AutoAgentTeam({ pattern: 'evaluator-optimizer' });
```

## Single Agent Mode

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { AutoAgents } from 'praisonai';

const auto = new AutoAgentTeam({ singleAgent: true });

const result = await auto.generate('Simple task');
console.log('Agents:', result.agents.length); // 1
```

## Team Structure

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
interface TeamStructure {
  agents: AgentConfig[];
  tasks: TaskConfig[];
  pattern: 'sequential' | 'parallel' | 'hierarchical';
}

interface AgentConfig {
  name: string;
  role: string;
  goal: string;
  backstory?: string;
  instructions?: string;
  tools?: string[];
}

interface TaskConfig {
  description: string;
  expectedOutput?: string;
  agent?: string;
}
```

## Factory Function

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { createAutoAgents } from 'praisonai';

const auto = createAutoAgentTeam({
  pattern: 'sequential',
  verbose: true
});
```

***

## Related

<CardGroup cols={2}>
  <Card title="AutoAgents CLI" icon="terminal" href="/docs/js/auto-agents-cli">
    CLI commands
  </Card>

  <Card title="AgentTeam" icon="users" href="/docs/js/agent-team">
    Run generated teams
  </Card>
</CardGroup>
