Heidelberg AICurriculum
Track 7 · Advanced
7.4

CrewAI

A Python framework for a team of agents with roles, tasks and tools

9 lessons 2026-08-13 AI-generated

1Overview

CrewAI is code, not a canvas: you declare agents with a role, a goal and a backstory, give them tasks, and let the crew work through them in sequence or in parallel. Because it is plain Python you get version control, tests and real dependency management — the things a visual builder cannot give you. Start with a scaffolded crew, read the agents' reasoning as they run, then add your own tools and models.

CrewAI is the code path to multi-agent work. You declare each agent — role, goal, backstory — hand the crew a list of tasks, and watch them work through it. Everything is Python, so it lives in git alongside the rest of your project.

1.2After this chapter you can
Scaffold a runnable multi-agent crew with one CLI command
Read a crew: which behaviour lives in YAML and which in Python
Parameterise a crew with inputs so one definition serves many jobs
Add an agent and a tool, and watch one agent hand work to the next
Deploy a crew from GitHub and manage it once it is running
1.3How do I define an agent?

You create a Python class or instance specifying its role, goal, and backstory, then add it to the crew configuration so the framework knows what each agent is supposed to do.

1.4Can tasks run concurrently?

Yes—CrewAI lets you arrange tasks to be executed in sequence or launch multiple agents in parallel, letting the team tackle different steps at the same time.

1.5What benefits does plain Python give?

Using pure Python means your crew lives in git, can be unit‑tested, and integrates with standard dependency tools, offering version control and reproducibility that visual builders lack.

2Lessons 9

2.1 Scaffold your first CrewAI project

CrewAI is code, not a canvas. A crew is a team of agents — each with a role, a goal and a backstory — working through tasks. The CLI scaffolds the whole project for you: agents and tasks as YAML, the assembly as Python, so you start by reading a working example rather than an empty file.

Generate a runnable two‑agent CrewAI codebase with a single command

Trypip install crewai crewai create crew my_first_crew

Run these in a terminal with Python 3.10+. crewai create crew scaffolds a whole project folder for you — you don’t write it from scratch. Prefer uv? uv tool install crewai installs the same CLI faster and keeps it out of your global Python.

  1. Open a terminal and execute pip install crewai to add the framework to your environment
  2. Run crewai create crew my_first_crew --classic to generate a project directory pre‑populated with a researcher and a writer agent using the classic YAML scaffold
  3. Edit the generated .env file and insert your LLM API key so the agents can access a model
  • You'll see A project folder appears containing researcher and writer agents together with configuration files
  • Takeaway One CLI command creates a complete multi‑agent scaffold you can immediately inspect and run
  • Check The scaffold produced a researcher and a writer. Where is each one actually defined?
  • Cost The CrewAI framework is free and open-source (MIT). You only pay your LLM provider for the tokens the agents use when you run the crew — billed separately by them.

2.2 Inspect a crew’s configuration

A scaffolded crew consists of three files. agents.yaml defines each agent’s role, goal and backstory; tasks.yaml describes what each task should produce and which agent handles it; crew.py wires the YAML files together into a runnable Crew.

Do this first Scaffold your first CrewAI project

Identify how agents, tasks and the crew definition work together by editing the generated files

TryOpen config/agents.yaml and change the 'writer' agent's goal to: "Write a punchy 5-bullet summary a busy founder can read in 30 seconds." Then open config/tasks.yaml and tighten its task description to match.

CrewAI separates who the agents are (agents.yaml), what they do (tasks.yaml), and how they're assembled (the Python crew.py). Edit the YAML — you rarely touch the Python at first.

  1. Open config/agents.yaml to view each agent’s role, goal and backstory
  2. Open config/tasks.yaml to see each task’s description, expected output and assigned agent
  3. Open crew.py to observe how the YAML files are imported and assembled into a Crew
  • You'll see The crew broken into separate YAML files for agents and tasks plus a short Python script that binds them
  • Takeaway A crew is just agents + tasks + an assembly step; using YAML keeps the structure clear and easy to change
  • Check You want an agent to stop writing in bullet points. Which of the three files do you edit?
  • Cost Editing config files costs nothing — you only spend LLM tokens when you actually run the crew.

2.3 Execute a crew and observe agent reasoning

Running a crew prints its thinking, not just its answer. Each agent announces the task it took, reasons out loud, and hands its output to the next agent as context.

Do this first Inspect a crew’s configuration

