This project leverages the CrewAI framework to create a blog post from YouTube video content. It uses AI agents to research video transcriptions on a specified topic from a YouTube channel and generate a summarized blog post. The application focuses on topics like AI, Machine Learning, Deep Learning, and Data Science, using the @krishnaik06 YouTube channel as the primary source.
- Purpose: Automate blog content creation by extracting and summarizing information from YouTube videos.
- Framework: CrewAI, utilizing AI agents for research and writing tasks.
- Key Features:
- Research agent fetches video transcriptions for a given topic.
- Writing agent creates a blog post based on the research.
- Output is saved as a markdown file (
new-blog-post.md).
- GitHub Repository: CrewAI_YtVideo_to_Blog
- AI content generation
- YouTube video transcription
- CrewAI framework
- Blog automation
- Data Science and Machine Learning
- Language: Python
- Framework: CrewAI
- Libraries: crewai, crewai_tools, python-dotenv
- APIs: OpenAI (GPT-4), YouTube Channel Search Tool
- Tools: GitHub
CrewAI_YtVideo_to_Blog/
├── .gitignore # Ignored files for Git
├── LICENSE # Project license
├── README.md # Project documentation
├── agents.py # Defines AI agents for research and writing
├── crew.py # Configures CrewAI and task execution
├── requirements.txt # Python dependencies
├── tasks.py # Defines research and writing tasks
├── tools.py # Configures YouTube search tool
- Python 3.8+
- OpenAI API key (set in
.envfile) - GitHub repository cloned: CrewAI_YtVideo_to_Blog
- YouTube channel handle (
@krishnaik06) for video content
-
Clone the Repository:
git clone https://github.com/Monish-Nallagondalla/CrewAI_YtVideo_to_Blog.git cd CrewAI_YtVideo_to_Blog -
Install Dependencies:
pip install -r requirements.txt
-
Set Up Environment Variables:
- Create a
.envfile in the project root. - Add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key
- Create a
-
Configure Agents and Tasks:
agents.py: Defines a research agent to fetch YouTube video transcriptions and a writing agent to create blog content.tasks.py: Specifies tasks for researching video content and writing a summarized blog post.tools.py: Configures the YouTube search tool for the@krishnaik06channel.crew.py: Sets up the CrewAI framework with sequential task execution.
-
Run the Application:
python crew.py
- The script processes the topic
AI VS ML VS DL vs Data Scienceby default. - Output is saved as
new-blog-post.mdin the project directory.
- The script processes the topic
-
Customize Topic:
- Modify the topic in
crew.pyby updating theinputsdictionary:result = crew.kickoff(inputs={'topic': 'Your_New_Topic'})
- Modify the topic in
- agents.py:
blog_researcher: Fetches video transcriptions for the specified topic using the YouTube search tool.blog_writer: Generates a blog post summarizing the video content.
- tasks.py:
research_task: Produces a 3-paragraph report based on video content.write_task: Creates a summarized blog post saved asnew-blog-post.md.
- tools.py:
- Configures
YoutubeChannelSearchToolfor the@krishnaik06channel.
- Configures
- crew.py:
- Orchestrates agents and tasks using CrewAI's sequential process.
- Configures memory, caching, and a maximum RPM of 100.
- The generated blog post is saved as
new-blog-post.mdin the project directory. - The research task produces a 3-paragraph report, and the writing task summarizes it into a blog post.
Listed in requirements.txt:
crewaicrewai_toolspython-dotenv
- Ensure a valid OpenAI API key is set in the
.envfile. - The YouTube search tool requires internet access to fetch video transcriptions.
- The application is configured for the
@krishnaik06YouTube channel; modifytools.pyto use a different channel. - The OpenAI model used is
gpt-4-0125-preview; updateagents.pyif a different model is preferred.
- Fork the repository.
- Create a feature branch (
git checkout -b feature-branch). - Commit changes (
git commit -m "Add feature"). - Push to the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
For questions or issues, open a GitHub issue or contact the repository owner at Monish-Nallagondalla.