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-3.0.0.tar.gz (493.5 kB view details)

Uploaded Source

Built Distribution

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

openblog-3.0.0-py3-none-any.whl (534.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openblog-3.0.0.tar.gz
  • Upload date:
  • Size: 493.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for openblog-3.0.0.tar.gz
Algorithm Hash digest
SHA256 f5b0364b6717914da6d133058da92aade83ffbba47d0a6bb78a173a2af2e9778
MD5 79d4409a4bb520430f608c6b3510c552
BLAKE2b-256 8041ea04f8528b1bb6caebee8a464a400f3776b4b9fe1729126e4d0a27cc0c76

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openblog-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 534.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for openblog-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 73bc7d8ff156356e5349ebdf32c5e31021fed762c7d5d15eff23fe96ff7ad1ca
MD5 99a614505f1c9fcf4db2a20bdeaa083d
BLAKE2b-256 5f4c38b17697505898aef94071636028f1dbddec4b0a378978830f245bab508d

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