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

# Auto Module

> Automated agent generation from natural language prompts

# Auto Module

The Auto module provides automated agent generation from natural language prompts.

## Installation

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

## Quick Start

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai import PraisonAI

# Generate agents from a prompt
praison = PraisonAI(auto="Create a team to research AI trends")
result = praison.run()
```

## CLI Usage

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Auto mode with prompt
praisonai --auto "Create a research team for market analysis"

# Auto mode with topic
praisonai --auto "Build a content creation pipeline"
```

## How It Works

1. **Prompt Analysis**: The auto module analyzes your natural language prompt
2. **Agent Generation**: Creates appropriate agents with roles, goals, and tasks
3. **YAML Creation**: Generates a valid agents.yaml configuration
4. **Execution**: Runs the generated agents

## Configuration

### Environment Variables

| Variable          | Description                                        |
| ----------------- | -------------------------------------------------- |
| `OPENAI_API_KEY`  | OpenAI API key for agent generation                |
| `PRAISONAI_MODEL` | Model to use for generation (default: gpt-4o-mini) |

## Generated Structure

Auto mode generates a YAML structure like:

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
framework: praisonaiagents
topic: Research AI trends
roles:
  researcher:
    role: Research Analyst
    goal: Research and analyze AI trends
    backstory: Expert researcher with analytical skills
    tasks:
      research_task:
        description: Research the latest AI developments
        expected_output: Comprehensive research report
  
  writer:
    role: Content Writer
    goal: Create engaging content from research
    backstory: Skilled writer with technical background
    tasks:
      write_task:
        description: Write article based on research
        expected_output: Well-structured article
```

## Programmatic Usage

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai import PraisonAI

# Basic auto generation
praison = PraisonAI(auto="Create a customer support team")
result = praison.run()

# With specific framework
praison = PraisonAI(
    auto="Build a data analysis pipeline",
    framework="praisonaiagents"
)
result = praison.run()
```

## Customization

### Adding Tools

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai import PraisonAI

def search_tool(query: str) -> str:
    return f"Search results for: {query}"

praison = PraisonAI(
    auto="Create a research team with web search",
    tools=[search_tool]
)
result = praison.run()
```

## See Also

* [CLI Module](/docs/sdk/praisonai/cli) - Command-line interface
* [Deploy Module](/docs/sdk/praisonai/deploy) - Deployment utilities
* [AutoAgents](/docs/sdk/praisonaiagents/agents/autoagents) - Core auto agents
