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.0.tar.gz (497.9 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.0-py3-none-any.whl (538.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openblog-2.0.0.tar.gz
  • Upload date:
  • Size: 497.9 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.0.tar.gz
Algorithm Hash digest
SHA256 06b9b12a82ebbcccd8417ce56c6bba750b1866ed6b86f6bf3adaf67c1e4c0d11
MD5 6956c15a40152578dd843f99cde149d6
BLAKE2b-256 e7f76beee886ffcc006e6c6a9bcc084c9e8563ff22e3e85706876e7df2e56cd7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openblog-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 538.5 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58599fe6ebe43f72ff58d765bbcb945af8d410130a368924181cfa54eea168e1
MD5 e21626a7b2250d8cb0ce2a96e2a75e94
BLAKE2b-256 990f0c5fea373b912ae15b5e1bcf860399a08a616e5248c5f2052e00d39dffc7

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