CrewAI — Multi-Agent Orchestration Framework
Build teams of autonomous AI agents that collaborate on complex tasks. Define roles, assign tasks, and let crews work together.
What it is
CrewAI is a Python framework for building teams of autonomous AI agents that collaborate on complex tasks. You define agents with specific roles (researcher, writer, reviewer), assign them tasks, and CrewAI orchestrates the execution order, inter-agent communication, and output aggregation. Each agent can use tools, delegate to other agents, and build on previous agents' work.
CrewAI targets AI application developers building multi-step workflows that benefit from role specialization. Instead of one monolithic prompt, you split work across agents that each focus on what they do best.
Why it saves time or tokens
A single LLM call handling research, analysis, writing, and review produces bloated context and mediocre results. CrewAI splits this into focused agent calls, each with a narrow role and relevant context. The result is better output quality with smaller per-call token budgets. Agent delegation means the research agent gathers facts and passes only the relevant ones to the writer, reducing redundant processing.
How to use
- Install CrewAI:
pip install crewai - Define agents with roles, goals, and backstories
- Define tasks and assign them to agents, then kick off the crew
Example
from crewai import Agent, Task, Crew
researcher = Agent(
role='Researcher',
goal='Find accurate data on the topic',
backstory='Expert at finding and verifying information'
)
writer = Agent(
role='Writer',
goal='Write a clear, engaging article',
backstory='Skilled technical writer'
)
research_task = Task(
description='Research the latest trends in AI agents',
agent=researcher
)
write_task = Task(
description='Write a 500-word article based on the research',
agent=writer
)
crew = Crew(agents=[researcher, writer], tasks=[research_task, write_task])
result = crew.kickoff()
| Concept | Purpose |
|---|---|
| Agent | Role-based AI worker with tools |
| Task | Specific assignment for an agent |
| Crew | Team of agents working together |
| Tool | External capability (search, code) |
Related on TokRepo
- Multi-agent frameworks — compare multi-agent orchestration frameworks on TokRepo
- CrewAI deep-dive — dedicated CrewAI page with examples
Common pitfalls
- Defining too many agents increases latency and token cost; start with 2-3 agents and add more only when role separation improves output
- Agent backstories that are too vague produce generic output; specific backstories with domain expertise produce better results
- Sequential task execution is the default; use the
Process.hierarchicalmode for manager-worker patterns where a supervisor delegates dynamically
Frequently Asked Questions
CrewAI provides a higher-level abstraction focused on role-based agent teams. LangGraph provides a lower-level graph-based orchestration where you define nodes and edges manually. CrewAI is faster to prototype with, while LangGraph gives more control over execution flow, branching, and state management.
Yes. CrewAI agents can use tools like web search, file reading, API calls, and code execution. You define tools as Python functions or use built-in tool integrations. Each agent can have a different set of tools matching its role, so the researcher gets search tools and the coder gets execution tools.
Yes. CrewAI supports OpenAI, Anthropic Claude, Google Gemini, local models via Ollama, and any provider accessible through LiteLLM. You can assign different models to different agents, using a capable model for complex reasoning and a cheaper model for simple tasks.
Hierarchical mode adds a manager agent that dynamically delegates tasks to worker agents based on their roles and capabilities. Instead of tasks running in a fixed sequence, the manager decides the execution order and can reassign work. This is useful for complex workflows where the optimal order depends on intermediate results.
Yes. Agents can delegate tasks to other agents and receive their output. The output of one task becomes available as context for subsequent tasks. In hierarchical mode, the manager facilitates communication. You can also configure explicit inter-agent dependencies in the task definition.
Citations (3)
- CrewAI GitHub— CrewAI orchestrates teams of autonomous AI agents
- CrewAI Docs— CrewAI supports role-based agent collaboration
- Anthropic Research— Multi-agent systems improve task decomposition and output quality
Related on TokRepo
Source & Thanks
Created by crewAIInc. Licensed under MIT. crewAI — ⭐ 47,400+ Docs: docs.crewai.com
Thanks to the CrewAI team for building the leading multi-agent orchestration framework.