Skip to content

Multi-Agent SEO Blog Generator automates SEO-friendly blog creation by researching trending topics, generating structured content using AI, and optimizing it for search engines. It integrates Google News, Bing News (SerpAPI), and Gemini AI to produce high-quality blogs in multiple formats, including Markdown, TXT, HTML, and PDF.

License

Notifications You must be signed in to change notification settings

raghul-tech/Multi-Agent-SEO-Blog-Generator

Repository files navigation

Multi-Agent SEO Blog Generator

Overview

Multi-Agent SEO Blog Generator is an AI-powered tool that automates the process of researching, generating, and optimizing SEO-friendly blog content. It fetches trending topics, creates structured blog content, optimizes for search engines, and saves the output in multiple formats including Markdown, TXT, HTML, and PDF.


System Architecture

πŸ“‚ Multi-Agent-SEO-Blog-Generator
β”œβ”€β”€ πŸ“‚ blog
β”‚   β”œβ”€β”€ πŸ“‚ trending_hr-related_topic
β”‚       β”œβ”€β”€ πŸ“„ trending_hr-related_topic.html
β”‚       β”œβ”€β”€ πŸ“„ trending_hr-related_topic.md
β”‚       β”œβ”€β”€ πŸ“„ trending_hr-related_topic.pdf
β”‚       β”œβ”€β”€ πŸ“„ trending_hr-related_topic.txt
β”œβ”€β”€ πŸ“‚ img
β”‚   β”œβ”€β”€ πŸ“„ output.png 
β”œβ”€β”€ πŸ“„ main.py         # Entry point for the blog generation process
β”œβ”€β”€ πŸ“„ research.py     # Fetches trending news topics 
β”œβ”€β”€ πŸ“„ utils.py        # Utility functions for blog creation
β”œβ”€β”€ πŸ“„ generate.py     # AI-based text generation (uses Gemini API)
β”œβ”€β”€ πŸ“„ saveblogs.py    # Handles file saving operations (MD, TXT, HTML, PDF)
β”œβ”€β”€ πŸ“„ APIkeys.py      # Manages API keys securely (Gemini & SerpAPI)
β”œβ”€β”€ πŸ“„ README.md       # Documentation
β”œβ”€β”€ πŸ“„ requirements.txt # Dependencies

Screenshot

output


Agent Workflow

  1. User Input: Enter the blog topic.
  2. Research: Fetches relevant news from Google News and Bing News using SerpAPI.
  3. Outline Creation: Generates a structured outline based on research.
  4. Content Generation: Uses Gemini AI to generate a full-length blog post.
  5. SEO Optimization: Enhances content with SEO best practices and keyword insertion.
  6. Review: Checks for grammar, clarity, and coherence.
  7. Save & Export: Saves the blog in Markdown, TXT, HTML, and PDF formats.

Tools and Frameworks Used

  • Google Gemini API - AI-powered content generation
  • SerpAPI (Bing News) - Fetching trending news topics
  • Feedparser - Parsing Google News RSS feeds
  • FPDF - Generating PDF files
  • Markdown - Converting content to HTML
  • OS & Time Libraries - File handling and execution control

Installation and Execution

Prerequisites

Cloning the Repository

git clone https://github.com/raghul-tech/Multi-Agent-SEO-Blog-Generator
cd Multi-Agent-SEO-Blog-Generator
  • Python 3.7+
  • It is recommended to use a virtual environment:
    python -m venv venv
    source venv/bin/activate  # On macOS/Linux
    venv\Scripts\activate  # On Windows
  • Install dependencies:
    pip install -r requirements.txt

Setting Up API Keys

Google Gemini API Key

  1. Sign up at Google AI and create an account.
  2. Navigate to the Gemini AI section and click Get API Key at the top.
  3. Copy the key and add it to APIkeys.py:
    api_keys = {
        "GEMINI_API_KEY": "your-gemini-api-key-here",
        "SERPAPI_KEY": "your-serpapi-key-here"
    }

SerpAPI (Bing News API)

  1. Register at SerpAPI and create an account.
  2. Search for Bing News API to get your key .
  3. Copy the key and add it to APIkeys.py.

Running the Blog Generator

Execute the following command:

python main.py

Enter the blog topic when prompted, and the generated blog will be saved in the blogs/ directory.


Output Formats

The generated blog is saved in:

  • Markdown (.md)
  • Plain text (.txt)
  • HTML (.html)
  • PDF (.pdf)

License

This project is licensed under the MIT License.

About

Multi-Agent SEO Blog Generator automates SEO-friendly blog creation by researching trending topics, generating structured content using AI, and optimizing it for search engines. It integrates Google News, Bing News (SerpAPI), and Gemini AI to produce high-quality blogs in multiple formats, including Markdown, TXT, HTML, and PDF.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published