Knowing the mental model first makes every later API feel obvious instead of magical.
Think of a small newsroom. A researcher gathers facts, a writer turns them into an article, and an editor checks it. Each person has a clear job, and work passes from one to the next. CrewAI lets you build software that works the same way, with AI agents instead of people.
CrewAI is a Python framework for building multi-agent applications: programs where several AI agents, each with its own job, work together. It is written from scratch and does not depend on LangChain.
It has two main building blocks:
- A Crew is a team. You describe each agent by its role, goal and backstory, list the tasks to do, and CrewAI runs the agents through those tasks. Crews are good when some freedom and creativity is fine, like research or writing.
- A Flow is ordinary Python code organised as steps that react to each other. A flow keeps state (data that lives across steps), can branch, and can call crews, single model calls or plain functions. Flows are good when you need precise control.
Real applications often combine them: a flow controls the overall process, and crews handle the fuzzy, creative parts.
Around these, CrewAI adds tools (functions agents can call), memory and knowledge, guardrails that check outputs, a command-line tool named crewai for projects, and CrewAI AMP, the company's hosted platform for tracing and deploying crews and flows.
This course covers CrewAI 1.x. Older tutorials from the 0.x era mostly still read correctly, but project templates, memory and some command flags have changed since then.
Example
# pip install crewai (needs Python 3.10 - 3.13 and an LLM API key)
from crewai import Agent, Crew, Task
writer = Agent(
role="Tech writer",
goal="Explain technical ideas simply",
backstory="You write short, friendly explainers for beginners.",
)
explain = Task(
description="Explain what {topic} is in three sentences.",
expected_output="Three plain-language sentences.",
agent=writer,
)
crew = Crew(agents=[writer], tasks=[explain])
result = crew.kickoff(inputs={"topic": "a vector database"})
print(result.raw) # A vector database stores ... (wording varies)Remember
- A crew is a team of role-based agents working through tasks
- A flow is event-driven Python code with state that can call crews
- Combine them: flows for control, crews for open-ended work
Watch out for
- Assuming CrewAI is built on LangChain; it is an independent framework with its own APIs.