Skip to main content

Watch: Building CrewAI Agents & Flows with Coding Agent Skills

Install our coding agent skills (Claude Code, Codex, …) to quickly get your coding agents up and running with CrewAI. You can install it with npx skills add crewaiinc/skills

Build your first CrewAI Agent

Let’s create a simple crew that will help us research and report on the latest AI developments for a given topic or subject. Before we proceed, make sure you have finished installing CrewAI. If you haven’t installed them yet, you can do so by following the installation guide. Follow the steps below to get Crewing! 🚣‍♂️
1

Create your crew

Create a new crew project by running the following command in your terminal. This will create a new directory called latest-ai-development with the basic structure for your crew.
2

Navigate to your new crew project

3

Modify your `agents.yaml` file

You can also modify the agents as needed to fit your use case or copy and paste as is to your project. Any variable interpolated in your agents.yaml and tasks.yaml files like {topic} will be replaced by the value of the variable in the main.py file.
agents.yaml
4

Modify your `tasks.yaml` file

tasks.yaml
5

Modify your `crew.py` file

crew.py
6

[Optional] Add before and after crew functions

crew.py
7

Feel free to pass custom inputs to your crew

For example, you can pass the topic input to your crew to customize the research and reporting.
main.py
8

Set your environment variables

Before running your crew, make sure you have the following keys set as environment variables in your .env file:
  • A Serper.dev API key: SERPER_API_KEY=YOUR_KEY_HERE
  • The configuration for your choice of model, such as an API key. See the LLM setup guide to learn how to configure models from any provider.
9

Lock and install the dependencies

  • Lock the dependencies and install them by using the CLI command:
  • If you have additional packages that you want to install, you can do so by running:
10

Run your crew

  • To run your crew, execute the following command in the root of your project:
11

Enterprise Alternative: Create in Crew Studio

For CrewAI AMP users, you can create the same crew without writing code:
  1. Log in to your CrewAI AMP account (create a free account at app.crewai.com)
  2. Open Crew Studio
  3. Type what is the automation you’re trying to build
  4. Create your tasks visually and connect them in sequence
  5. Configure your inputs and click “Download Code” or “Deploy” Crew Studio Quickstart

Try CrewAI AMP

Start your free account at CrewAI AMP
12

View your final report

You should see the output in the console and the report.md file should be created in the root of your project with the final report.Here’s an example of what the report should look like:
Congratulations!You have successfully set up your crew project and are ready to start building your own agentic workflows!

Note on Consistency in Naming

The names you use in your YAML files (agents.yaml and tasks.yaml) should match the method names in your Python code. For example, you can reference the agent for specific tasks from tasks.yaml file. This naming consistency allows CrewAI to automatically link your configurations with your code; otherwise, your task won’t recognize the reference properly.

Example References

Note how we use the same name for the agent in the agents.yaml (email_summarizer) file as the method name in the crew.py (email_summarizer) file.
agents.yaml
Note how we use the same name for the task in the tasks.yaml (email_summarizer_task) file as the method name in the crew.py (email_summarizer_task) file.
tasks.yaml

Deploying Your Crew

The easiest way to deploy your crew to production is through CrewAI AMP. Watch this video tutorial for a step-by-step demonstration of deploying your crew to CrewAI AMP using the CLI.

Deploy on Enterprise

Get started with CrewAI AMP and deploy your crew in a production environment with just a few clicks.

Join the Community

Join our open source community to discuss ideas, share your projects, and connect with other CrewAI developers.