CrewAI Multi-Agents

Course Content

CrewAI Multi-Agents

9 sections · 53 lessons

What is CrewAI and what problem does it solve in agentic AI systems?


Where each CrewAI piece sitsFlow — state, @start, @listen, @routerCrew — agents, tasks and a processAgent loop — role, goal, backstory, LLMTools, memory and knowledge
Production systems usually let a Flow own the order and call a Crew only for the steps that need open-ended judgement.

What you need to know

The problem: one agent does not scale

A single agent works well for a narrow job. As you add responsibilities, three things go wrong:

  • Tool confusion. With 15 to 20 tools, the model more often picks the wrong one or passes bad arguments.
  • Instruction dilution. A three-page system prompt means the important rule on page two gets ignored.
  • No second opinion. The same model that wrote a claim is asked to check it, so it tends to agree with itself.

CrewAI's answer is decomposition: several small, focused agents instead of one large one, with the work described as explicit tasks.

The building blocks

PieceWhat it isEveryday word
Agentan LLM with a role, goal, backstory and toolsa team member
Taskone unit of work with a description and expected_outputa ticket
Crewthe agents plus the tasks plus a run strategythe team
Processsequential or hierarchicalhow the team is managed
Flowevent-driven Python code that calls crews, agents and plain functionsthe business process

Crews and Flows

A Crew is autonomous: you describe who and what, and agents decide how. A Flow is controlled: you write Python methods connected with @start, @listen and @router, holding a typed state. In real products the two are combined — a Flow owns the overall process and calls a Crew for the steps that need open-ended reasoning.

Python
from crewai import Agent, Task, Crew, Processresearcher = Agent(role="Market Researcher",                   goal="Find evidence-backed facts about {topic}",                   backstory="You cite a source for every number.")writer = Agent(role="Report Writer",               goal="Turn research into a one-page brief",               backstory="You write for busy founders.")research = Task(description="Research {topic}.",                expected_output="8 bullet findings, each with a URL",                agent=researcher)brief = Task(description="Write a brief from the research.",             expected_output="A 300-word brief with 3 recommendations",             agent=writer)crew = Crew(agents=[researcher, writer], tasks=[research, brief],            process=Process.sequential)result = crew.kickoff(inputs={"topic": "quick-commerce in Tier-2 cities"})print(result.raw)

The {topic} placeholders are filled from kickoff(inputs=...). Tasks run in list order and the writer automatically receives the researcher's output. Code in this course targets CrewAI 1.15 (installed with pip install crewai; community tools come from pip install 'crewai[tools]').

The honest trade-off

Every agent is a full LLM loop. Two agents usually cost about twice as much and take about twice as long as one. CrewAI pays off when the work really has distinct skills; it is overhead when it does not.

A real-life example

A D2C snack brand in Pune wants a weekly competitor brief. The first version was one agent with web search, a spreadsheet tool and a long prompt. It mixed up competitors, forgot to cite prices and wrote marketing fluff.

The team rebuilt it as a crew:

  1. A researcher with only a search tool, told to return 10 facts with URLs.
  2. An analyst with no tools, who compares prices and flags changes from last week.
  3. A writer who turns the analysis into a 1-page brief for the founders.

Each prompt shrank from about 1,800 words to about 150. Unsupported claims dropped because the researcher's expected_output demanded a URL per fact. The run went from one call of about 20 seconds to three tasks taking about 70 seconds — acceptable for a weekly report, and a trade-off worth saying out loud.

Follow-up questions to expect

  • "Is CrewAI built on LangChain?" — Not any more. Early versions depended on LangChain; current CrewAI is a standalone framework with its own agent loop and LLM layer.
  • "What is the difference between a Crew and a Flow?" — A Crew lets agents decide how to reach the goal; a Flow is code you write that decides the order, branching and state, and can call crews inside its steps.
  • "Which LLMs does it support?" — Many providers through its LLM class, such as OpenAI, Anthropic, Gemini, Azure, Bedrock and local models via Ollama, selected with a string like "openai/gpt-4o-mini".