PythonHigh — roles/crews/agents out of the box
CrewAI
Fast assembly of role-based multi-agent teams where each agent has a persona, goal, and tools, and tasks are distributed sequentially or by a manager.
Architecture
- Agent = role + goal + backstory + tools + LLM; these strings are compiled into the system prompt.
- Task = description + expected output + assigned agent, optionally with
contextfrom earlier tasks andoutput_pydanticfor typed results. - Crew = agents + tasks +
process(sequentialorhierarchical, where a manager LLM delegates). - Flows (newer) add event-driven,
@start/@listen/@routerorchestration with state, sitting above crews for deterministic control flow. - Memory modules (short-term, long-term, entity) are opt-in and backed by embeddings plus a local store.
Best use cases
- Demos and internal tools where a "researcher → writer → reviewer" pipeline maps cleanly onto roles.
- Content generation and report drafting with clear stage boundaries.
- Non-specialist teams that want a readable YAML/Python description of who does what.
Weaknesses
- Hidden prompts: role/goal/backstory are wrapped in substantial framework prompt text; what the model actually sees is not what you wrote.
- The persona abstraction encourages multi-agent designs where one agent with a good prompt would be cheaper and more reliable (When Not to Use Multi-Agent).
- Token cost multiplies: each task re-sends context, and hierarchical mode adds manager round-trips.
- Failure handling is coarse — a mid-crew tool error or a hallucinated delegation is hard to intercept, retry, or checkpoint.
- Debuggability: verbose console logs are the primary tool; tracing hooks exist but are less mature than LangSmith or OpenTelemetry-first stacks.
When NOT to use it
- Production workloads with strict latency or cost budgets.
- Anything needing deterministic control flow with approvals — use a state graph.
- Single-agent problems; the role machinery adds prompts, tokens, and failure surface for nothing.
Code example
Illustrative — APIs change between versions.
1from crewai import Agent, Task, Crew, Process2from crewai_tools import SerperDevTool3 4search = SerperDevTool()5 6researcher = Agent(7 role="Market researcher",8 goal="Find current, sourced facts about {topic}",9 backstory="Meticulous analyst who cites sources.", # becomes prompt text10 tools=[search],11)12writer = Agent(role="Technical writer", goal="Write a 300-word brief", backstory="Plain-English explainer.")13 14research = Task(description="Research {topic}", expected_output="Bullet list with URLs", agent=researcher)15brief = Task(description="Write the brief from the research", expected_output="Markdown brief",16 agent=writer, context=[research])17 18crew = Crew(agents=[researcher, writer], tasks=[research, brief], process=Process.sequential)19result = crew.kickoff(inputs={"topic": "vector database pricing"})20print(result.raw)