Qlaudia

← All courses

CrewAI

  • Artificial Intelligence
  • Technology & Computing

Multi-agent AI systems divide complex workflows across specialized agents, each with a defined role, goal, and backstory that shape their reasoning. CrewAI provides a Python framework to orchestrate these agent teams through tasks, tools, and execution processes like sequential or hierarchical delegation.

Sign in to enroll$1034 lessons

What you'll learn

  • Agent DefinitionThe complete configuration of parameters that specifies who a CrewAI agent is, what it aims to achieve, how it should reason, and what capabilities it has available.
  • Task DefinitionThe atomic unit of work in CrewAI that specifies what needs to be done, who should do it, and what success looks like through its three required fields: description, expected_output, and agent.
  • LLM IntegrationThe configuration of which large language model powers each agent and how it communicates with that model to drive reasoning and decision-making.
  • CrewThe top-level container that binds agents, tasks, and an execution strategy together into a single runnable pipeline.
  • Multi-Agent SystemAn AI architecture where multiple autonomous agents with distinct roles and tools collaborate sequentially or in parallel to accomplish tasks that would be difficult or impossible for a single agent to handle alone.
  • Crew KickoffThe method call that starts execution of a crew and sets the entire multi-agent workflow in motion.
  • Context Passing Between TasksThe mechanism that automatically feeds the output of earlier tasks into the prompt of later tasks so agents can build on prior work.
  • Task Expected OutputAn explicit contract in natural language that tells an agent what form its response should take, what information to include, and how to structure the output to ensure consistency across multi-step pipelines.
  • Agent RoleA short label defining an agent's specialization that gets injected into the agent's system prompt to activate relevant knowledge and reasoning patterns from the underlying language model.
  • Tool AssignmentThe process of attaching tools to agents during construction to enable them to take real-world actions like web search, file access, and API queries beyond reasoning from training data alone.
  • Research Pipeline PatternA multi-agent workflow pattern that decomposes research tasks into distinct sequential phases—information gathering, synthesis, and compilation—with each phase owned by a specialist agent.
  • Sequential ProcessCrewAI's default execution mode where tasks run one at a time in the order specified, with each task's output automatically provided as context to all subsequent tasks.
  • Automated Analysis PatternA multi-agent decomposition approach that breaks analytical workflows into specialist roles — data gathering, interpretation, and report generation — to allow each agent to excel at its sub-problem.
  • Content Production PatternA structured workflow that assigns outlining, drafting, and editing stages to separate dedicated agents, allowing each to optimize within a tightly scoped problem.
  • CrewAI vs AutoGenA comparison showing CrewAI models collaboration as a team of specialists executing a structured workflow, while AutoGen models it as a conversation between agents with no fixed pipeline.
  • Hierarchical ProcessAn execution mode where a designated manager agent coordinates the crew by deciding which agent handles which task and in what order rather than executing tasks sequentially.
  • CrewAI YAML ConfigurationA separation of concerns pattern in CrewAI where agent personas and task descriptions are defined in external YAML files while tool wiring and execution logic remain in Python code.
  • Agent GoalA persistent statement of intent that answers what an agent is ultimately trying to accomplish and influences its prioritisation, self-evaluation, and tool use across all assigned tasks.
  • Human-in-the-Loop InputA deliberate pause point in crew execution where a human reviews, corrects, or approves an output before the agents continue, typically used in high-stakes workflows.
  • CrewAI vs LangGraphA comparison where CrewAI uses a role-based team metaphor with agents and tasks, while LangGraph uses an explicit graph execution model with nodes and conditional state transitions.
  • Short-Term MemoryA temporary, in-session storage mechanism that allows agents to recall recent interactions, intermediate outputs, and task results within a single crew execution before being discarded at the end of the run.
  • Crew OutputA structured container returned after crew execution that holds the final answer, individual task results, and token usage metadata.
  • RAG-Based MemoryA memory mechanism that stores information as vector embeddings and retrieves semantically relevant entries at query time, surfacing information based on relevance to the current task rather than recency.
  • Agent BackstoryA free-form natural-language description of an agent's identity, expertise, and perspective that is injected into the system prompt to shape how the underlying language model interprets instructions and reasons about problems.
  • Agent DelegationThe mechanism by which one agent hands off a subtask to another agent judged to be better suited for that work, enabling multi-agent collaboration.
  • Agent MemoryThe capability for an agent to retain and reference information, facts, and prior decisions across task interactions rather than starting each task from a blank slate.
  • Built-in CrewAI ToolsPre-packaged tools available through the crewai-tools package that handle authentication, API communication, and output formatting for common tasks like web research and file access.
  • Manager AgentThe agent responsible for orchestrating all other agents in hierarchical mode by deciding task assignments, monitoring output quality, and reassigning work as needed.
  • Asynchronous Task ExecutionA CrewAI mechanism for running independent tasks concurrently so that total execution time can be shorter than the sum of individual task durations.
  • Verbose ModeA debugging setting that instructs CrewAI to print detailed logs of agent reasoning, tool invocations, and decision-making in real time during crew execution for observability and problem diagnosis.
  • Long-Term MemoryA persistent storage layer that allows agents to retain knowledge and prior results across separate crew executions, enabling the crew to improve with repeated use.
  • CrewAI CLIA command-line tool that provides commands for creating new projects, running crews, and managing framework utilities with a consistent project layout.
  • Custom Tool CreationThe practice of wrapping domain-specific logic in Python classes that allow CrewAI agents to invoke custom capabilities like API calls, database queries, or file operations alongside built-in tools.
  • Task CallbackA Python function registered on a task that automatically executes when the task completes, receiving the task's output as an argument to enable side effects like logging or external system integration without modifying task logic.