Run your crew and see agents reason, hand off work, and generate a report

Trycrewai run

Run this from inside your project folder. Make sure your LLM API key is set in .env first, or the run will fail to reach a model.

  1. Execute crewai run from the project folder
  2. Monitor the handoff as the researcher’s output is passed to the writer agent
  3. Read the final report printed in the terminal or written to a file
  • You'll see Two agents printing their step‑by‑step reasoning, passing work between them, and producing a short written report from a single command
  • Takeaway Running a crew makes the abstraction concrete: you see agents reason, collaborate and deliver
  • Check The writer produced a report about the wrong topic. Which part of the run log tells you whether the researcher or the hand‑off was at fault?
  • Cost This run spends real LLM tokens billed by your provider (a small report is typically a few cents). The CrewAI framework itself stays free.

2.4 Parameterise a crew: a market-data collector in YAML

In a scaffolded crew the agents and tasks are YAML files, not Python. Anything in {curly_braces} is an input the crew fills in at run time, turning a one‑off script into a reusable tool.

Do this first Execute a crew and observe agent reasoning

Define a collector agent in YAML with a {ticker} input and run the same crew against different companies

Trycrewai run --input ticker=TSLA

Run this in your terminal inside the project folder from Lesson 0. Swap TSLA for any ticker — the crew definition does not change.

  1. Open config/agents.yaml and add a collector agent with a role, a goal containing {ticker} and a short backstory
  2. Open config/tasks.yaml and add a collect_task that names agent: collector, describes the desired output and reuses the same {ticker} placeholder
  3. Edit crew.py to include the new task in the crew’s tasks list so it runs
  4. Run crewai run --input ticker=TSLA, then run it again with a different ticker and compare the two outputs
  • You'll see The collector’s reasoning streams in the terminal, then a formatted summary of price, change and headlines for each ticker you passed
  • Takeaway Put the changing part in {braces} and pass it as an input — that is the line between a script you rewrite and a crew you reuse
  • Check Where does a crew get the value for {ticker} — the YAML, crew.py, or the command line?
  • Cost CrewAI itself is free and open-source (MIT). Each run spends your own LLM tokens, and a two-agent crew makes several calls per run — so re-running it across ten tickers costs roughly ten times one run.

2.5 Add a second agent: an OCR extractor that reads a PDF

A crew grows by adding a pair of entries, one in agents.yaml and one in tasks.yaml. The framework then sequences them so the second agent receives the first’s output as context automatically.

Do this first Parameterise a crew: a market-data collector in YAML

Add an OCR extractor agent that turns a PDF into text and hands that text to the rest of the crew

Trycrewai run --input file=sample.pdf

Drop any PDF named sample.pdf into the project folder first, then run this in the terminal from that folder.

  1. Add an extractor entry to config/agents.yaml with role "document extractor", a goal referencing {file} and a backstory stating it returns plain text only
  2. In crew.py, attach CrewAI’s file‑read tool (e.g., FileReadTool) to the extractor agent so it can open PDFs
  3. Add an extract_task entry to config/tasks.yaml pointing at agent: extractor and place it before any task that consumes the extracted text
  4. Run crewai run --input file=sample.pdf and read the log to see the extractor invoked first and its output used as context for the next agent
  • You'll see The log shows the extractor starting, calling its file tool, printing the extracted text, then the next agent’s turn opening with that text in its context
  • Takeaway Extending a crew is two YAML entries plus a tool — the framework passes one agent’s output to the next
  • Check Why does an extractor agent without a file‑reading tool still produce an answer, and why is that answer worthless?
  • Cost Free framework; the cost is tokens. OCR-style tasks push a whole document into the prompt, so a long PDF is by far the most expensive step in the crew — check the page count before you run it repeatedly.

2.6 Equip agents with custom tools and select their LLM

A tool is a callable function agents can use; without one they only talk. The LLM setting is per‑agent, allowing different models for gathering versus writing.

Do this first Add a second agent: an OCR extractor that reads a PDF

Make agents more capable by attaching tools and configuring the language model they use

TryGive the researcher agent a web-search tool so it can pull current information instead of relying only on the model's memory, and point the crew at the LLM you prefer.

