Skip to main content

AI-powered blog generation from your terminal. Create SEO-optimized, publication-ready articles with a single command.

Project description

OpenBlog

Open-source AI-powered blog generation system โ€” 12-stage pipeline for producing high-quality, AEO-optimized articles.

โœจ Features

  • ๐Ÿ”„ 12-Stage Pipeline โ€” Modular, testable stages from data fetch to HTML output
  • ๐ŸŽฏ AEO Optimization โ€” Built-in Answer Engine Optimization scoring (70-85+ scores)
  • ๐Ÿ” Smart Citations โ€” Automatic source validation and formatting
  • ๐Ÿ“ Rich Content โ€” FAQ/PAA extraction, internal links, ToC generation
  • ๐Ÿ–ผ๏ธ Image Generation โ€” AI-powered featured images via OpenRouter
  • ๐ŸŒ Multi-language โ€” Supports multiple languages with auto-detection
  • โšก Fast โ€” 60-90 second generation time

๐Ÿ“‹ Pipeline Stages

Stage 0: Data Fetch & Company Detection
Stage 1: Prompt Construction
Stage 2: AI Content Generation (Gemini + tools)
Stage 3: Structured Data Extraction
Stage 4: Citation Validation โ”€โ”
Stage 5: Internal Links      โ”‚ (parallel)
Stage 6: Table of Contents   โ”‚
Stage 7: Metadata            โ”‚
Stage 8: FAQ/PAA Enhancement โ”‚
Stage 9: Image Generation   โ”€โ”˜
Stage 10: Cleanup & Validation
Stage 11: HTML Generation & Storage

๐Ÿš€ Quick Start

Installation

git clone https://github.com/federicodeponte/openblog.git
cd openblog
pip install -r requirements.txt

Environment Variables

# Required
GEMINI_API_KEY=your_gemini_api_key

# Optional - DataForSEO fallback (when Google Search quota exhausted)
# Cost: $0.50 per 1,000 queries - Standard mode (async task-based)
# Automatically activates when Google Search returns 429/quota errors
DATAFORSEO_LOGIN=your_dataforseo_email
DATAFORSEO_PASSWORD=your_dataforseo_password

# Optional - for Google Drive integration
GOOGLE_SERVICE_ACCOUNT_JSON='{"type":"service_account",...}'
GOOGLE_DELEGATION_SUBJECT=user@domain.com

API Usage

# Start the server
uvicorn service.api:app --reload

# Generate a blog
curl -X POST http://localhost:8000/blog/write \
  -H "Content-Type: application/json" \
  -d '{
    "primary_keyword": "AI in customer service",
    "company_url": "https://example.com"
  }'

Python Usage

from pipeline.core.workflow_engine import WorkflowEngine
from pipeline.core.execution_context import ExecutionContext

engine = WorkflowEngine()
context = ExecutionContext(
    job_id="test-123",
    job_config={
        "primary_keyword": "AI adoption in customer service",
        "company_url": "https://example.com",
    },
)

result = await engine.execute(context)
print(result.final_article["Headline"])

๐Ÿ—๏ธ Project Structure

openblog/
โ”œโ”€โ”€ pipeline/
โ”‚   โ”œโ”€โ”€ blog_generation/    # 12 stages (stage_00 to stage_11)
โ”‚   โ”œโ”€โ”€ core/               # Workflow engine, execution context
โ”‚   โ”œโ”€โ”€ models/             # Data models, AI clients
โ”‚   โ”œโ”€โ”€ processors/         # HTML, citations, sitemap
โ”‚   โ”œโ”€โ”€ prompts/            # Prompt templates
โ”‚   โ””โ”€โ”€ utils/              # AEO scorer, helpers
โ”œโ”€โ”€ service/
โ”‚   โ”œโ”€โ”€ api.py              # FastAPI endpoints
โ”‚   โ””โ”€โ”€ image_generator.py  # Image generation
โ”œโ”€โ”€ tests/                  # Test suite
โ”œโ”€โ”€ docs/                   # Documentation
โ”œโ”€โ”€ modal_deploy.py         # Modal deployment
โ””โ”€โ”€ requirements.txt

๐Ÿ“Š Output Quality

  • AEO Score: 70-85+ / 100
  • Generation Time: 60-90 seconds
  • Citation Validation: Automatic URL checking
  • HTML Output: Clean, semantic markup

๐Ÿ”ง Deployment

Modal (Recommended)

pip install modal
modal deploy modal_deploy.py

Docker

docker build -t openblog .
docker run -p 8000:8000 openblog

๐Ÿ“– Documentation

๐Ÿงช Testing

pytest tests/ -v
pytest tests/stages/test_stage_00.py -v  # Test specific stage

๐Ÿ“ License

MIT License - see LICENSE for details.

๐Ÿค Contributing

Contributions welcome! Please read the contributing guidelines before submitting PRs.


Built with โค๏ธ by SCAILE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openblog-2.0.1.tar.gz (498.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openblog-2.0.1-py3-none-any.whl (538.7 kB view details)

Uploaded Python 3

File details

Details for the file openblog-2.0.1.tar.gz.

File metadata

  • Download URL: openblog-2.0.1.tar.gz
  • Upload date:
  • Size: 498.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.8

File hashes

Hashes for openblog-2.0.1.tar.gz
Algorithm Hash digest
SHA256 4d3c0ed3c06d3286359eb580f5e02e5ae87c26418297abc1063873950412095f
MD5 e8ad695f7e91eacbb24526eb3ca666aa
BLAKE2b-256 dee9c65f9641bbaf9b9639404b09654ae10042499cd67034ce6efec4417f62e6

See more details on using hashes here.

File details

Details for the file openblog-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: openblog-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 538.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.8

File hashes

Hashes for openblog-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 16b9134f08e848f4466af255a2d59da87fb6e85d6a7ececa8bd7a82ea7ee1fe8
MD5 fc397ba518502942400650e9399227d1
BLAKE2b-256 ef3e5948a7a84a210e4a44dfb6a03da92ba75f2acdd53b9bb3d85034e6330bc7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page