About this course

CrewAI Overview

CrewAI is an open-source Python framework for building multi-agent AI systems — software architectures where multiple autonomous AI agents collaborate to complete complex tasks. Released in late 2023 and growing rapidly through 2024–2025, CrewAI distinguishes itself from other multi-agent frameworks through a single guiding metaphor: a crew of specialists. Just as a real-world project team assigns distinct roles to different people — a researcher, a writer, an editor, a fact-checker — CrewAI lets you define a team of AI agents, each with its own role, goal, and backstory, that work together toward a shared objective.

This document gives you a map of the territory before you dive into individual concepts.


Why Multi-Agent Systems?

A single large language model (LLM) can answer questions, write text, and reason about problems. But for complex, multi-step workflows — such as researching a topic, drafting a report, reviewing it for accuracy, and formatting it for publication — a single agent becomes a bottleneck. It must context-switch constantly, loses focus, and struggles to maintain quality across very different kinds of sub-tasks.

Multi-agent systems solve this by dividing labour: each agent focuses narrowly on what it does best. A research agent stays in research mode; a writing agent stays in writing mode. The result is higher quality output, more maintainable pipelines, and the ability to tackle tasks that exceed a single agent's context window or capability.


The Core Metaphor: Crew and Roles

CrewAI's central design decision is to make agent configuration feel like hiring for a team. Every agent is defined by three identity fields:

  • Role — the job title or area of specialisation (e.g., "Senior Research Analyst").
  • Goal — the specific objective this agent is trying to achieve (e.g., "Find accurate, up-to-date information on the given topic").
  • Backstory — a short narrative that provides context and shapes the agent's reasoning style (e.g., "You are a meticulous analyst who values source quality above speed").

These fields are not cosmetic. They are injected into the agent's system prompt, directly influencing how the underlying LLM reasons and responds. This is what makes CrewAI's abstractions functional, not just descriptive.


Key Components

Crew Sequential or Hierarchical Process Agent 1 Role: Researcher Goal: Gather data Backstory: ... Tools: web_search Agent 2 Role: Writer Goal: Draft report Backstory: ... Tools: file_write Agent 3 Role: Editor Goal: Review quality Backstory: ... Tools: none Task 1 Assigned to Agent 1 Task 2 Assigned to Agent 2 Task 3 Assigned to Agent 3 Final Output Returned to caller

A CrewAI crew consists of agents (each with a role, goal, backstory, and optional tools), tasks assigned to those agents, and a process that determines execution order. The final task's output becomes the crew's result.

Here are the primary building blocks you will encounter:

Agents

The individual AI workers. Each agent wraps an LLM and is configured with a role, goal, and backstory. Agents can also be given tools — callable functions that let them interact with the outside world (search the web, read files, call APIs, etc.).

Tasks

Discrete units of work assigned to a specific agent. A task has a description (what to do), an expected output (what a good result looks like), and an agent responsible for completing it. Tasks can pass their output to the next task in the sequence.

Tools

External capabilities an agent can invoke during its reasoning loop. CrewAI integrates with LangChain tools and its own built-in tool library, allowing agents to augment their LLM reasoning with real-world data access.

Process

The orchestration strategy that determines how tasks are executed. CrewAI supports two main process types:

  • Sequential — tasks run one after another, each receiving the output of the previous task as context.
  • Hierarchical — a manager agent delegates tasks to worker agents dynamically, enabling more flexible coordination.

Crew

The top-level object that wires everything together: a list of agents, a list of tasks, a chosen process type, and optionally an LLM for the manager. Calling crew.kickoff() starts execution.


How CrewAI Compares

CrewAI is not the only multi-agent framework, but it occupies a distinct niche:

CrewAILangGraphAutoGen
AbstractionRoles & crewsNodes & graphsConversation threads
Mental modelTeam of specialistsState machineAgent dialogue
Entry barrierLowMedium–HighMedium
Control granularityMediumHighMedium

For developers who want to get a working multi-agent pipeline running quickly — without needing to understand graph theory or message-passing architectures — CrewAI is the most accessible starting point.


A Minimal Example

from crewai import Agent, Task, Crew

researcher = Agent(
    role="Research Analyst",
    goal="Find key facts about {topic}",
    backstory="You are a precise analyst who prioritises source credibility."
)

task = Task(
    description="Research the history of {topic} and summarise the top 5 findings.",
    expected_output="A bullet-point summary with 5 key facts.",
    agent=researcher
)

crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff(inputs={"topic": "quantum computing"})
print(result)

This is the essence of CrewAI: define agents with identity, define tasks with intent, combine them in a crew, and kick it off.


What You Will Learn Next

Now that you have the big picture, the following concepts drill into each component in depth:

  • Multi-Agent Systems — why collaboration between agents matters and when it helps.
  • Agent Definition — how to configure a CrewAI agent in full detail.
  • Agent Role, Goal, and Backstory — what each identity field actually does under the hood.
  • Tasks, Tools, and Processes — the mechanics of work assignment and execution flow.

Building an intuition for the crew-and-roles metaphor early will make every subsequent concept click into place naturally.

CrewAI — Qlaudia