Track 04 · Multi-agent & integrationLesson 02 of 11
Crews that mirror the customer's team
Roles, delegation and coordination mapped onto real approval structures.
- Lesson library · reference
- 45 min read
- 75 min hands-on
- Pro
What you'll be able to do
01- Explain CrewAI's building blocks (agents with role, goal and backstory; tasks; crews; sequential and hierarchical processes; flows; delegation settings) and where each one's control actually sits.
- Map a customer's real team, RACI and delegation-of-authority matrix onto agents, humans and deterministic code, and justify which authority is never delegated to an agent.
- Design typed task handoff contracts (input and output schemas with provenance) and delegation rules (allowed edges, depth, retries) that a reviewer can test.
- Choose between shared crew memory and private per-agent state for each piece of information, including customer data.
- Diagnose role drift, conflicting outputs and manager mis-delegation from logs, and add the guard that stops each.
- Test a crew at three levels: contract tests per role, delegation-policy tests, and end-to-end runs scored against acceptance criteria.
Before you start
- Supervisor, router or swarm?: a crew is one way to implement a pipeline or supervisor topology.
- Typed output: schemas, validation and tool calls: contracts are schemas.
- System prompts that survive a regulated rollout: role, goal and backstory are a system prompt split into fields.
- Tools with scoped, auditable access: role boundaries are only real if tool scopes follow them.
- Approval gates and bounded autonomy: the gates this file's authority table points to.
The short version
A role-based crew assigns each agent a job description (role, goal, backstory), gives each unit of work a task with an expected output, and runs the tasks under a process: a fixed sequence, or a manager that decides who does what. That structure invites you to copy the customer's team. Copy the parts that carry meaning: who does which work, who may hand work to whom, and above all who holds authority to commit the organisation. Agents can hold the work. Consequential authority (sending a customer notice, changing a delivery date in SAP, waiving demurrage) stays with named humans or deterministic code, and the crew's design must make that structural, not a line in a prompt. Between roles, pass typed contracts rather than prose, validate them in code, and treat any agent that produces fields outside its contract as drifting out of its role.
Key takeaways:
- Map work, not boxes. An agent per role only where the role is also a context, permission or ownership boundary.
- Delegation moves work; it must never move authority or tool scope.
- Every handoff between roles is a schema with required fields, provenance and a validation step.
- Prefer a sequential process or a Flow for known procedures; use a manager only where the path genuinely varies, and log every delegation.
- Test roles like services: contract tests first, crew runs second.
Pro lesson
The rest of this lesson is in Pro.
The mental model, worked example, field note, failure table, exercise and self-check, with the voice tutor.
- Every stage and specialisation, in full
- Every lab and every role project
- Halden weeks 2–10, on your record
- Every drill, live in the playground
- All solutions, plus the server judge
- Lab Assistant and every Teach with AI