Get AI summaries of any video or article — Sign up free
crewAI Crash Course For Beginners-How To Create Multi AI Agent For Complex Usecases thumbnail

crewAI Crash Course For Beginners-How To Create Multi AI Agent For Complex Usecases

Krish Naik·
5 min read

Based on Krish Naik's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

CrewAI multi-agent workflows work best when roles are separated into agents with clear goals and tasks, rather than one monolithic prompt.

Briefing

CrewAI’s practical edge for multi-agent workflows is letting separate agents coordinate—research first, then writing—while relying on tools (like a YouTube search/transcription utility) to fetch source material. In the walkthrough, that coordination is used to automate a tedious content pipeline: take a query, find the matching YouTube video from a specific channel, extract its transcript, summarize it, and generate a ready-to-publish blog post.

The core use case starts with a creator who has 1,900+ YouTube videos and wants a blog page for each one. Manually doing it would require multiple roles: a researcher to locate the right video and pull its transcript, and a content writer to validate and turn that information into a structured blog. CrewAI replaces that back-and-forth with an agent system where each agent has a defined role, each role performs a defined task, and each task can call tools. The workflow is described as sequential: the researcher completes its output, then the writer consumes that output to produce the final markdown blog.

Three building blocks anchor the setup: agents, tasks, and tools. Agents represent “people” with domain expertise—here, a blog researcher and a blog writer. Tasks specify what each agent must do, such as “get detailed information about the video from the channel” and “summarize the info and create the blog content.” Tools handle dependencies on external capabilities. In this example, a YouTube channel search tool is used to find relevant videos and retrieve the content needed for summarization. The researcher agent uses the YouTube tool to gather transcript-based information; the writer agent then turns that research into a blog post.

Implementation details follow a standard project structure: create a Python 3.10 virtual environment, install dependencies via a requirements.txt file (including crewAI and crewAI tools), and create separate files for agents.py, tools.py, task.py, and crew.py to orchestrate execution. Two agents are instantiated with parameters like role, goal, verbosity, memory, backstory, and delegation rules. The researcher agent is configured to extract relevant video content from the channel; the writer agent is configured to craft engaging, simplified narratives based on the research.

Two tasks are then defined. The research task uses the YouTube tool and outputs a “comprehensive three paragraph long report” based on the topic. The writing task uses the same tool context and generates the blog content, writing the result to a new blogpost.md file. Execution is kicked off in crew.py using Crew with process set to sequential, and inputs provided as a topic query (the example query is “what is AI versus ml versus data science”).

A key operational requirement appears when running the pipeline: an OpenAI API key is needed because agents rely on an LLM to summarize and generate text. The walkthrough notes that CrewAI can connect to multiple LLM providers (including local models and other APIs), but the demonstrated setup uses OpenAI via environment variables (OPENAI_API_KEY and an OpenAI model name). After setting the key and model, the system successfully searches the channel, extracts transcript content, and produces the blog markdown in about a minute.

Overall, the lesson is less about one-off automation and more about a reusable pattern: define specialized agents, bind them to tasks, attach the right tools for retrieval, and run them sequentially so the output of one stage becomes the input of the next—turning a multi-step publishing workflow into a single command.

Cornell Notes

CrewAI is used to automate a two-stage publishing workflow by coordinating multiple AI agents. One agent (the blog researcher) searches a specific YouTube channel for a topic, retrieves the relevant video content/transcript using a YouTube tool, and produces a short research report. A second agent (the blog writer) takes that research and generates a structured blog post in markdown, saved as blogpost.md. The pipeline runs sequentially: research completes first, then writing starts. Because text generation and summarization require an LLM, the setup needs an OpenAI API key (or another supported LLM provider) configured via environment variables.

Why does the workflow use multiple agents instead of a single prompt?

The pipeline splits responsibilities into roles that map to different tasks: a researcher focuses on retrieval and summarization of source material (YouTube transcript-based info), while a writer focuses on transforming that research into a coherent blog narrative. This separation reduces the need for manual validation steps and makes the output more controllable, because each agent has a defined goal and task.

What are the three core components in CrewAI, and how do they interact in this example?

Agents, tasks, and tools form the system. Agents represent role-based workers (blog researcher and blog writer). Tasks define what each agent must do (produce a three-paragraph report; then write the blog content). Tools provide external capabilities the tasks depend on—here, a YouTube channel search tool is used so the researcher can locate the right video and obtain transcript content for summarization.

How does sequential processing change the output compared with parallel execution?

With sequential processing, the researcher finishes its report first, and only then does the writer start generating the blog. That ordering matters because the writer’s output depends on the research content. The walkthrough explicitly sets async execution to avoid parallel behavior and uses process='sequential' in the Crew kickoff.

What does the system need to run successfully, beyond installing packages?

It needs an LLM connection. When the run fails, the error points to a missing OpenAI API key. CrewAI agents use an LLM to summarize and generate text, so environment variables like OPENAI_API_KEY (and the chosen OpenAI model name) must be set before execution.

What files and code structure are used to implement the pipeline?

The walkthrough organizes the project into agents.py (agent definitions), tools.py (tool initialization such as YouTube search), task.py (research task and writing task definitions), and crew.py (orchestration and kickoff). The final output is written to a markdown file named blogpost.md.

Review Questions

  1. What roles do the blog researcher and blog writer agents play, and which tasks correspond to each one?
  2. How do tools enable the agents to retrieve YouTube content, and where is that tool referenced in the code?
  3. Why is an OpenAI API key required for this workflow, and what happens if it’s missing?

Key Points

  1. 1

    CrewAI multi-agent workflows work best when roles are separated into agents with clear goals and tasks, rather than one monolithic prompt.

  2. 2

    Agents, tasks, and tools are the three required building blocks: agents perform work, tasks define outputs, and tools supply external capabilities like YouTube search/transcription.

  3. 3

    A sequential pipeline is ideal when later stages depend on earlier outputs—research must finish before writing begins.

  4. 4

    The example automation turns a topic query into a blog post by searching a specific YouTube channel, extracting transcript-based information, summarizing it, and generating markdown output (blogpost.md).

  5. 5

    Running CrewAI with text generation requires an LLM connection; missing OPENAI_API_KEY triggers an error and blocks execution.

  6. 6

    A practical project structure uses agents.py, tools.py, task.py, and crew.py, with crew.py handling process='sequential' and kickoff inputs.

Highlights

CrewAI’s sequential multi-agent pattern turns “find source → summarize → write blog” into one automated run.
The pipeline depends on tools for retrieval: a YouTube channel search tool supplies the content the researcher summarizes.
The OpenAI API key isn’t optional for this setup—agents need an LLM to generate the research report and the final blog.
The final deliverable is a markdown file (blogpost.md) produced after the researcher’s output feeds the writer’s task.

Topics

  • Multi-Agent Automation
  • CrewAI Agents
  • Sequential Processing
  • YouTube Content Summarization
  • OpenAI API Setup

Mentioned