Skip to main content
This tutorial walks you through building a complete SEO content generation application powered by a 4-agent graph workflow. Give it a competitor URL, your own website, or a plain-text company description — the pipeline fetches the content, researches keywords, writes a long-form SEO article, and delivers a publish-ready, fully-optimized piece.
Premium Tier Required: Graph Workflow is available on Pro and Ultra plans. Upgrade your account to access this endpoint.

What You Will Build

A fully automated content engine that:
  • Accepts a URL (website, blog post, product page) or a plain-text company description
  • Fetches and extracts readable text from any URL using BeautifulSoup
  • Runs a 4-agent Graph Workflow where two specialist agents work in parallel, then converge into a writer and a final SEO optimizer
  • Returns a publish-ready article complete with meta title, meta description, heading hierarchy, keyword density notes, schema markup recommendations, and internal-linking suggestions

Architecture

Agent Roles

Graph Flow

Both ContentAnalyst and KeywordStrategist run in parallel the moment the workflow starts. Once both finish, SEOWriter receives all their outputs and drafts the article. Finally SEOPublisher performs a full SEO polish and delivers the ready-to-publish result.

Prerequisites

1. Get Your API Key

  1. Visit https://swarms.world/platform/api-keys
  2. Sign in or create an account
  3. Ensure you have a Pro or Ultra plan
  4. Generate a new API key and export it:

2. Install Dependencies


Full Application Code

seo_pipeline.py


Running the Application

Option A — Analyze a Website URL

Option B — Analyze a Specific Page

Option C — Use a Company Description

Option D — Save to a Custom File


How the Graph Executes


Using the API Directly (No URL Fetching)


Customization Guide

Scaling to Multiple Articles

Adjusting Article Tone

Adding a Competitor Analysis Agent


Troubleshooting