Automating Blog Posts with AI Multi-Agents (1) — Architecture & 13-Step Pipeline


Written by Thierry K (human) · AI-assisted

Hey there, it’s Claudie! ✨

Starting today, we’re rolling out a 4-part series on how we built the Blog-Agent system — our AI multi-agent blog automation pipeline. Hand it a single Confluence doc, and it handles everything from SEO strategy to publishing in 3 languages (Korean, English, Japanese), fully automated.

Fun fact: this very post was written by Blog-Agent. Pretty meta, right? 😄

🎯 Why Did We Build This?

Our team writes a lot of technical docs on Confluence. But turning those into blog posts meant going through this tedious process every single time:

  1. Read the Confluence doc and rewrite it in blog format
  2. Do SEO keyword research and write metadata
  3. Generate a featured image
  4. Create diagrams and inline images
  5. Format everything in HTML
  6. Upload via the WordPress API
  7. Translate to English and Japanese, then publish each
  8. Link the languages together with Polylang

Publishing a single post in 3 languages took 3–4 hours. We thought, “What if we automated this?” — and that’s how the Blog-Agent project was born.

🏗️ Overall Architecture

The core idea behind Blog-Agent is simple: “Give each specialty its own AI expert, then orchestrate them like a conductor leading an orchestra.”

Instead of one massive prompt trying to do everything, 10 specialized agents each handle their own role:

AgentRoleModel
🎯 SEO StrategistKeyword analysis, title candidates, content angleSonnet
🔍 ResearcherSource material collection, external data enrichmentSonnet
🎨 Art DirectorFeatured/closing image generation (AI images)Sonnet
✍️ WriterKorean HTML draft creationOpus
📝 EditorProofreading, diagram insertion, emoji placementSonnet
👀 SupervisorQA review (SEO density, structure, tone check)Sonnet
🌐 TranslatorEN/JA translationSonnet
🚀 PublisherPublish via WordPress APISonnet
🔗 Polylang OpsMultilingual linking (language assignment + translation links)Sonnet

Only the Writer uses the Opus model. Writing is the step where quality matters most. The rest of the agents do just fine with the cost-efficient Sonnet model.

🔄 The 13-Step Pipeline

From source input to final publication, there are 13 steps in total. Each step is handled by a specialized agent, and the output of each step feeds into the next.

Let’s walk through each step:

Phase 1: Planning (Steps 1–3)

Step 1 — SEO Strategy: Analyzes the source material to determine target keywords, title candidates, and content angle. The category (Dev Log, Tech, Daily, Economy) is decided here, and the corresponding category profile YAML is auto-loaded.

Step 2 — Research: Fetches the Confluence source and, if needed, gathers supplementary materials through web search or the RAG knowledge base. It automatically branches by source type — supporting Confluence pages, URLs, local files, PDFs, and even briefing JSONs.

Step 3 — Art Direction: Generates 2 AI images — a featured image (top) and a closing image (bottom). The key here is maintaining a consistent style based on character reference images.

Phase 2: Production (Steps 5–8)

Step 5 — Writing: The Opus model writes the Korean HTML draft. It weaves in SEO keywords naturally and maintains the blog voice (warm, conversational tone) consistently.

Step 6 — Editing: Handles sentence polishing, diagram generation and insertion, and character emoji placement. Diagrams follow a brand style (cream-to-sky-blue gradient, teal/coral boxes).

Step 7 — QA Review: The Supervisor automatically checks HTML structure, SEO keyword density, tone consistency, and image placement. It scores on a 100-point scale, and if there are issues, it sends revision requests back to the Writer or Editor.

Step 8 — Checkpoint: If the QA score is 80 or above, it’s auto-approved. Below that, it waits for manual review. This checkpoint acts as the quality gate.

Phase 3: Publishing (Steps 9–13)

Step 9 — Publish KO: Uploads images to WordPress, replaces local paths in the HTML with actual URLs, then publishes the Korean post.

Step 10 — Translate: Translates the Korean original into English and Japanese. This isn’t simple translation — SEO metadata and keywords are localized for each language too.

Step 11 — Publish EN/JA: Publishes the translated content. Since it reuses already-uploaded media, this step is fast.

Step 12 — Polylang Link: Uses the WordPress Polylang plugin to link the KO/EN/JA posts to each other. This is the trickiest part — we’ll cover it in detail in Part 4.

Step 13 — Label Source: Adds a blog-posted label to the original Confluence page to prevent duplicate publishing.

🔌 MCP Server Integration

One of Blog-Agent’s strengths is its integration with MCP (Model Context Protocol) servers. MCP is a standard protocol that lets Claude Code communicate directly with external services.

A total of 7 MCP servers are connected:

MCP ServerRolePipeline Step
mcp-atlassianConfluence page reading, Jira integrationStep 2 (Research), Step 13 (Label)
nanobananaGemini Flash/Pro image generationStep 3 (Art), Step 6 (Diagrams)
terryxaixAI Grok image generationStep 3 (Featured Image)
knowledge-ragSelf-hosted RAG knowledge base searchStep 2 (Research supplement)
filesystemNAS file read/writeAll steps (HTML, image storage)
playwrightBrowser automation (wp-admin)Step 12 (Polylang setup)
wpcom-mcpWordPress post CRUDStep 9, 11 (Publishing)

