CrewAI Tutorial

Welcome to the CrewAI tutorial. Based on the official CrewAI docs and the open-source crewAIInc/crewAI project, this guide shows how to ship multi-agent apps with Flows (event-driven backbone) and Crews (role-playing agent teams).

Official framing: start production apps with a Flow. Put a Crew inside a Flow step only when you need autonomous collaboration.


Table of Contents

Basics

  1. Introduction — Positioning, Flows vs Crews, vs LangChain / LlamaIndex
  2. Installation — Python, uv / pip, CLI, coding-agent skills
  3. Quick Start — First Crew, and a minimal Flow with @start / @listen

Core objects

  1. Agentsrole / goal / backstory, tools, kickoff()
  2. Tasksdescription, expected_output, context and output
  3. Crews and ProcessesCrew, Process.sequential / hierarchical

Capabilities

  1. Toolscrewai[tools], built-ins, custom BaseTool / @tool
  2. Flows — State, @start / @listen / @router, Crews inside steps
  3. Memory — Unified Memory, four usage patterns

Practice

  1. Practical Examples — Research/write crew, Flow wrapping a Crew, retrieval tools
  2. Resources — Official docs and related courses on this site

Learning path

StageGoalChapters
Day 1Run a CrewIntro → Install → Quick Start
Days 2–3Core objectsAgents → Tasks → Crews and Processes
Week 1Orchestration & memoryTools → Flows → Memory
Week 2A full projectExamples → Resources

Prerequisites

  • Python 3.10+ (official: >=3.10 and <3.14)
  • Familiarity with LLM / Chat APIs
  • At least one provider API key (OpenAI, Anthropic, etc.)
CourseRelationship
LangChainAgent harness + LangGraph graphs; single-agent / custom graphs
LlamaIndexIndexing and query engines; CrewAI can wrap them via LlamaIndexTool
RAGChunking, embeddings, vector stores; this course calls retrieval as tools

Two ways in

PathBest forCommand / files
CLI scaffoldStandard layout, JSONC, later AMP deploycrewai create flow or crewai create crew
Python scriptsLearning Agent / Task / Crew / Flow firstpip install crewai then kickoff()

This tutorial covers both. Object semantics follow the Python API; JSONC fields map to the same official Agent / Task / Crew attributes.

Object cheat sheet

You want to…Use
Give a role, goal, and personaAgent(role, goal, backstory)
Specify work and a done-definitionTask(description, expected_output)
Assemble a team and a strategyCrew(..., process=Process.sequential|hierarchical)
Own state, order, and branchesFlow + @start / @listen / @router
Let agents take actionstools=[...] (crewai[tools] or custom)
Remember facts across tasksMemory / memory=True

What you will build

  1. A sequential two-agent Crew — researcher then writer
  2. A stateful Flow@start sets a topic; a @listen step runs crew.kickoff()
  3. A production-shaped skeleton — search / files / custom tools, memory across tasks

This course does not cover every AMP enterprise console feature; use the official platform docs for that.

Start with Introduction.

评论