CrewAI is model-agnostic and ships a large library of tools/integrations. You attach tools to agents in code; you pick the model via your .env / config.

  1. Install the extra tools package with pip install 'crewai[tools]' if you need built‑in utilities
  2. Add a tool (e.g., a search or file‑reading utility from CrewAI’s toolkit) to the desired agent definition in config/agents.yaml
  3. Specify the LLM for each agent by adding an llm field with your provider name and API key in the agent’s YAML entry
  4. Run the crew with crewai run and observe the researcher call its tool mid‑task and pass the result to the writer
  • You'll see An agent invokes a real tool during its reasoning and the crew runs on the chosen LLM
  • Takeaway Tools turn agents from talkers into doers and model‑agnostic configuration avoids vendor lock‑in
  • Check Why is it usually wrong to give every agent in a crew the same model?
  • Cost Still free at the framework level; tools that hit paid APIs and your LLM usage are billed by those providers. Bringing your own key means you control the spend.

2.7 Pick the right structure for your AI project

CrewAI offers two structures: a Crew where agents self‑organise, suited for open‑ended research; and a Flow with explicit steps and branching, suited for deterministic pipelines.

Do this first Equip agents with custom tools and select their LLM

Decide whether to use an autonomous crew or a deterministic flow for a given task

TryList the steps in your current task that MUST happen in a fixed order (e.g. fetch data → validate → only then write). Those are the steps a Flow would make deterministic.

CrewAI gives you two paradigms. A Crew is autonomous — agents decide how to collaborate. A Flow is structured and event-driven — you control the exact path.

  1. Identify whether the task requires open‑ended research or a fixed sequence of actions
  2. Select a Crew if agents should self‑organise their collaboration
  3. Select a Flow if you need deterministic, event‑driven control with explicit steps and branching
  • You'll see A clear mental model for choosing between an autonomous crew and a structured flow for a given problem
  • Takeaway Reach for Crews when you want emergent collaboration, and Flows when you need a controlled, repeatable pipeline
  • Check A nightly report that must always contain the same five sections — Crew or Flow?
  • Cost Conceptual lesson — no extra cost beyond whatever you run while experimenting.

2.8 Deploy your crew from GitHub in CrewAI AMP

AMP is CrewAI’s hosted platform; it pulls your crew from a GitHub repository and runs it on managed infrastructure, keeping environment variables separate from source code.

Do this first Pick the right structure for your AI project

Push a code‑first crew to a repository and launch it on the hosted platform with one click

TryDeploy crew from GitHub repository https://github.com/yourusername/your-crew-repo.git on branch main

In the CrewAI AMP UI, select Deploy your crews from GitHub, enter the repo URL and choose the branch as shown, then add any required environment variables and optionally enable Automatically deploy new commits. Watch for the deployment status to turn green indicating success.

CrewAI AMP deploy screen: a 'Deploy your crews from GitHub' panel with Repository and Branch dropdowns, an 'Automatically deploy new commits' checkbox, and Environment Variables fields
  1. 1 Which crew ships empty until you connect GitHub
  2. 2 Which branch ships one branch, not the whole repo

Best viewed on desktop — tap Enlarge to read the numbered controls.

Deploy from GitHub in CrewAI AMP: pick a repository and branch, set environment variables (like your LLM API key), and deploy — optionally redeploying on every new commit. Credit: docs.crewai.com/en/enterprise/guides/deploy-crew ↗
  1. Push your crew to a GitHub repository
  2. In CrewAI AMP, choose Deploy your crews from GitHub, select the repository and branch, then click Deploy
  3. Enter required environment variables (e.g., your LLM API key) and optionally enable automatic redeploy on new commits
  • You'll see Your crew appears in CrewAI AMP as a deployed workflow linked to the selected GitHub repo
  • Takeaway A visual editor and GitHub integration let you turn code into a hosted agent without managing servers
  • Check Why does deploying from GitHub, rather than uploading files, matter for a crew you will keep changing?
  • Cost AMP's Basic tier is free (50 workflow executions/month, visual editor, AI copilot, GitHub integration). Enterprise is custom-quote (50 hours of development/month, hosted or private infra). You still bring your own LLM key — that usage is billed separately.

2.9 Track and manage deployed crews

A deployed crew is exposed as an HTTP endpoint with a bearer token. The dashboard lists each crew’s URL and token and provides controls to rotate tokens, redeploy or delete the crew.

Do this first Deploy your crew from GitHub in CrewAI AMP

Identify each crew’s URL and bearer token and control them from a single dashboard

Trycrewai deploy my_first_crew

