CrewAI
Abstract
CrewAI — a framework for creating multi-agent teams. You describe 'crew members' with roles and goals, and they work together on a task.
Idea
Instead of one huge prompt, you create narrow specialists who pass the result down a chain: Researcher → Writer → Editor.
Agents in Example
| Agent | Role | Tools |
|---|---|---|
| Researcher | Finds facts and links | Search, parser |
| Writer | Writes an article | Text from Researcher |
| Editor | Checks facts and style | Guidelines, link verification |
Processes
- Sequential — pipeline: the result of the first agent goes to the input of the second.
- Hierarchical — an agent-manager decides who to delegate tasks to and returns bad work for rework.
Power of CrewAI
- Autonomy: agents make their own decisions ("I need more data — I'll make another request").
- Role isolation: each agent has a focused instruction.
- Memory: the crew remembers the results of previous steps.
Getting Started
pip install crewai
Minimal agent:
from crewai import Agent, Task, Crew
researcher = Agent(
role="Researcher",
goal="Find relevant facts on the topic",
backstory="Experienced analyst, loves to check sources.",
)
task = Task(
description="Collect 5 facts about RAG",
agent=researcher,
)
crew = Crew(agents=[researcher], tasks=[task])
result = crew.kickoff()
print(result)
Agents with roles and goals are combined into a 'crew' that performs tasks in sequence.