C.W.K.
Stream
Lesson 02 of 05 · published

CrewAI and Role-Based Teams

~36 min · crewai, roles, teams

Level 0Observer
0 XP0/40 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Role-based teams are interfaces

CrewAI popularized a clear role/task/crew mental model: agents have roles and goals, tasks define expected outputs, and a crew chooses a process such as sequential or hierarchical execution. That is useful when the collaboration shape is part of the product.

The trap is theatrical specialization. A "Researcher", "Writer", and "Reviewer" are useful only if their tools, context, permissions, or rubrics differ. Otherwise you created three names for one prompt.

YAML is a product surface

CrewAI's YAML-first recommendation is not just style. It makes roles and tasks reviewable without digging through orchestration code. That matters when non-engineers tune behavior or when multiple agents need clear contracts.

Coordinator before committee

Most useful multi-agent systems still need one coordinator that owns task decomposition and final synthesis. Free-form agent chatrooms look impressive and debug terribly.

Code

CrewAI role and task shape·yaml
researcher:
  role: Senior Research Analyst
  goal: Find current, source-backed information about {topic}
  backstory: Expert at separating official sources from noise

research_task:
  description: >
    Research {topic}. Prefer current official docs and record URLs.
  expected_output: >
    Ten source-backed findings with caveats and confidence.
  agent: researcher
Coordinator contract·json
{
  "subtask_id": "research_current_docs",
  "assigned_agent": "researcher",
  "input_context": ["topic", "official-source-preference", "date"],
  "expected_output": "source-backed findings",
  "budget": {"max_calls": 5, "max_minutes": 8},
  "return_shape": {"findings": [], "sources": [], "open_questions": []}
}

External links

Exercise

Design a three-agent crew. For each agent, name the role, unique tool access, task contract, and what the coordinator will do with the result.
Hint
If two agents have identical tools and rubric, merge them.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.