Run this in a terminal with Python 3.10+. When the progress view finishes, note the live URL and Bearer Token shown, then open the management dashboard (e.g., via crewai dashboard) to verify your crew appears with its credentials.

One dashboard, every deployed crew. Each card carries the crew’s live URL and its Bearer Token — the two things a caller needs — plus Reset to rotate the token and Re-deploy / Delete / Manage to change what is running. Credit: docs.crewai.com/en/enterprise ↗
  1. Open the management dashboard to view all deployed crews side by side
  2. Click Reset next to a token to rotate it
  3. Use the Manage / Re‑deploy / Delete controls to modify or remove a crew
  • You'll see A production dashboard listing your deployed crews with their URLs, bearer tokens and management controls
  • Takeaway Deployments provide a secure endpoint that can be monitored and managed centrally
  • Check Your crew’s URL is in a public repo. What is the one thing to do first?
  • Cost Included in the AMP tier you're on (Basic counts runs against its 50/month). Calling your crew still spends your own LLM tokens, billed by your provider.

3You’ll know it worked 35 checkable outcomes in this chapter

  • The console output shows each agent sequentially executing its declared goals and invoking the configured tools according to the YAML script
  • The console displays the CrewAI workflow progress with task execution logs and final results printed to the screen
  • The project directory appears with subfolders like `knowledge`, `source`, `agents.yaml`, `tasks.yaml`, `crew.py` and `main.py`.
  • Agent successfully retrieves data from an external API and incorporates it into its output
  • Calling `jargon_tool.run('PRX is ready')` returns the string with `PRX` replaced by its full form
  • The console shows a separate “Planning” phase output before any tool calls
  • CrewAI logs show “Agent collector started” when running the crew
  • Running the crew shows the new agent’s task execution in the log

35 outcomes in all — one per recipe below.

4FAQ, Tips & How-to 35

one problem, one solution, one action
How-to CrewAI Everyone

Need a code‑only setup for agents and tasks

Learn how to set up agents, tasks, and flows using code instead of a visual canvas

~15 min · low code CrewAI official docs — Introduction ↗ AI-generated
How-to Everyone

I don’t know my installed version

CrewAI requires Python >3.10 and <3.13. Checking the installed version ensures compatibility before proceeding with any installation steps.

CrewAI ↗ Lesson → AI-generated
How-to Everyone

Want quick package handling for CrewAI

UV replaces pip/virtualenv for rapid package handling; installing it correctly lets you later install CrewAI and lock dependencies efficiently.

CrewAI ↗ Lesson → AI-generated
How-to Everyone

Want the CrewAI command usable anywhere in your terminal

Using `uv tool install crewai` pulls the latest CrewAI package and registers a command‑line entry point; running the post‑install path update ensures the CLI is on your PATH.

CrewAI ↗ Lesson → AI-generated
How-to CrewAI Everyone

I need a starter folder for my AI crew

The `crewai create crew <name>` command auto‑generates a ready‑to‑edit directory containing agents, tasks, tools and config files in YAML, saving manual setup time.

CrewAI ↗ AI-generated
How-to CrewAI Everyone

Need a reproducible workflow with hidden API keys

Locking with `crewai install` creates a reproducible UV lock file; adding OpenAI and SerpAPI keys in `.env` secures credentials; `crewai run` orchestrates agents, tools, and tasks to produce the final report.

CrewAI ↗ AI-generated
How-to CrewAI Everyone

Need a short article created by three roles

CrewAI abstracts multi‑agent work into a simple crew definition: you list role classes, set each role’s goal, and the framework automatically schedules agents to fulfill those goals. This reduces boilerplate and makes the codebase highly readable.

Digibase Media ↗ AI-generated
How-to Everyone

Agents need to keep memory across steps

LangGraph builds on LangChain to let you model agents as nodes in a directed graph, where each node can read/write to shared state. This gives explicit control over execution order, error handling, and persistent memory across steps.

Digibase Media ↗ Lesson → AI-generated
How-to Everyone

Want tasks to run one‑by‑one or all together

The process layer in Crew AI acts as a workflow manager that defines how tasks move between agents. By setting the process to sequential, tasks run one after another; by setting it to parallel, multiple agents operate simultaneously, speeding up execution for independent tasks.

CodeLegends ↗ Lesson → AI-generated
How-to Everyone

Agents need to pull data from external services

Crew AI allows each agent to be equipped with specific tools or APIs from its toolkit, enabling agents to interact with external data sources or services without building integrations from scratch.

