Vol. 14.3 CrewAI previewed crews as an alternative to RAG chains. This lecture is the Volume 15 multi-agent view: roles, tasks, sequential vs hierarchical process, tool loops per agent, memory, and HITL—mapped onto multi-agent systems and Module 15.2 memory types. Do not retake the RAG-vs-crew table from 14.3; go deeper on how crews behave as agents.
Compare with AutoGen (conversation-centric) and LangGraph (explicit graphs). CrewAI wins when humans think in job titles; graphs win when compliance needs a drawn state machine.
Learning Objectives
By the end of this lesson, students should be able to:
- Define CrewAI agents, tasks, tools, crews, and processes in agent terms.
- Choose sequential vs hierarchical process for a workflow.
- Give each role a narrow tool belt (incl. MCP / semantic lookup) to limit blast radius.
- Pass artifacts between agents instead of full transcripts (working memory).
- Add HITL review tasks and episodic recaps after the crew finishes.
- Know failure modes: role overlap, chatter cost, and hidden loops.
CrewAI orchestrates role-playing agents as a crew. Each agent has a role, goal, and backstory; tasks declare expected outputs; a process (sequential or hierarchical, with a manager) coordinates who works when. Each agent may run its own tool-calling loop to complete a task.
Crew Anatomy (Agent Lens)
| Piece | Agent meaning | 15.x link |
|---|---|---|
| Agent (role) | Specialist with permissions + prompt | Single-agent inside a team |
| Task | Goal + expected artifact | Planning unit |
| Tools | That role’s allowlisted actions | MCP tools / LC tools |
| Process | Coordination policy | Agentic workflow |
| Memory | Short-term WM + optional LTM | Module 15.2 types |
Sequential vs Hierarchical
Sequential
- Researcher → writer → reviewer
- Predictable cost
- Best for linear pipelines
Hierarchical
- Manager delegates + critiques
- More agency, more tokens
- Needs tight task specs
HITL slot
- Human as a “reviewer” task
- Or pause before write tools
- LangGraph if you need resume
Crew with Split Tool Belts
Vol. 14.3 showed a tiny researcher+writer crew. Here we add permissioning: only the researcher may hit semantic LTM and tickets; the writer has no write tools; a reviewer may flag HITL. That is multi-agent safety, not just roleplay flavor.
Memory and Cost
Crew “memory” flags often mix working memory with optional vector LTM. Keep semantic policy in a dedicated index; write one episodic recap after kickoff, not every internal message. Hierarchical managers can explode token spend—budget max iterations per agent the same way you cap a LangChain loop.
Pick CrewAI when
- Stakeholders think in roles/SOPs
- Tasks have clear artifacts
- You want fast multi-agent prototypes
- Sequential pipelines dominate
Tradeoffs
- Topology less explicit than LangGraph
- Chatter and cost blowups
- Vague roles → duplicated work
- HITL resume is weaker than checkpoints
“More agents always means better answers.” Three overlapping researchers will argue, retrieve the same chunks, and triple cost. Split by permission and output type (facts vs prose vs compliance), not by buzzwords. A single agent with good tools often beats a sloppy crew.
Knowledge Check
- Short Answer: What does a CrewAI process control? Answer: How tasks/agents are coordinated (e.g. sequential vs hierarchical).
- True/False: This lecture duplicates Vol. 14.3’s RAG-vs-crew intro only. Answer: False—it focuses on agent roles, tools, HITL, and memory.
- Multiple Choice: Passing
context=[t_research]is meant to share: (a) compact artifacts, (b) GPU kernels, (c) MCP hosts. Answer: (a). - Short Answer: Why give the writer no tools? Answer: Least privilege—reduce accidental writes and retrieval noise.
- True/False: Hierarchical process always cheaper than sequential. Answer: False—managers add tokens and loops.
- Multiple Choice: Durable pause/resume of a mid-crew write is stronger in: (a) LangGraph checkpoints, (b) CSS, (c) k-NN. Answer: (a).
- Short Answer: Where should policy text live—crew chat or semantic LTM? Answer: Semantic LTM (index/KB), retrieved on demand.
- True/False: More agents automatically improve quality. Answer: False.
- Multiple Choice: AutoGen’s metaphor vs CrewAI’s: (a) chats vs roles/tasks, (b) CNNs vs RNNs, (c) stdio vs HDMI. Answer: (a).
- Short Answer: Which lecture is the Volume 15 capstone on conversation-centric multi-agent + framework choice? Answer: AutoGen.
Key Takeaways
- CrewAI = role + task + process multi-agent, each role possibly tool-looping.
- Split tool belts; pass artifacts; cap iterations.
- Sequential for pipelines; hierarchical only with tight specs.
- Use LangGraph when you need inspectable HITL resume.
- Continue with AutoGen (Vol. 15 capstone).
Lab: Run researcher+writer with vs without writer tools; compare hallucinated “new facts.” Add a HITL_REQUIRED path when Jira write appears.
Whiteboard: Org chart vs LangGraph topology vs AutoGen group chat. Same SSO ticket through all three.
Recap: CrewAI is role-based multi-agent with task artifacts. Continue with AutoGen.