CrewAI proposes organisational metaphor: agents as employees with roles (analyst, researcher, writer), working on tasks, organised in crews (teams). Different approach from LangGraph (state graphs) and AutoGen (conversations). For teams wanting to express workflows in human-understandable terms, CrewAI offers natural abstraction.
The Model
Primitives:
- Agent: LLM with role, goal, backstory, tools.
- Task: unit of work with description and expected output.
- Crew: group of collaborating agents.
- Process: sequential or hierarchical execution.
from crewai import Agent, Task, Crew
researcher = Agent(
role='Senior Researcher',
goal='Find cutting-edge information',
backstory="You are expert researcher...",
tools=[search_tool]
)
writer = Agent(
role='Tech Writer',
goal='Write clear articles',
backstory="You write for a tech audience...",
)
research_task = Task(
description="Research latest in LLMs",
expected_output="Detailed report",
agent=researcher
)
writing_task = Task(
description="Write article based on research",
expected_output="Polished article",
agent=writer
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
process=Process.sequential
)
result = crew.kickoff()
Readable for product managers, not just engineers.
Process Types
Sequential
Task 1 → Task 2 → Task 3. Output of one → input of next.
Hierarchical
Manager agent coordinates workers. Manager decides what tasks to assign.
Custom
Define your process logic.
Tools
Agents can use:
- Built-in: search, code execution, file operations.
- Custom: your Python functions.
- LangChain tools: compatibility layer.
from crewai_tools import SerperDevTool, FileReadTool
researcher = Agent(
role='Researcher',
tools=[SerperDevTool(), FileReadTool()],
# ...
)
CrewAI vs LangGraph
| Aspect | CrewAI | LangGraph |
|---|---|---|
| Paradigm | Roles + tasks | State graphs |
| Abstraction level | High (human-readable) | Low (explicit) |
| Flexibility | Less flexible | More flexible |
| Debugging | Difficult | Better (state explicit) |
| Learning curve | Low | Medium |
CrewAI: fast prototyping, human-comprehensible. LangGraph: production-grade, debuggable.
CrewAI vs AutoGen
AutoGen (Microsoft):
- Conversation-based.
- Agents talk to each other.
- Free-form dialogues.
CrewAI:
- Task-based.
- More structured.
- Clearer flow.
For well-defined flows, CrewAI. For exploration, AutoGen.
Models and Providers
Agnostic:
from langchain_openai import ChatOpenAI
from langchain_anthropic import ChatAnthropic
llm = ChatOpenAI(model="gpt-4o")
# or
llm = ChatAnthropic(model="claude-3-5-sonnet-20240620")
researcher = Agent(
role='Researcher',
llm=llm,
# ...
)
Trivial provider switching.
Memory
Agents can have memory:
- Short-term: within execution.
- Long-term: across runs (via vector DB).
- Entity memory: tracking mentioned entities.
agent = Agent(
# ...
memory=True,
verbose=True
)
Better for multi-session interactions.
Where It Shines
- Content workflows: research + write + edit pipelines.
- Customer support: triage + resolve + escalate agents.
- Data analysis: collect + analyse + visualise + report.
- Business processes: legal review, contract analysis.
- Prototyping: rapidly testable ideas.
Limitations
Honest:
- Less debuggable than LangGraph state machines.
- Deterministic flow harder to enforce.
- LLM inconsistency: roles can “merge” in execution.
- Observability limited.
- Production-grade: younger than alternatives.
- Task dependencies implicit vs explicit.
Enterprise Features
CrewAI has enterprise tier:
- Custom deployment.
- Priority support.
- Advanced security.
- Team collaboration.
Paid for serious production.
Flows and Autonomy
Recent CrewAI additions:
- Flows: explicit control over execution.
- Routing: conditional logic.
- Listeners: reactive patterns.
Makes CrewAI more adaptable to complex logic vs originally rigid crew structure.
Enterprise Tool Integration
- Slack integration for chat-driven crews.
- Zapier: connect with 5000+ apps.
- REST APIs exposure.
- Databases: connectors.
Productive for real automation workflows.
Production-Ready Example
from crewai import Agent, Task, Crew, Process
from crewai_tools import SerperDevTool
# Define agents
market_researcher = Agent(
role='Market Researcher',
goal='Identify market trends',
backstory='Expert analyst...',
tools=[SerperDevTool()],
llm=ChatOpenAI(model="gpt-4o")
)
competitor_analyst = Agent(
role='Competitor Analyst',
goal='Analyse competitor strategies',
backstory='Strategist...',
tools=[SerperDevTool()]
)
report_writer = Agent(
role='Report Writer',
goal='Synthesise findings',
backstory='Senior writer...'
)
# Tasks
research = Task(
description='Research market for {product}',
expected_output='Market report',
agent=market_researcher
)
analyse = Task(
description='Analyse competitors based on research',
expected_output='Competitor analysis',
agent=competitor_analyst,
context=[research]
)
report = Task(
description='Write exec summary',
expected_output='Executive summary',
agent=report_writer,
context=[research, analyse]
)
# Crew
crew = Crew(
agents=[market_researcher, competitor_analyst, report_writer],
tasks=[research, analyse, report],
process=Process.sequential,
verbose=2
)
result = crew.kickoff(inputs={'product': 'AI code assistant'})
Minimal lines for complete workflow.
Costs
Cost = LLM tokens × agents × tasks × iterations.
For complex GPT-4 crews:
- Simple crew (2 agents, 3 tasks): ~$0.50-2 per run.
- Complex crew (5 agents, 10 tasks): ~$5-20 per run.
Factor in productive pricing.
Conclusion
CrewAI is the most accessible multi-agent framework in mental-model terms. Ideal for PMs, domain experts, and developers wanting to express workflows in human-understandable terms. For serious production with debugging and control, LangGraph wins. For conversational exploration, AutoGen. For rapid PoCs and business-focused workflows, CrewAI is winner. Its additions (Flows, Hierarchical) close the gap toward production-grade.
Follow us on jacar.es for more on multi-agent systems, LLMs, and orchestration.