CrewAI

Role-Based Multi-Agent · Deep-Dive DD-12 · Course 1

60 minutes · 45,900+ stars · The emergent-coordination pole · The most accessible multi-agent framework

Describe the team you wish you had, and it runs. Role-based sequential/concurrent crews. The coordination graph emerges from roles and tasks — simpler to declare, harder to audit. Paired with LangGraph (DD-10) as the declared-coordination pole, load-bearing for Course 4 E09.

Deep-Dives · The Harness Roster

The thesis — describe the team

LANGGRAPH (DD-10)

Draw the graph. Nodes, edges, conditional routing. Declared coordination. Maximum ceremony, maximum auditability.

CREWAI

Describe the team. Roles, goals, backstories. Emergent coordination. The graph emerges from task context refs and process type.

AGENTS SDK (DD-11)

Compose agents. Handoffs + agents-as-tools. Production primitives with sandboxing. The SDK foundation.

"Describe the team" beats "draw the graph" for first-time builders. CrewAI is the most accessible entry point into multi-agent orchestration in the roster. The cost: the emergent graph is invisible past ~5 tasks, and the framework sacrifices production-readiness (no sandbox, crew-scoped shared memory, run logs below the structured-event floor).

The three primitives — Crew, Agent, Task

PRIMITIVE 1
Agent (unit of role)

System prompt assembled from role + goal + backstory + tools. Role IS the system prompt. Module 12 at agent granularity.

PRIMITIVE 2
Task (unit of work)

Description, assigned agent, expected output, optional context (other tasks). The dependency graph emerges from context refs — not drawn.

PRIMITIVE 3
Crew (unit of orchestration)

Holds agents, tasks, process strategy. Owns the loop, the memory, the kickoff entry point. Sequential or concurrent.

That is the entire mental model — and the entire reason CrewAI has 45,900+ stars. crewai kickoff reads the process type and dispatches. You never write a loop; you declare a team.

Emergent vs declared coordination — the load-bearing axis

CREWAI — emergent

Define roles + tasks. Graph emerges from context refs + process type. Simpler, faster setup. Less auditable — the graph is invisible past ~5 tasks.

LANGGRAPH (DD-10) — declared

Draw nodes + edges. Graph IS a first-class object. More ceremony. Fully auditable, checkpointable, interruptible.

The diagnostic question: do you need to prove properties about the coordination graph? If yes (compliance, security audit, reproducibility), declared coordination earns its ceremony. If no (prototyping, internal tools), emergent coordination earns its speed. This axis is the organizing principle of Course 4 E09.

Two orchestration modes

SEQUENTIAL (default)

Tasks run in list order. Each output appended to shared context the next agent reads. A linear ReAct chain across multiple roles. Composes well for research-then-write, draft-then-review.

CONCURRENT / HIERARCHICAL

Manager agent decomposes the goal, assigns subtasks to workers, synthesizes results. One-level hierarchy — shallower than DD-06's multi-tier Sisyphus/Prometheus/Atlas/Junior design.

Sequential is the well-trodden path and the reason CrewAI earns 4/5 on Module 1.3 (Subagents) — it is a textbook multi-agent pattern. Use hierarchical when a manager's synthesis adds value the sequential chain cannot.

The security surface — handoffs + shared memory

TASK-OUTPUT HANDOFF INJECTION

Each handoff is an untrusted-content boundary (Module 2.4 V1). A compromised upstream agent injects instructions into its output; the downstream agent reads and acts on them.

CREW-SCOPED MEMORY POISONING

All agents share one memory store. A compromised agent writes a poisoned entry that every other agent reads. No write isolation — Module 4.3 unavailable by default.

The compounding that makes shared memory convenient is the same compounding that makes poisoning dangerous. Same argument as Hermes (DD-08), except here the compounding is across agents within a single crew run, not across sessions. Cure: treat every handoff as untrusted input; opt for agent-scoped memory (not available by default).

The score profile — 33/60, orchestration-first shape

ModuleScoreKey decision
1.3 Subagents4/5sequential crews are a textbook multi-agent pattern
1 Loop3/5role-per-turn, conversation-driven; token-heavy
2 Tools3/5per-agent attachment (good); no isolation enforcement
4 Memory3/5three tiers exist; crew-scoping forfeits write isolation
5 Sandbox1/5none. Bring your own Docker/E2B
8 State2/5limited checkpointing; long crews don't resume
9 Verification1/5none built-in
11 Security1/5no security model; shared memory is an attack surface
TOTAL33/60orchestration-first: accessible, not production-ready
Read the score as a profile, not a ranking. The 4/5 on Module 1.3 and the 1/5 on Modules 5/9/11 are the same design decision — CrewAI optimizes for orchestration accessibility and treats production-readiness as bring-your-own.

Anti-patterns

Role-ifying everything because the abstraction is pleasant. The role/goal/backstory template is so intuitive that every multi-step task becomes a crew. The cost: latency, token cost (each agent re-reads context), and a new injection surface per handoff. Cure: if one agent with a subtask list could do it, you don't need a crew.
Treating task-output handoffs as trusted. Each handoff is an untrusted-content boundary. A compromised upstream agent injects instructions the downstream agent executes. Cure: validate task outputs before injecting them into the next agent's prompt.
Deploying CrewAI crews without sandboxing. No built-in sandbox (Module 5: 1/5). Tools with side effects run on the host. Cure: bring your own sandbox (Docker, E2B). Same lesson as NemoClaw (DD-09) and the Agents SDK (DD-11), except CrewAI makes it bring-your-own.

What you can now do

  1. State CrewAI's defining contribution — the role-based mental model — and why "describe the team" is the most accessible multi-agent entry point.
  2. Distinguish emergent coordination (CrewAI) from declared coordination (LangGraph, DD-10) and explain why this contrast defines the multi-agent coordination axis (Course 4 E09).
  3. Describe the three primitives, the two orchestration modes, and the role-to-prompt mapping (Module 12 at agent granularity).
  4. Score CrewAI 33/60 and defend the shape: 4/5 on Module 1.3, low on production-readiness modules.
  5. Articulate the security implications of crew-scoped shared memory and the untrusted-content boundary at each task handoff.
The lab: simulate a CrewAI-style role-based crew, observe the emergent dependency graph, and demonstrate the security risk (indirect prompt injection propagating through a task-output handoff into crew-scoped shared memory).

Next: DD-13 — OpenHarness