An Intelligent Multi-Agent AI Workflow for Professional Content Creation
Transform a content brief into publication-ready articles through an advanced 3-agent pipeline powered by AI, featuring intelligent quality scoring, adaptive learning, and parallel processing.
A sophisticated content creation system that uses three specialized AI agents working in sequence:
- WRITER - Generates structured outlines and initial drafts
- LLMON - Creates 3 distinct stylistic variations (in parallel)
- EDITOR - Applies multi-pass professional polish
- π§ Learns from your feedback - Memory system adapts to your preferences
- π Objective quality metrics - Multi-dimensional scoring (readability, SEO, engagement)
- β‘ 3x faster - Parallel variation generation
- π― Intelligent validation - Ensures variations are truly different and citations are properly linked
- π Iterative refinement - Approve, revise, or reject at each stage
- π¨ Flexible providers - OpenAI (GPT-4o/GPT-4.1) or Google Gemini
- π Dual content modes - General articles OR specialized tool reviews
- π Citation validation - Automatic detection of missing hyperlinks and URL verification
# Clone or download this repository
cd ai-content-studio
# Install Python packages
pip install -r requirements.txtOption A: OpenAI (Recommended)
# Run interactive setup
python setup_env.py
# Or manually create .env file:
AI_PROVIDER=openai
OPENAI_API_KEY=sk-proj-your-key-here
OPENAI_WRITER_MODEL=gpt-5-nano
OPENAI_LLMON_MODEL=gpt-4o-mini
OPENAI_EDITOR_MODEL=gpt-4.1-miniOption B: Google Gemini (Free Tier)
AI_PROVIDER=gemini
GEMINI_API_KEY=your-gemini-key-hereGet API Keys:
Edit templates/manual.md:
# Article Topic
How AI is transforming content creation in 2025
# Target Audience
Marketing professionals and content creators
# Key Points
- AI-powered workflows save 10+ hours per week
- Multi-agent systems produce higher quality
- [Add your key points...]python main.pyThat's it! The system will guide you through each stage with interactive prompts.
1. Outline Generation Phase - Plan before writing
- Generate and approve article structure before full draft
- Iterate on outlines faster than full revisions
- Better validation of approach early in process
Example:
β OUTLINE GENERATION PHASE
β Generating article outline...
ARTICLE OUTLINE
# Introduction
- Hook: Latest AI statistics
- Thesis: Multi-agent workflows transform content
## Section 1: Current Challenges
- Time constraints in content creation
- Maintaining quality at scale
[Approve/Revise/Reject]
2. Parallel Variation Generation - 3x faster processing
- All 3 LLMON variations generate simultaneously
- 90-180 seconds β 30-60 seconds
- No quality compromise
3. Quality Scoring System - Objective metrics for every output
Five-dimensional analysis:
- π Readability (82/100) - Flesch-Kincaid, grade level, complexity
- π SEO (78/100) - Word count, headings, keyword density
- π‘ Engagement (88/100) - Questions, examples, action verbs
- π Structure (90/100) - Template matching, completeness
- β Factual (85/100) - Citation tracking, reference alignment
Overall Score: 85/100
4. Workflow Memory - System learns your preferences
- Tracks all feedback across sessions
- Extracts patterns from approvals/rejections
- Provides historical context to agents
- Reduces iterations over time
5. Variation Validation - Ensures true diversity
- Automatic differentiation checking (TF-IDF cosine similarity)
- Enforces 30% minimum difference threshold
- Auto-regeneration if variations too similar
- Up to 2 retry attempts
Example Report:
VARIATION DIFFERENTIATION REPORT
Minimum Difference: 45.2%
Average Difference: 52.8%
β All variations are sufficiently different!
6. Multi-Pass Editing - Professional polish
Four focused editing passes:
- Grammar & Mechanics - Technical correctness (temp: 0.4)
- Style & Voice - Tone consistency (temp: 0.5)
- Flow & Transitions - Readability (temp: 0.5)
- Final Consistency - Validation (temp: 0.4)
Higher quality than single-pass editing.
- OpenAI GPT-4o - Premium quality (~$0.43/article)
- OpenAI GPT-4.1 - Next-generation models
- Google Gemini - Free tier option
- Per-agent model configuration - Mix and match models for cost optimization
- β Interactive approval gates at each stage
- β Dynamic rule editing for LLMON variations
- β Session management - All drafts saved with timestamps
- β Comprehensive test suite (23 tests, 100% passing)
- β Rich documentation with guides and examples
AI-Content-Studio/
βββ π ENTRY POINTS
β βββ main.py # Main application
β βββ run.bat / run.sh # Quick launch scripts
β βββ setup_env.py # Interactive API setup
β
βββ βοΈ CORE SYSTEM
β βββ workflow.py # Orchestrator (3-agent pipeline)
β βββ config.py # Configuration & feature flags
β βββ api_client.py # Multi-provider API client
β βββ utils.py # Helper functions
β
βββ π€ AI AGENTS
β βββ agents/
β βββ writer_agent.py # Stage 1: Draft + Outline
β βββ llmon_agent.py # Stage 2: Parallel variations
β βββ editor_agent.py # Stage 3: Multi-pass polish
β
βββ π§ INTELLIGENCE MODULES
β βββ quality_analyzer.py # Multi-dimensional scoring
β βββ workflow_memory.py # Cross-stage learning
β βββ variation_differentiator.py # Variation validation
β βββ citation_validator.py # Citation & hyperlink validation
β
βββ π USER INPUTS (YOU EDIT THESE)
β βββ templates/
β β βββ manual.md # β οΈ Your content brief (REQUIRED)
β β βββ template.md # Article structure
β β βββ references.md # Research & data
β β βββ writer_prompt.md # Writing instructions
β β βββ tool_review_brief.md # Tool review input template
β β βββ tool_review_structure.md # Review section structure
β β βββ tool_review_writer_prompt.md # Review writer instructions
β βββ rules/
β βββ llmon_rules.md # Variation styles (general)
β βββ editor_rules.md # Polish guidelines (general)
β βββ llmon_tool_review_rules.md # Tool review variations
β βββ editor_tool_review_rules.md # Tool review polish
β
βββ π DOCUMENTATION
β βββ docs/
β βββ INDEX.md # Complete file navigation
β βββ guides/
β β βββ QUICK_START.md # 5-minute setup guide
β β βββ WORKFLOW_DIAGRAM.md # Visual workflow
β β βββ ENHANCEMENTS_GUIDE.md # Feature deep-dive
β β βββ TOOL_REVIEW_MODE.md # Tool review mode guide
β βββ setup/
β β βββ SETUP.md # Detailed instructions
β β βββ OPENAI_SETUP_INSTRUCTIONS.md
β βββ project/
β βββ PROJECT_SUMMARY.md # System overview
β βββ CHANGELOG.md # Version history
β βββ AGENT_ANALYSIS.md # Technical analysis
β
βββ π‘ EXAMPLES
β βββ examples/
β βββ example_manual.md # Sample content brief
β βββ example_references.md # Sample references
β βββ example_tool_review_brief.md # Sample tool review
β βββ example_tool_review_output.md # Sample review output
β βββ template_manual.md # Template for general articles
β βββ template_references.md # Template for references
β βββ template_tool_review_brief.md # Template for reviews
β
βββ π OUTPUTS (AUTO-GENERATED)
β βββ outputs/
β βββ [timestamp]/
β βββ 01_writer_outline.md
β βββ 01_writer_draft.md
β βββ 02_llmon_variation1.md (+ quality scores)
β βββ 02_llmon_variation2.md
β βββ 02_llmon_variation3.md
β βββ 03_editor_polished.md
β βββ FINAL_ARTICLE.md # β¨ Final output
β
βββ π§ͺ TESTING
β βββ test_setup.py # Setup verification
β βββ test_enhancements.py # Feature tests (23 tests)
β βββ test_citation_validator.py # Citation validation tests
β
βββ πΎ MEMORY (AUTO-CREATED)
β βββ memory/ # Persistent learning data
β
βββ π CONFIG
βββ .env # API keys (YOU CREATE THIS)
βββ requirements.txt # Dependencies
βββ README.md # This file
What Happens:
- Outline Phase - Creates structured outline from your brief
- Review - You approve, revise, or reject the outline
- Full Draft - Generates complete article from approved outline
- Quality Score - Provides multi-dimensional quality metrics
Your Inputs:
templates/manual.md- Content brief (required)templates/template.md- Article structuretemplates/references.md- Research materialstemplates/writer_prompt.md- Writing instructions
Approval Options:
- β Approve β Continue to LLMON
- β Revise with feedback β Regenerate with your input
- β Reject β Stop workflow
What Happens:
- Parallel Generation - Creates 3 distinct variations simultaneously
- Differentiation Check - Validates variations are >30% different
- Quality Scoring - Analyzes each variation
- Comparison - Presents all 3 with differentiation report
Your Inputs:
rules/llmon_rules.md- Stylistic transformation rules- Previous stage approved article
Approval Options:
- Select Variation 1/2/3 β Continue to EDITOR
- β» Iterate with edited rules β Modify rules, regenerate
- β Reject all β Stop workflow
What Happens:
- Pass 1: Grammar - Technical correctness
- Pass 2: Style - Tone and voice consistency
- Pass 3: Flow - Readability and transitions
- Pass 4: Consistency - Final validation
- Quality Score - Final quality assessment
Your Inputs:
rules/editor_rules.md- Polish guidelines- Selected variation from Stage 2
Approval Options:
- β Approve as final β Complete! Save to FINAL_ARTICLE.md
- β Request revisions β Provide specific feedback
- β Reject β Stop workflow
Every output receives a comprehensive quality analysis:
QUALITY ANALYSIS REPORT
βββββββββββββββββββββββββββββββββββββββββ
Overall Score: 85/100
π Readability: 82/100
β’ Grade Level: 10 (General Adult)
β’ Reading Ease: 65.2 (Standard)
β’ Avg Sentence Length: 18.3 words
β’ Complex Word %: 12.4%
π SEO: 78/100
β’ Word Count: 1,847 β
β’ Headings: 8 β
β’ Keyword Density: 2.1% β
β’ URL-friendly: Yes
π‘ Engagement: 88/100
β’ Questions: 5
β’ Examples: 7
β’ Action Verbs: High
β’ Emotional Words: Moderate
π Structure: 90/100
β’ Template Match: 95%
β’ Section Completeness: 100%
β’ Logical Flow: Excellent
β Factual Consistency: 85/100
β’ Reference Alignment: High
β’ Citation Count: 6
β’ Keyword Overlap: 78%
All enhancements enabled by default:
# Enhancement Feature Flags
ENABLE_OUTLINE_PHASE = True # Outline generation
ENABLE_PARALLEL_VARIATIONS = True # 3x speed boost
ENABLE_QUALITY_SCORING = True # Objective metrics
ENABLE_WORKFLOW_MEMORY = True # Learning system
ENABLE_VARIATION_VALIDATION = True # Differentiation check
ENABLE_MULTIPASS_EDITING = True # 4-pass polishOpenAI (Per-Agent Models):
AI_PROVIDER=openai
OPENAI_API_KEY=sk-proj-...
# Different models for different agents
OPENAI_WRITER_MODEL=gpt-5-nano # Fast drafting
OPENAI_LLMON_MODEL=gpt-4o-mini # Creative variations
OPENAI_EDITOR_MODEL=gpt-4.1-mini # Premium polishGoogle Gemini (Simple):
AI_PROVIDER=gemini
GEMINI_API_KEY=your-key-hereWRITER_TEMPERATURE = 0.7 # Balanced creativity
LLMON_TEMPERATURE = 0.8 # Higher for variation diversity
EDITOR_TEMPERATURE = 0.5 # Lower for consistency- Write Detailed Briefs - More detail in
manual.md= better output - Use References Liberally - Add data, examples, research to
references.md - Customize Templates - Adjust
template.mdfor your specific format - Leverage Memory - System improves over multiple sessions
- Monitor Quality Scores - Use metrics to identify weak areas
- Iterate Strategically - Use outline revisions for structure, feedback for content
- Blog Posts - Optimized for engagement and SEO
- Technical Articles - Structured with clarity and accuracy
- Marketing Content - Persuasive with strong calls-to-action
- Educational Guides - Clear explanations with examples
- Product Descriptions - Benefit-focused with features
- Industry Analyses - Data-driven with insights
- Parallel processing saves ~90 seconds per LLMON iteration
- Outline approval reduces wasted time on wrong structure
- Quality scores help identify issues before final polish
- Memory system reduces iterations after 2-3 sessions
NEW: Generate professional, story-driven software/tool reviews optimized for both humans and LLMs.
Tool Review Mode creates personable, evidence-backed reviews with a specialized workflow:
| Feature | General Article | Tool Review |
|---|---|---|
| Voice | Professional, flexible | First-person, story-driven |
| Evidence | Optional citations | Required 6-10 user quotes |
| Structure | Flexible template | Fixed review sections |
| Format | Standard | Strict (no em dashes, clean headers) |
| Pricing | Not required | Detailed breakdown required |
1. Set Mode:
CONTENT_MODE=tool_review2. Fill Out Brief:
Use templates/tool_review_brief.md:
- Answer 4 pre-writing questions (title, audience, motivation, benefit)
- Collect 6-10 quotes from G2, Capterra, Reddit, etc.
- Document pricing, migration paths, implementation steps
- Gather review hub ratings (G2, Capterra)
3. Run Workflow:
python main.pyβ
Story-driven narrative with first-person voice
β
6-10 integrated user quotes (from G2, Reddit, Capterra, etc.)
β
Conditional framing: "If you're X... if you're Y..."
β
Detailed pricing breakdown with scaling info
β
Honest pros, cons, and fit analysis
β
Migration paths (switching to/from tool)
β
Implementation steps (realistic setup)
β
Sources appendix with all quote URLs
See examples/example_tool_review_output.md for a complete Surfer SEO review demonstrating all required elements.
π Complete Tool Review Mode Guide - Detailed walkthrough, best practices, troubleshooting
LLMON Variations:
Edit rules/llmon_rules.md:
# Variation 1: Professional
- Formal tone, executive audience
- Data-driven, authoritative
# Variation 2: Conversational
- Casual, friendly, relatable
- Story-driven, examples
# Variation 3: Technical
- Detailed, precise, expert-level
- Code examples, specificationsEditor Standards:
Edit rules/editor_rules.md to adjust polish criteria.
Edit templates/template.md:
# [Your Custom Structure]
## Introduction (100-150 words)
- Hook
- Context
- Thesis
## Main Sections (3-5 sections, 300-500 words each)
[Your requirements...]
## Conclusion (100-150 words)
- Summary
- Call-to-action# In quality_analyzer.py
MIN_VARIATION_DIFFERENCE = 0.3 # 30% minimum (0-1 scale)| Metric | Estimate |
|---|---|
| Input tokens per article | ~50,000 |
| Output tokens per article | ~30,000 |
| Input cost | $0.125 ($2.50/1M) |
| Output cost | $0.300 ($10.00/1M) |
| Total per article | ~$0.43 |
| Articles from $10 | ~23 articles |
- Cost: $0.00
- Limit: 15 requests/minute
- Best for: Testing, low-volume use
π‘ Tip: Use cheaper models (gpt-5-nano) for Writer/LLMON, premium (gpt-4.1) for Editor only!
This README provides a comprehensive overview. For deeper details:
- π Complete File Index - Navigate all project files
- π Quick Start Guide - 5-minute setup
- π§ Setup Instructions - Detailed configuration
- π Workflow Diagrams - Visual guides
- β¨ Enhancements Guide - Feature deep-dive
- π Tool Review Mode Guide - Complete tool review workflow NEW
- π Changelog - Version history (v1.0 β v3.0)
- ποΈ Project Summary - Technical overview
- π€ Agent Analysis - Agent architecture
python test_setup.pyChecks:
- β Python version (3.8+)
- β All dependencies installed
- β API keys configured
- β Template files exist
- β Directory structure
python test_enhancements.pyResults:
- β 23 tests total
- β 23 passing
- β 0 failing
- π Execution: ~1 second
"API key not found"
Solution:
- Check
.envfile exists in root directory - Verify variable name:
OPENAI_API_KEYorGEMINI_API_KEY - No quotes needed around key value
- Run
python setup_env.pyfor interactive setup
"Missing model configuration"
Solution (OpenAI):
OPENAI_WRITER_MODEL=gpt-5-nano
OPENAI_LLMON_MODEL=gpt-4o-mini
OPENAI_EDITOR_MODEL=gpt-4.1-miniAll three required for OpenAI provider.
"File not found" errors
Solution:
- Check
templates/manual.mdexists and has content - Verify working directory:
cd ai-content-studio - Copy from examples:
cp examples/example_manual.md templates/manual.md
Poor output quality
Solutions:
- β
Add more detail to
templates/manual.md - β
Include data in
templates/references.md - β Check quality scores for weak areas
- β Provide specific feedback in revision loops
- β
Customize
template.mdfor your needs
API rate limits
Solutions:
- Gemini free tier: 15 requests/minute
- OpenAI: Check limits at https://platform.openai.com/settings/organization/limits
- Wait briefly between runs or upgrade tier
- Token usage tracking - Real-time cost monitoring
- Draft comparison tool - Side-by-side version comparison
- Template validation - Automatic structure checking
- AI-powered rule suggestions - Smart rule generation
- Batch processing mode - Multiple articles in sequence
- A/B testing support - Variation performance tracking
- SEO optimization agent - Dedicated 4th agent
- Export formats - PDF, DOCX, HTML output
- Web UI - Browser-based interface
- Claude/Anthropic support - Additional AI provider
License: MIT - Free to use and modify for your content creation needs.
Credits:
- Built with Python, OpenAI GPT-4o/4.1, Google Gemini
- Quality analysis: TextStat, scikit-learn
- CLI: Colorama
- Read the docs: Start with docs/INDEX.md
- Check examples: See
examples/directory - Run tests:
python test_setup.pyto verify setup - Review changelog: docs/project/CHANGELOG.md
- OpenAI API Keys: https://platform.openai.com/api-keys
- OpenAI Pricing: https://openai.com/api/pricing/
- Gemini API Keys: https://makersuite.google.com/app/apikey
- Python Downloads: https://www.python.org/downloads/
# 1. Install dependencies
pip install -r requirements.txt
# 2. Set up API access
python setup_env.py
# 3. Edit your content brief
# Open templates/manual.md and add your topic
# 4. Run the workflow
python main.py
# π Watch the magic happen!Built with β€οΈ for efficient, intelligent, scalable content creation
AI-Content-Studio v3.0 - October 2025