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

# CrewAI with PraisonAI

> Guide for using CrewAI framework with PraisonAI, including installation, setup, and execution of agent-based tasks

# CrewAI with PraisonAI

Low-code solution to run CrewAI with integrated tools and features.

<Note>
  Need a framework that isn't listed here? See [Framework Adapter Plugins](/docs/features/framework-adapter-plugins) to register your own via Python entry points.
</Note>

## Installation

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Install with CrewAI support
pip install "praisonai[crewai]"
```

This installation includes:

* CrewAI framework
* PraisonAI tools integration
* Task delegation capabilities
* Sequential and parallel task execution

## Quick Start

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Set your OpenAI API key
export OPENAI_API_KEY=xxxxxxxxxx

# Initialize with CrewAI
praisonai --framework crewai --init "Create a Movie Script About Cat in Mars"

# Run the agents
praisonai --framework crewai
```

## Auto Mode

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai --framework crewai --auto "Create a Movie Script About Cat in Mars"
```

## YAML Format for CrewAI

CrewAI requires the **`roles` format** YAML (not the `steps` workflow format). Here's the correct structure:

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
framework: crewai
topic: Create Movie Script About Cat in Mars

roles:
  researcher:
    role: Research Analyst
    goal: Gather information about Mars and cats
    backstory: Skilled in research, with a focus on gathering accurate and relevant information.
    tasks:
      research_task:
        description: Research about Mars environment and cat behavior for the movie concept
        expected_output: Research findings document with key facts

  narrative_designer:
    role: Story Concept Developer
    goal: Create a story concept for a movie about a cat in Mars
    backstory: Skilled in narrative development, with a focus on creating engaging stories.
    tasks:
      story_task:
        description: Create story concept based on research findings
        expected_output: Story concept with narrative arcs, character bios, and settings

  scriptwriter:
    role: Script Writer
    goal: Write a movie script about a cat in Mars
    backstory: Expert in dialogue and script structure, translating concepts into scripts.
    tasks:
      script_task:
        description: Write the final movie script based on the story concept
        expected_output: Production-ready movie script with dialogue and scene details
```

<Note>
  **Important**: The `--framework crewai` flag only works with YAML files using the `roles` format.

  The newer `steps` + `agents` workflow format only supports the praisonai framework and will ignore the `--framework` flag.
</Note>

## Running CrewAI

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Run with roles-format YAML
praisonai agents.yaml --framework crewai

# Or if framework is specified in YAML
praisonai agents.yaml
```

## Framework Selection Priority

1. **CLI flag** (`--framework crewai`) takes precedence
2. **YAML file** (`framework: crewai`) is used if no CLI flag
3. **Default**: praisonai framework

## Direct Prompts

<Warning>
  Direct prompts always use the praisonai framework regardless of the `--framework` flag:

  ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  # This will use praisonai, NOT crewai
  praisonai "What is 2+2?" --framework crewai
  ```

  To use CrewAI, you must provide a YAML file with the `roles` format.
</Warning>

## Troubleshooting

**Unsupported framework error**: If you see `Unsupported framework: crewai. Registered: ['ag2', 'autogen', 'autogen_v4', 'crewai', 'praisonai']`, check spelling — frameworks are registered via the adapter registry.

**Missing installation error**: If you see `CrewAI is not available. Install with: pip install crewai`, install the CrewAI dependencies as shown in the installation section above.
