Skip to content

Founder-led. Limited engagements.Talk to Us →

Part 10 of 30 · 30 Days of AI Agents

CrewAI | 30 Days of AI Agents, Day 10

Day 10 of 30 Days of AI Agents: how CrewAI organizes role-based agent teams, tasks, and processes, with a working example and honest trade-offs.

By CodeITronics6 min readAI Agents · CrewAI · Multi-Agent Systems · Python
CrewAI | 30 Days of AI Agents, Day 10

Yesterday we covered LangChain, the general-purpose orchestration layer. Today we look at CrewAI, a framework built specifically for teams of agents. On Day 4 we argued that more agents only help when roles are clear and handoffs are designed. CrewAI is essentially that idea turned into an API: agents with roles, tasks with owners, and a process that runs them.

CrewAI — CodeITronics infographic

Save this sheet. The rest of this note walks through it section by section.

What CrewAI Is

CrewAI is a Python framework for building teams of AI agents that work together on complex tasks. Its main ideas:

  • multi-agent collaboration,
  • role-based agents,
  • task delegation,
  • process automation.

The pitch is to go from a single agent to an agent crew. The sticky note on the sheet says a team of agents is unstoppable. Our version is a little more measured: a well-designed team of agents can handle work that one overloaded agent handles badly.

The Architecture

User (goal / request)
   -> Crew (team of AI agents)
   -> Tasks (breakdown and assignment)
   -> Tools (APIs, search, calculators, databases)
   -> Process (execute, collaborate, solve)  <->  Memory (shared context)
   -> Output (final result to the user)

The core objects map directly to that diagram:

ObjectWhat it is
AgentA role with a goal, a backstory, an LLM, and optional tools
TaskA unit of work with a description, an expected output, and an assigned agent
CrewThe team: a set of agents and tasks plus a process
ProcessHow tasks run: sequential, or hierarchical with a manager
MemoryOptional shared context across agents and runs

Agent Roles in a Crew

RolePurpose
ManagerPlans, delegates, and manages the crew
ResearcherFinds and analyzes information
WriterCreates content and writes answers
AnalystAnalyzes data and generates insights
ReviewerReviews and improves the final output
ExecutorRuns tasks, tools, and automations

You will rarely need all six. Most useful crews have two to four roles. The reviewer is the one we would keep in almost every crew, for the reason from Day 4: a second agent checking against explicit criteria is the cheapest real accuracy gain.

How a Crew Runs

  1. Goal. The user defines what they want.
  2. Crew formation. Agents with the right roles are selected.
  3. Task decomposition. The goal is broken into smaller tasks.
  4. Task delegation. Each task is assigned to the right agent.
  5. Execute and collaborate. Agents work through tasks using tools and shared memory, passing outputs along.
  6. Final output. The best answer is delivered, with a feedback loop for improvement.

In a sequential process, tasks run in order and each task's output becomes context for the next. In a hierarchical process, a manager agent (backed by an LLM you configure) decides which agent handles what and reviews results. Start sequential. It is cheaper, more predictable, and easier to debug.

A Worked Example

Goal: create a blog post on "The Future of AI".

AgentResponsibility
ManagerPlans the outline and assigns tasks
ResearcherGathers the latest trends and sources
AnalystPulls out key data points and insights
WriterWrites the post
ReviewerReviews and improves the content
ExecutorPublishes or saves the final output

This is close to how we think about content pipelines in client work, with one difference: for anything that publishes publicly, the executor's "publish" step goes to a human approval queue first.

The Code

A minimal two-agent crew:

from crewai import Agent, Task, Crew, Process

researcher = Agent(
    role="Researcher",
    goal="Find current, well-sourced information about {topic}",
    backstory="A careful analyst who cites sources and flags uncertainty.",
)
writer = Agent(
    role="Writer",
    goal="Write a clear, accurate blog post about {topic}",
    backstory="A technical writer who explains without hype.",
)

research = Task(
    description="Research {topic}. List 5 key developments with a source URL for each.",
    expected_output="A bulleted list of 5 developments, each with a source URL.",
    agent=researcher,
)
write = Task(
    description="Using the research, write a 600-word blog post about {topic}.",
    expected_output="A 600-word post in Markdown with a title and sections.",
    agent=writer,
)

crew = Crew(agents=[researcher, writer], tasks=[research, write],
            process=Process.sequential)
result = crew.kickoff(inputs={"topic": "the future of AI"})
print(result)

A few notes. The {topic} placeholders are filled from kickoff inputs. expected_output is where you get most of your quality control, so make it specific and checkable. Each agent uses your configured default LLM unless you pass one with the llm argument, which lets you give cheaper models to simpler roles. Tools are attached per agent, and the researcher is the only one here that would need web search.

CrewAI vs a Single Agent

AspectSingle agentCrewAI crew
CapabilitiesOne perspectiveMultiple skills and perspectives
Task handlingStruggles with long, complex tasksSplits complex tasks across roles
AccuracyErrors go uncheckedA reviewer role can catch errors
ScalabilityHard to extend without bloating the promptAdd a role instead
Cost and latencyLowerHigher; every agent adds model calls
Best fitSimple tasksMulti-step work with distinct roles

The single-agent column is not the losing side. For simple tasks it is the right answer, and the crew is overhead.

Use Cases and Best Practices

Common use cases: content creation, research and reports, data analysis, customer support, software development, and business automation such as lead research and enrichment.

Best practices that hold up:

  • Give each agent a clear role and goal. Overlapping roles produce duplicated or conflicting work.
  • Break tasks into small, specific steps with concrete expected outputs.
  • Use shared memory deliberately, for context that genuinely needs to cross agents.
  • Choose the right tools for each agent, and only those.
  • Review outputs before anything leaves the system.
  • Monitor, test, and improve your crews with saved example inputs and expected results.

Key Takeaways

  • CrewAI models a team: agents with roles, tasks with expected outputs, and a process.
  • Start with a sequential process and two to four roles.
  • expected_output is your main quality lever; make it specific.
  • Keep a reviewer role in almost every crew.
  • A crew costs more than a single agent; use it when roles are genuinely distinct.

FAQs

Does CrewAI require LangChain?

No. CrewAI is its own framework. You can use LangChain tools with it, but it is not a dependency you need to learn first.

Sequential or hierarchical process?

Sequential for most crews. Use hierarchical when the order of work genuinely depends on intermediate results and you are willing to pay for a manager LLM.

How do I stop a crew from producing confident but wrong output?

Require sources in the research task, give the reviewer explicit criteria, and validate the final output in code before using it.

Up Next

Day 11 is AutoGen, Microsoft's framework for agents that collaborate through conversation, with built-in human-in-the-loop and code execution. We will compare it directly with LangChain and CrewAI. If you want a crew of agents designed around a real business process, let's talk.

Keep reading

LangChain | 30 Days of AI Agents, Day 9

Day 9 of 30 Days of AI Agents: what LangChain is, its core building blocks, a small chain and tool-calling example, and when plain code is clearer.

Building Your First AI Agent | 30 Days of AI Agents, Day 7

Day 7 of 30 Days of AI Agents: build a small working agent in Python with tool calling, web search, a safe calculator, memory, and a step limit.

Single-Agent vs Multi-Agent Systems | 30 Days of AI Agents, Day 4

Day 4 of 30 Days of AI Agents: single-agent vs multi-agent systems, when each fits, the real costs of coordination, and how to grow from one to many.

Subscribe to the edition

One useful systems note a week from real Salesforce and automation builds. Unsubscribe in one click.

Letters

Letters to the editor

No letters yet. Questions and counterpoints are welcome.