Install CrewAI

This guide will walk you through the installation process for CrewAI and its dependencies. CrewAI is a flexible and powerful AI framework that enables you to create and manage AI agents, tools, and tasks efficiently. Let’s get started! 🚀

Make sure you have Python >=3.10 <=3.13 installed on your system before you proceed.

1

Install Poetry

First, if you haven’t already, install Poetry. CrewAI uses Poetry for dependency management and package handling, offering a seamless setup and execution experience.

2

Install CrewAI

Then, install the main CrewAI package:

You can also install the main CrewAI package and the tools package that include a series of helpful tools for your agents:

Alternatively, you can also use:

3

Upgrade CrewAI

To upgrade CrewAI and CrewAI Tools to the latest version, run the following command:

4

Verify the installation

To verify that crewai and crewai-tools are installed correctly, run the following command:

You should see the version number of crewai and crewai-tools.

If you see the version number, then the installation was successful! 🎉

Create a new CrewAI project

The next step is to create a new CrewAI project. We recommend using the YAML Template scaffolding to get started as it provides a structured approach to defining agents and tasks.

1

Create a new CrewAI project using the YAML Template Configuration

To create a new CrewAI project, run the following CLI (Command Line Interface) command:

This command creates a new project folder with the following structure:

File/DirectoryDescription
my_project/Root directory of the project
├── .gitignoreSpecifies files and directories to ignore in Git
├── pyproject.tomlProject configuration and dependencies
├── README.mdProject documentation
├── .envEnvironment variables
└── src/Source code directory
    └── my_project/Main application package
        ├── __init__.pyMarks the directory as a Python package
        ├── main.pyMain application script
        ├── crew.pyCrew-related functionalities
        ├── tools/Custom tools directory
        │ ├── custom_tool.pyCustom tool implementation
        │ └── __init__.pyMarks tools directory as a package
        └── config/Configuration files directory
            ├── agents.yamlAgent configurations
            └── tasks.yamlTask configurations

You can now start developing your crew by editing the files in the src/my_project folder. The main.py file is the entry point of the project, the crew.py file is where you define your crew, the agents.yaml file is where you define your agents, and the tasks.yaml file is where you define your tasks.

2

Customize your project

To customize your project, you can:

  • Modify src/my_project/config/agents.yaml to define your agents.
  • Modify src/my_project/config/tasks.yaml to define your tasks.
  • Modify src/my_project/crew.py to add your own logic, tools, and specific arguments.
  • Modify src/my_project/main.py to add custom inputs for your agents and tasks.
  • Add your environment variables into the .env file.

Next steps

Now that you have installed crewai and crewai-tools, you’re ready to spin up your first crew!

  • 👨‍💻 Build your first agent with CrewAI by following the Quickstart guide.
  • 💬 Join the Community to get help and share your feedback.