TL;DR — CrewAI lets you build multi-agent systems by thinking in roles: define agents with backstories, assign tasks with expected outputs, pick a process (sequential or hierarchical), and hit run. The fastest path from "I need three agents working together" to working code. Less flexible than LangGraph, more opinionated than AutoGen, but ships faster.
What it is
CrewAI is a Python framework for orchestrating role-based AI agent teams. You define agents (role, goal, backstory), tasks (description, expected output, assigned agent), and a crew (the team + process type). The framework handles delegation, context passing between tasks, and tool execution.
Fig 1 — A sequential crew: each task's output becomes the next task's context.
Why it exists
LangGraph gives you raw graph primitives. AutoGen gives you multi-agent conversations. CrewAI says: most multi-agent workflows are teams with roles doing tasks in order. So it gives you exactly that abstraction — no graph DSL, no message-passing protocol, just agents, tasks, and a process.
Install & setup
pip install crewai crewai-tools
export OPENAI_API_KEY=sk-...
Building a crew
from crewai import Agent, Task, Crew, Process
researcher = Agent(
role="Senior Researcher",
goal="Find the most relevant information about {topic}",
backstory="You're an expert researcher who excels at finding key facts.",
verbose=True,
)
writer = Agent(
role="Technical Writer",
goal="Write a clear, concise summary about {topic}",
backstory="You transform research into polished technical writing.",
verbose=True,
)
research_task = Task(
description="Research {topic} and list the 5 most important points.",
expected_output="A list of 5 key facts with sources.",
agent=researcher,
)
write_task = Task(
description="Write a 200-word summary using the research provided.",
expected_output="A polished 200-word summary.",
agent=writer,
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
process=Process.sequential,
verbose=True,
)
result = crew.kickoff(inputs={"topic": "vLLM PagedAttention"})
print(result.raw)
Tools
from crewai.tools import tool
@tool
def search_web(query: str) -> str:
"""Search the web for information."""
return f"Results for: {query}"
researcher = Agent(
role="Researcher",
goal="Research topics thoroughly",
backstory="Expert researcher.",
tools=[search_web],
)
Hierarchical process
A manager agent automatically delegates tasks to the best-suited agent:
crew = Crew(
agents=[researcher, writer, reviewer],
tasks=[research_task, write_task, review_task],
process=Process.hierarchical,
manager_llm="gpt-4o",
)
Memory
Enable short-term, long-term, and entity memory so agents remember across tasks and even across crew runs:
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
memory=True, # enables all memory types
)
When to use, when to skip
Use it when your problem maps naturally to "a team of specialists doing tasks in order" — content pipelines, research workflows, report generation. Fastest time-to-working-demo of any multi-agent framework.
Skip it when you need fine-grained control over agent control flow (use LangGraph), complex conversation dynamics (use AutoGen), or you only have one agent (use LangChain or Pydantic AI).
vs the alternatives
| Tool | Best for | Trade-off |
|---|---|---|
| CrewAI | Quick role-based teams, content pipelines | Less control over flow |
| AutoGen | Multi-agent conversation, research | More complex setup |
| LangGraph | Custom graph control flow | More wiring needed |
| Smolagents | Minimal code-first agents | Less multi-agent support |
Verified against CrewAI docs (docs.crewai.com), May 2026.