<!-- source: https://deepwiki.com/MervinPraison/PraisonAI/13.1-crewai-integration -->

# CrewAI Integration

- .github/workflows/build-image.yml
- .github/workflows/coverage.yml
- .github/workflows/python-package.yml
- .github/workflows/test-comprehensive.yml
- .github/workflows/test-core.yml
- .github/workflows/test-extended.yml
- .github/workflows/test-frameworks.yml
- .github/workflows/test-real.yml
- .github/workflows/unittest.yml
- .gitignore
- src/praisonai/praisonai/README.md
- src/praisonai/tests/test.py
- src/praisonai/tests/test_runner.py
- src/praisonai/tests/unit/test_cli_features.py

This document covers PraisonAI's integration with the CrewAI framework, enabling users to leverage CrewAI's agent orchestration capabilities within the PraisonAI ecosystem. The integration provides seamless framework switching, allowing users to define agents and tasks using PraisonAI's YAML configuration while executing them through CrewAI's proven multi-agent coordination system.

For information about other framework integrations, see [AutoGen Integration](/MervinPraison/PraisonAI/11.2-cicd-pipeline). For core agent system details, see [Core Agent System](/MervinPraison/PraisonAI/2-core-agent-system).

## Integration Architecture

PraisonAI's CrewAI integration follows a framework-agnostic design pattern where the `AgentsGenerator` class serves as the orchestration layer that can route execution to different underlying frameworks based on configuration.

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py131-178](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L131-L178) [src/praisonai/praisonai/agents_generator.py589-692](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L589-L692) [src/praisonai/praisonai/cli.py551](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/cli.py#L551-L551)

## Framework Detection and Availability

The integration uses a robust availability checking system to ensure CrewAI is properly installed before attempting to use it.

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py34-39](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L34-L39) [src/praisonai/praisonai/agents_generator.py172-173](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L172-L173) [src/praisonai/praisonai/agents_generator.py403-404](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L403-L404)

## Configuration and Agent Creation

The CrewAI integration transforms PraisonAI's YAML configuration into CrewAI-compatible agent and task objects. The process involves several key components:

### YAML to CrewAI Mapping

### Agent Instantiation Flow

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py606-659](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L606-L659) [src/praisonai/praisonai/agents_generator.py616-637](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L616-L637)

## Tool Integration System

The CrewAI integration leverages PraisonAI's comprehensive tool system, automatically mapping tool names from YAML configuration to actual tool instances.

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py325-350](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L325-L350) [src/praisonai/praisonai/agents_generator.py612-613](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L612-L613)

## LLM Configuration and Model Management

The integration uses `PraisonAIModel` to provide consistent LLM configuration across different model providers while maintaining CrewAI compatibility.

### Model Configuration Hierarchy

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py616-640](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L616-L640) [src/praisonai/praisonai/agents_generator.py630-641](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L630-L641)

## Task Creation and Dependencies

CrewAI tasks are created from YAML task definitions with support for context dependencies and output specifications.

### Task Dependency Resolution

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py662-686](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L662-L686)

## Process Types and Execution

The CrewAI integration supports multiple execution processes, with the process type determined by YAML configuration.

### Process Configuration Table

### Execution Flow

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py688-692](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L688-L692) [src/praisonai/praisonai/agents_generator.py675-686](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L675-L686)

## Integration Points and Telemetry

The CrewAI integration includes telemetry and monitoring capabilities through AgentOps integration.

### Telemetry Configuration

```

```

**Sources:** [src/praisonai/praisonai/agents_generator.py405-406](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L405-L406) [src/praisonai/praisonai/agents_generator.py121-129](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L121-L129)

## Command Line Interface Integration

The CLI provides seamless access to CrewAI functionality through the framework selection mechanism.

### CLI Usage Patterns

**Sources:** [src/praisonai/praisonai/cli.py551](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/cli.py#L551-L551) [src/praisonai/praisonai/cli.py207](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/cli.py#L207-L207) [src/praisonai/praisonai/agents_generator.py364](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai/praisonai/agents_generator.py#L364-L364)
