Course Content
CrewAI Multi-Agents
9 sections · 53 lessons
What is CrewAI and what problem does it solve in agentic AI systems?
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
| Piece | What it is | Everyday word |
|---|---|---|
Agent | an LLM with a role, goal, backstory and tools | a team member |
Task | one unit of work with a description and expected_output | a ticket |
Crew | the agents plus the tasks plus a run strategy | the team |
Process | sequential or hierarchical | how the team is managed |
Flow | event-driven Python code that calls crews, agents and plain functions | the 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.
1from crewai import Agent, Task, Crew, Process23researcher = Agent(role="Market Researcher",4 goal="Find evidence-backed facts about {topic}",5 backstory="You cite a source for every number.")6writer = Agent(role="Report Writer",7 goal="Turn research into a one-page brief",8 backstory="You write for busy founders.")910research = Task(description="Research {topic}.",11 expected_output="8 bullet findings, each with a URL",12 agent=researcher)13brief = Task(description="Write a brief from the research.",14 expected_output="A 300-word brief with 3 recommendations",15 agent=writer)1617crew = Crew(agents=[researcher, writer], tasks=[research, brief],18 process=Process.sequential)19result = crew.kickoff(inputs={"topic": "quick-commerce in Tier-2 cities"})20print(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:
- A researcher with only a search tool, told to return 10 facts with URLs.
- An analyst with no tools, who compares prices and flags changes from last week.
- 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
LLMclass, such as OpenAI, Anthropic, Gemini, Azure, Bedrock and local models via Ollama, selected with a string like"openai/gpt-4o-mini".