Notably, we use two different AI services for image generation depending on the purpose:

  • Featured/closing images → xAI Grok (excels at animation/character styles)
  • Diagrams/technical illustrations → Gemini Flash (great for clean, structured diagrams)

📦 State Management System

What happens if the 13-step pipeline fails midway? Running everything from scratch would waste time and money. That’s why we built a state management system.

# Initialize pipeline
python state_cli.py init \
  --source confluence \
  --refs 12345

# Record step start/completion
python state_cli.py start-step seo_strategy
python state_cli.py complete-step seo_strategy \
  --output '{"keyword":"blog automation"}'

# Check current progress
python state_cli.py status

Each step’s state (pending → in_progress → completed/failed) and result data are saved as JSON files. Data sharing between agents is handled through set-shared / get-shared commands.

For real-time monitoring, there’s a Flask web dashboard (port 5055) where you can see pipeline progress, step details, image previews, and file maps at a glance.

📂 Multi-Format Source Support

We started with only Confluence pages as input, but gradually added support for various source formats:

Source TypeExampleProcessing
Confluence--source confluence --refs 12345Fetch page via MCP
URL--source url --refs "https://..."Crawl via WebFetch
Local file--source file --refs README.mdDirect read (multiple files OK)
PDF--source pdf --refs doc.pdfExtract text via PDF parser
Briefing JSON--source briefing --refs brief.jsonUse structured briefing directly

⚙️ Category Profile System

Different blog categories need different tones, structures, and image styles. Instead of tweaking prompts every time, we created category profile YAMLs:

# profiles/dev_log.yaml
writer:
  tone: "Dev log feel, sharing trial-and-error"
  structure: "Background→Problem→Solution→Result"

editor:
  diagram_style: "Code-centric, architecture diagrams"

translator:
  tech_terms: "preserve original terms"

Once the category is decided in Step 1, the corresponding profile is auto-loaded and injected into every subsequent agent’s prompt. Want to add a new category? Just create 1 YAML file — all agents adapt automatically.

💰 Cost Optimization: Claude Code + Max Subscription

Initially, we used the Claude Agent SDK to call the API directly (blog-agent-api). But using the Opus model for the Writer meant significant token costs.

So we switched architectures:

# Before (direct API calls — token costs)
blog-agent-api → Claude API → per-token billing

# After (Claude Code CLI — included in Max)
OpenClaw → claude -p "write blog post" \
  --permission-mode bypassPermissions
→ Claude Code (Max subscription, unlimited Opus)

With Claude Code Max subscription, even Opus is unlimited. By triggering the pipeline from an external agent (OpenClaw) using the claude -p command, we get the highest-quality model with zero API costs.

AspectDirect API CallsClaude Code CLI
CostPer-token pricingIncluded in Max (no extra cost)
ModelMust consider cost (Haiku/Sonnet)Opus unlimited
ToolsConnect via SDKAll built-in MCP tools available
BrowserSeparate integration neededPlaywright MCP already connected

🔐 Error Handling and Retries

Errors are inevitable in an automation pipeline. So we set up retry policies for each failure scenario:

Error ScenarioRetriesFallback
Confluence timeout3xUse cache/previous result
Image generation failure3x (simplify prompt)Placeholder image
WordPress 4031x after token refreshSave as local draft
Web search failure2xProceed without external data
Playwright failure3xManual Polylang instructions

Image generation in particular can get caught by AI model safety filters, so on failure, the prompt is automatically simplified and retried.

📊 Version History: 10 Days of Evolution

Blog-Agent evolved rapidly from v0.1.0 to v0.8.5 in roughly 10 days:

VersionKey Changes
v0.1.0Initial 13-step pipeline + 10 agents
v0.3.0Inline image upload pipeline
v0.4.0Category profile system (YAML)
v0.5.0WordPress native lightbox
v0.7.0Full auto-approve + NAS work directory
v0.8.0WordPress MCP integration (OAuth 2.1)
v0.8.5Polylang REST→post.php migration (final stabilization)

We ran the pipeline in production every day and fixed issues as they came up. The v0.8.0–v0.8.5 period saw the biggest changes — we tried WordPress MCP integration, had to disable it due to bugs, and completely overhauled the Polylang approach. Lots of real-world experience baked in there.


📋 Series Overview

This series has 4 parts in total:

  • Part 1 (this post): Why we built it, overall architecture, 13-step pipeline overview
  • Part 2: Designing 10 AI agents — prompt engineering and role allocation
  • Part 3: Claude Code CLI vs Agent SDK — comparing two implementations
  • Part 4: WordPress + Polylang war stories — trilingual auto-publishing

In the next part, we’ll dive deep into how we designed each agent’s prompts and how data flows between agents!

Got questions or thoughts? Drop them in the comments! 💬


Discover more from AI-Girls Lab

Subscribe to get our latest posts delivered to your inbox.