CodeLegends ↗ Lesson → AI-generated
How-to Everyone

Need an isolated Python setup for a Crew AI project

The tutorial shows how to create a new project folder, set up a virtual environment with UV package manager, and add the crewai-tools package. This ensures an isolated Python environment and fast dependency resolution for Crew AI development.

codebasics ↗ Lesson → AI-generated
How-to Everyone

Want to keep your Gemini API key out of code

The video demonstrates creating a `.env` file, storing the Gemini API key there, and loading it in Python via `python-dotenv`. This keeps secrets out of code and lets Crew AI access the model.

codebasics ↗ Lesson → AI-generated
How-to CrewAI Everyone

A rough draft email you wrote

Using Crew AI's `Agent`, `Task`, and `Crew` classes, the tutorial creates an agent with role, goal, and backstory prompts, then defines a task that rewrites a rough email. This shows how prompt engineering drives agent behavior.

codebasics ↗ AI-generated
How-to CrewAI Everyone

My AI agent can’t understand company abbreviations

The video builds a subclass of `BaseTool`, implements a `run` method that replaces organization‑specific abbreviations, and registers the tool in an agent. This demonstrates how to give agents domain knowledge they otherwise lack.

codebasics ↗ AI-generated
How-to CrewAI Everyone

Want a short, fact‑based blog post

By defining a researcher agent and a writer agent, then creating two tasks (research facts → write blog), the tutorial shows how Crew AI passes output from one agent as input to the next, enabling complex pipelines.

codebasics ↗ AI-generated
How-to CrewAI Everyone

Your AI stops at its knowledge cutoff

The tutorial imports `SerperTool`, supplies a SerpAPI key, and attaches the tool to the researcher agent. This enables the agent to perform live Google searches, overcoming LLM knowledge cutoffs.

codebasics ↗ AI-generated
How-to CrewAI Everyone

Prompt text hard‑coded in Python

Crew AI can load agent and task definitions from YAML files. The video moves role, goal, backstory, and task descriptions into `agents.yml` and `tasks.yml`, then uses a subclass of `CrewBase` to reference those files, achieving loose coupling.

codebasics ↗ AI-generated
How-to CrewAI Everyone

When you want your AI crew to plan before acting

Setting `reasoning=True` makes Crew AI perform a planning step before acting, improving task decomposition. The tutorial explains the difference between reactive and reasoning modes.

codebasics ↗ AI-generated
How-to CrewAI Everyone

Want agents to remember their output across steps

Crew AI provides `ReadDirectoryTool` and `WriteFileTool`. The tutorial uses them to store generated social‑media drafts in a folder structure, demonstrating persistent storage across agent steps.

codebasics ↗ AI-generated
How-to Everyone

CrewAI commands aren’t available on your system

CrewAI is distributed as a UV tool, so you first need the Rust‑based package manager UV installed, then use it to pull the crewai executable. This gives you a ready‑to‑run CLI for creating and running crews.

NeuralNine ↗ Lesson → AI-generated
How-to CrewAI Everyone

Need a ready project layout to start coding

The CLI can generate a starter project with the correct folder layout, config files and an executable script. You just name your crew and it creates source, test, and knowledge directories.

NeuralNine ↗ AI-generated
How-to CrewAI Everyone

Want the latest stock price, change and headlines for a ticker

CrewAI agents can call Python functions annotated as tools. By wrapping a yfinance query in a function and decorating it with `@tool`, the agent can retrieve price, change and recent headlines as plain text.

NeuralNine ↗ AI-generated
How-to CrewAI Everyone

Need a market data collector that works for any ticker

Agents are described in simple YAML with three fields: role, goal, and backstory. Placeholders like `{ticker}` can be used so the same definition works for any input.

NeuralNine ↗ AI-generated
How-to CrewAI Everyone

Want an agent to call a specific tool

Tasks link an agent to a concrete action. The description tells the agent which tool to call, and `expected_output` defines the format you want back.

NeuralNine ↗ AI-generated
How-to CrewAI Everyone

Need to use a locally hosted AI instead of OpenAI

CrewAI reads provider settings from an `.env` file. By replacing the OpenAI key/model with `OLAMA_MODEL`, `OLAMA_API_BASE`, you can run the same crew on any locally hosted model.

NeuralNine ↗ AI-generated
How-to CrewAI Everyone

Need a daily stock snapshot

