CrewAI
Type: full-code · Vendor: CrewAI Inc. · Language: Python · License: MIT · Status: active · Status in practice: mature · First released: 2023-10-27
Orchestrate teams of role-playing autonomous agents that collaborate on multi-step tasks under a declared Process (sequential or hierarchical), optionally driven by event-driven Flows.
Description. CrewAI is the MIT-licensed Python framework from CrewAI Inc. that models a multi-agent system as a Crew: a collaborative group of role-defined Agent objects assigned ordered Task objects and executed under a declared Process (sequential by default, or hierarchical with a manager agent). On top of crews, CrewAI exposes Flows, an event-driven orchestration layer built around @start, @listen, and @router decorators that manages typed state and routes execution based on emitted events. The framework ships a unified memory store (LanceDB by default at ./.crewai/memory), automatic delegation/ask-question collaboration tools, MCP integration via the mcps field and MCPServerAdapter, and structured outputs via Pydantic.
Agent loop shape. Crew/Process loop: a Crew binds Agents to ordered Tasks and runs them under Process.sequential (linear chaining, each task feeds the next) or Process.hierarchical (a manager_llm delegates to crew members and validates outcomes). Flows wrap Crews in an event-driven graph where @start() methods are entry points, @listen(other_method) fires when its upstream emits, and @router() emits labels that other listeners gate on. Per-agent budgets (max_iter default 25, max_rpm, max_execution_time) bound the inner ReAct/tool loop.
Primary use cases
- teams of role-playing agents collaborating on a project
- event-driven multi-step workflows that mix LLM calls and code
- hierarchical workflows with a manager agent delegating to specialists
Key concepts
- Crew (docs) — Collaborative group of agents working together to achieve a set of tasks.
- Agent (docs) — Autonomous unit defined by role / goal / backstory that performs tasks, makes decisions, and uses tools.
- Task (docs) — A specific assignment completed by an Agent.
- Process (docs) — How Tasks are orchestrated inside a Crew. Process.sequential = linear order; Process.hierarchical = manager_llm delegates and validates.
- Flow → event-driven-agent (docs) — Event-driven workflow layer built on @start / @listen / @router decorators with managed typed state.
- Unified Memory → cross-session-memory (docs) — Single Memory class replacing separate short-term, long-term, entity, and external memory types; default LanceDB store at ./.crewai/memory.
Patterns this full-code implements —
- ★★Cross-Session Memory
Unified Memory class with LLM-driven save-time analysis and adaptive-depth recall; default LanceDB store at ./.crewai/memory (or $CREWAI_STORAGE_DIR/memory).
- ★★Event-Driven Agent
Flows wrap Crews in an event-driven graph; @start() entry points, @listen() listeners triggered by upstream emits, @router() labelled branches.
- ★Handoff
When allow_delegation=True, agents automatically gain delegation and ask-question collaboration tools; the 'Delegate work to coworker' tool is the canonical handoff mechanism.
- ★★Model Context Protocol
First-class MCP support: agents declare an `mcps` field for direct integration, or use MCPServerAdapter from crewai-tools for manual connection management.
- ★★Orchestrator-Workers
Process.hierarchical pairs a manager_llm (or manager_agent) with crew members; the manager allocates tasks based on role and capability and validates outcomes.
- ★★Role Assignment
Every Agent is defined by a role/goal/backstory triple; these fields directly drive the agent's behaviour and the framework markets itself as a 'role-playing' agent framework.
- ★★Step Budget
Per-agent budgets bound the inner ReAct/tool loop: max_iter (default 25), max_rpm, max_execution_time.
- ★★Structured Output
Tasks accept output_pydantic / output_json for structured outputs; the framework markets structured outputs via Pydantic.
- ★★Supervisor
Hierarchical Process with manager_llm IS the supervisor pattern in CrewAI: a central manager coordinates and validates worker agents.
- ★★Tool Use
Tools are first-class: Agents declare callable Tools; async tools supported for non-blocking I/O.
- ★★Agent Resumption
replay_from_task can replay from the most recent kickoff; no general checkpoint/resume durability comparable to LangGraph's Checkpointer.
- ★★Agentic RAG
Knowledge sources expose a provider-neutral RAG client (default ChromaDB, Qdrant supported) with automatic query rewriting, but RAG is not the framework's headline shape.
- ·CAMEL Role-Playing
CrewAI promotes role/goal/backstory triples on every agent (verbatim 'role-playing' language in the repo description), but does not implement CAMEL's two-agent task-specifier/AI-assistant dialectic.
Neighbourhood
Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.