Learn CrewAI

Python framework for teams of role-playing AI agents (crews) and event-driven flows

25 lessons · 5 hours · 4 levels · covers CrewAI 1.15 (crewai 1.15.x, Oct 2026)

CrewAI is a standalone Python framework for multi-agent applications. You describe agents by role, goal and backstory, give them tasks and tools, and run them together as a crew; Flows add event-driven, stateful control around crews and plain code. It also covers memory, knowledge, guardrails, training and testing, tracing, and deployment to the hosted CrewAI AMP platform.

Before you start

CrewAI builds on these; the tree links to the exact lessons you need.

How deep do you want to go?

1. EssentialsRead and write simple code, do the everyday basics8 lessons · 1 hour in total
2. PracticalUse it productively at work, with the usual idioms16 lessons · 3 hours in total
3. AdvancedThe less common features, performance and trade-offs21 lessons · 4 hours in total
4. ExpertInternals and the edge cases experts know25 lessons · 5 hours in total

The CrewAI tree

CrewAIWhat CrewAI isWhat CrewAI isInstalling CrewAI and API keysInstalling CrewAI andAPI keysAgents: role, goal and backstoryAgents: role, goaland backstoryTasks and expected outputTasks and expectedoutputCrews and kickoffCrews and kickoffChoosing and configuring LLMsChoosing andconfiguring LLMsSequential process and task contextSequential processand task contextCrewAI projects with the CLICrewAI projects withthe CLIClassic projects: crew.py and YAMLClassic projects:crew.py and YAMLGiving agents toolsGiving agents toolsWriting custom toolsWriting custom toolsStructured outputsStructured outputsTask guardrailsTask guardrailsFlows: start, listen and stateFlows: start, listenand stateRouting and joining in flowsRouting and joining inflowsCrews inside flows: choosing the designCrews inside flows:choosing the designWhat an AI agent isWhat an AI agent isVirtual environments and pipVirtual environmentsand pipSystem prompts and instructionsSystem prompts andinstructionsClasses and instancesClasses andinstancesTool calling (function calling)Tool calling (functioncalling)Type hints basicsType hints basicsStructured output (JSON)Structured output(JSON)
Essentials and Practical shown (16 of 25 lessons); the full list is below. Click a lesson to read it.

All 25 lessons, in order

Agents, tasks and crews

  1. What CrewAI is · Essentials · 8 min

    Understand CrewAI's two building blocks, crews of agents and flows, and what each is for.

  2. Installing CrewAI and API keys · Essentials · 8 min

    Install the crewai package and CLI, pick provider extras, and keep API keys in a .env file.

  3. Agents: role, goal and backstory · Essentials · 10 min

    Define an Agent with role, goal and backstory, and know the settings that shape its behaviour.

  4. Tasks and expected output · Essentials · 10 min

    Describe work as a Task with a description, an expected output and an assigned agent.

  5. Crews and kickoff · Essentials · 10 min

    Combine agents and tasks into a Crew, start it with kickoff(inputs=...), and read the CrewOutput.

  6. Sequential process and task context · Essentials · 10 min

    Control how task results flow between tasks in a sequential crew with context and async tasks.

Projects and models

  1. Choosing and configuring LLMs · Essentials · 10 min

    Pick each agent's model with the LLM class or a provider/model string, including local models via Ollama.

  2. CrewAI projects with the CLI · Essentials · 12 min

    Scaffold a project with crewai create crew, define agents and tasks in JSONC files, and run it with crewai run.

  3. Classic projects: crew.py and YAML · Practical · 12 min

    Read and write the classic layout with @CrewBase, agents.yaml and tasks.yaml, still common in tutorials and flows.

Tools, outputs and guardrails

  1. Giving agents tools · Practical · 10 min

    Add ready-made tools from crewai-tools to agents or tasks, and understand how agents decide to use them.

  2. Writing custom tools · Practical · 12 min

    Turn your own Python functions into tools with the @tool decorator or a BaseTool subclass with an input schema.

  3. Structured outputs · Practical · 12 min

    Get validated Pydantic objects from tasks and crews with output_pydantic, and from a single agent with response_format.

  4. Task guardrails · Practical · 12 min

    Validate task outputs with function or plain-language guardrails that send failures back to the agent for a retry.

Flows

  1. Flows: start, listen and state · Practical · 14 min

    Build a Flow class whose steps run with @start and @listen and share typed state.

  2. Routing and joining in flows · Practical · 12 min

    Branch a flow with @router labels and wait for several steps with or_ and and_.

  3. Crews inside flows: choosing the design · Practical · 12 min

    Call crews and single agents from flow steps, scaffold flow projects, and decide when to use crews, flows or both.

  4. Persistence and human input · Advanced · 14 min

    Save and resume flow state with @persist, and pause for people with human_input and @human_feedback.

  5. Async, batch and streaming runs · Advanced · 10 min

    Run crews concurrently with async kickoff, over many inputs with kickoff_for_each, and stream output as it is generated.

Collaboration, memory and knowledge

  1. Hierarchical process and delegation · Advanced · 12 min

    Let a manager agent plan, delegate and review work with Process.hierarchical, and know its costs.

  2. Memory · Advanced · 12 min

    Enable CrewAI's unified Memory so agents remember facts across tasks and runs, and control its scope and storage.

  3. Knowledge sources · Advanced · 12 min

    Give agents searchable reference material such as policies, PDFs and CSVs through knowledge sources.

Testing, observability and deployment

  1. Training and testing crews · Expert · 14 min

    Improve agents with human feedback using crewai train, and score crews over several runs with crewai test.

  2. Tracing and event listeners · Expert · 12 min

    See every agent step, tool call and token with CrewAI tracing, event listeners and third-party observability tools.

  3. Deploying to CrewAI AMP · Expert · 12 min

    Deploy a crew or flow to CrewAI AMP with crewai deploy, and call it through its kickoff and status API.

  4. Reliable, safe and affordable crews · Expert · 14 min

    Apply limits, security boundaries and design patterns that keep multi-agent systems reliable and cheap in production.