With agents, tasks, and tools wired together, invoking `crewai run` executes the workflow: collector fetches data, summarizer condenses it, risk checker flags issues, and brief writer produces the final report.

NeuralNine ↗ AI-generated
How-to CrewAI Everyone

Want to add an OCR step to your workflow

You can grow the workflow by adding another YAML agent (e.g., OCR extractor) and a matching task, then list it in `crew.py`. The framework will orchestrate the new step automatically.

NeuralNine ↗ AI-generated
How-to CrewAI Everyone

Need multiple AI agents to collaborate

Crew AI lets you define multiple specialized agents that collaborate to solve a larger problem. By specifying each agent's role, goal, backstory and tools, the framework orchestrates sequential task execution, passing results between agents automatically.

aiwithbrandon ↗ AI-generated
How-to CrewAI Everyone

Need an AI with a specific role, goal and backstory

Each Crew AI agent is a self‑contained LLM with a clear purpose. The role is its job title, the goal describes the concrete result it must deliver, and the backstory provides context that guides its behavior. Attaching tool decorators makes external functions (e.g., calculator or search) available to the agent.

aiwithbrandon ↗ AI-generated
How-to CrewAI Everyone

Agents need to perform calculations themselves

Custom tools expose Python functions to agents via the @tool decorator. The calculator example shows how to accept an expression string, safely evaluate it, and return the result, enabling agents to perform arithmetic without hard‑coding logic.

aiwithbrandon ↗ AI-generated
How-to CrewAI Everyone

Agents need to look up info online

The search tool lets agents query Google via Serper, returning top results with titles, URLs, and snippets. Storing the API key in a .env file keeps credentials safe, and the @tool decorator makes the function callable by any agent.

aiwithbrandon ↗ AI-generated

The same set on /recipes, filtered by tool and role.

5Videos 3

6FAQ 2

What are agents, tasks, and a crew?

These are CrewAI's core building blocks. An agent is a role-playing AI worker with a role, a goal, a backstory, and optionally tools and its own LLM, for example a researcher whose goal is to find the latest facts on a topic. A task is a specific unit of work with a description and an expected output, assigned to an agent. A crew is the team of agents plus the list of tasks, run together with a process (such as sequential) that decides the order. In a scaffolded project you describe agents in agents.yaml and tasks in tasks.yaml, then wire them together in Python. Running the crew makes the agents collaborate and produce a final result.

How do I give my agents tools like web search or file access?

Agents become useful when you attach tools. CrewAI ships a large library of ready-made tools (web search, scraping, file reading and writing, code execution, database and API access, and more), and you can also write custom tools as simple Python functions. You import a tool, instantiate it, and pass it in the agent's tools list, either in code or wired through the YAML-plus-Python scaffold. When the agent runs, it decides when to call a tool to gather information or take an action, rather than relying only on what the LLM already knows. Some tools need their own API keys (for example a search provider), which also go in your .env file.

7Glossary 12 terms

Show the 12 terms
CrewAI
pip install crewai
The terminal command that downloads and installs the CrewAI library onto your computer so Python can use it.
crewai create crew
A CrewAI CLI command that generates a ready-to-run project folder with all the starter files your crew needs (config files, crew.py, and a .env template).
crewai run
A CrewAI CLI command that executes your crew or flow, reading the project type automatically from pyproject.toml and running all the agents and tasks you have defined.
.env
A hidden text file in your project folder where you store secret settings like API keys so they are not baked into your code.
agents.yaml
A CrewAI configuration file (in YAML format) where you describe each agent's role, goal, and backstory without writing Python code.
tasks.yaml
A CrewAI configuration file (in YAML format) where you describe each task — what it asks for, what output it expects, and which agent handles it.
crew.py
The main Python file generated by CrewAI that wires your agents and tasks together into a runnable crew using the settings in your YAML config files.
Crew
The core CrewAI Python class that groups your agents and tasks together and controls how they collaborate to complete a goal.
role
A plain-English field in agents.yaml naming what an agent is (e.g. 'Senior Researcher'), shaping how it approaches its tasks.
goal
A plain-English field in agents.yaml stating what an agent is trying to achieve, steering its reasoning and output.
backstory
A plain-English field in agents.yaml giving an agent context about its experience, further tuning how it behaves.
expected output
A field in tasks.yaml describing what a finished task should produce, guiding the assigned agent's response.

8See also

💬 Discuss this chapter

Ask, share, or report — over on the Heidelberg AI community forum.