A simple multi-agent system built with CrewAI that researches YouTube videos and automatically generates blog posts based on video content.
This project uses two AI agents working in sequence:
- Blog Researcher - Finds and analyzes YouTube videos on specified topics
- Blog Writer - Creates engaging blog content based on the research
- 🎥 Search and analyze YouTube channel content
- 🤖 Two specialized AI agents with distinct roles
- 📝 Automatic blog post generation in Markdown format
- 🔄 Sequential workflow with memory and caching
- ⚡ Built on CrewAI framework with GPT-4o-mini
-
Clone the repository
git clone https://github.com/Tusharbecoding/multi-youtube-agent cd multi-youtube-agent -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Configure environment Create a
.envfile in the root directory:OPENAI_API_KEY=your_openai_api_key_here -
Update YouTube channel Edit
tools.pyto specify the target YouTube channel:yt_tool = YoutubeChannelSearchTool(youtube_channel_handle="@yourchannel")
Run the multi-agent system:
python crew.pyThe system will:
- Research the specified video topic on the configured YouTube channel
- Generate a comprehensive blog post
- Save the output to
blog_post.md
multi-youtube-agent/
├── agents.py # AI agent definitions (researcher & writer)
├── tasks.py # Task definitions for each agent
├── tools.py # YouTube search tool configuration
├── crew.py # Main orchestration and execution
└── requirements.txt
- Change the topic: Modify the
topicparameter increw.py - Adjust agent behavior: Edit agent backstories and goals in
agents.py - Modify output format: Update task descriptions in
tasks.py - Switch YouTube channel: Update the channel handle in
tools.py
crewai- Multi-agent frameworkcrewai-tools- YouTube integration toolspython-dotenv- Environment variable managementopenai- GPT model access
The system generates a blog_post.md file containing a well-structured blog post based on the YouTube video research.