Role-Based Agent Teams — Roles, Tasks, Processes
Four primitives: Agent, Task, Crew, Process. Two top-level shapes: Crews (autonomous, role-based collaboration) and Flows (event-driven, deterministic). CrewAI is the 2026 reference implementation, and its docs are blunt: "for any production-ready application, start with a Flow." Name CrewAI's four primitives (Agent, Task, Crew, Process) and what each owns. Distinguish Sequential, Hierarchical, and the planned Consensus process; pick one per workload. Distinguish Crews (autonomous role-based) from Flows (event-driven deterministic), and explain the docs' production recommendation. Wire tools with the @tool decorator and BaseTool subclass; reason about structured outputs vs free text. Name the four CrewAI memory types and when each pays off. Implement a stdlib three-agent crew (researcher, writer, editor) that produces a brief. Spot the three CrewAI failure modes: prompt-bloat, manager-LLM tax, brittle handoffs. Teams adopting multi-agent frameworks hit the same wall. "Autonomous collaboration" sounds great in a demo. Then a customer files a bug and you need deterministic replay. Or finance asks how much an LLM-routed crew costs per run. Or on-call needs to know which agent stalled at 3 AM. Free-form LLM-routed crews answer none of those cleanly. Pure DAGs answer them all but lose the exploratory shape a brainstorming agent needs. CrewAI's split is honest about the trade. Crews for collaborative, role-based, exploratory work. Flows for event-driven, code-owned, auditable production. Same framework, two shapes, pick per surface.…
Role-Based Agent Teams — Roles, Tasks, Processes: Four primitives: Agent, Task, Crew, Process. Two top-level shapes: Crews (autonomous, role-based…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.