░██████ ░████████
░██ ░██ ░██ ░██
░██ ░███████ ░████████ ░██ ░██ ░██ ░██ ░██░████ ░███████ ░██ ░██ ░██ ░███████ ░██░████ ░██ ░██
░██ ░██ ░██ ░██ ░██ ░██ ░██ ░████████ ░███ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░███ ░██ ░██
░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░██ ░█████████ ░██ ░████ ░██ ░█████████ ░██ ░██ ░██
░██ ░██ ░██ ░██ ░███ ░██ ░██ ░███ ░██ ░██ ░██ ░██ ░██░██ ░██░██ ░██ ░██ ░██ ░███
░██████ ░███████ ░██░█████ ░█████░██ ░█████████ ░██ ░███████ ░███ ░███ ░███████ ░██ ░█████░██
░██ ░██ ░██
░██ ░███████ ░███████
Brew fresh marketing copy from the web.
CopyBrewery is a LangGraph-powered crawling agent that scrapes website copy (headlines, taglines, descriptions) and uses AI to generate new marketing content inspired by those patterns.
- 🕷️ Smart Web Crawling - Playwright-based crawler handles JavaScript-rendered pages
- 🧠 AI-Powered Extraction - GPT-4o identifies and categorizes marketing copy elements
- ✨ Content Generation - Generate new marketing content inspired by scraped patterns
- 💾 Persistent Storage - SQLite database stores all scraped and generated content
- 🖥️ CLI & API - Use via command line or REST API
- 🐳 Docker Ready - Deploy anywhere with Docker
# Clone the repo
git clone https://github.com/pchaganti/copybrewery.git
cd copybrewery
# Install
pip install -e .
# Install Playwright browser
playwright install chromium
# Set up environment
cp .env.example .env
# Add your OPENAI_API_KEY to .env# Crawl a website
cbrew crawl https://stripe.com --depth 1
# View scraped data
cbrew list websites
cbrew show 1
# Generate marketing copy
cbrew generate marketing --source stripe --count 3
# Generate taglines
cbrew generate taglines --source stripe --count 5
# Export data
cbrew export 1 --format json --output stripe_data.json| Command | Description |
|---|---|
cbrew crawl <url> |
Crawl a website and extract marketing copy |
cbrew list websites |
List all scraped websites |
cbrew show <id> |
Show details of a scraped website |
cbrew generate <type> --source <name> |
Generate new content |
cbrew export <id> |
Export scraped data to JSON |
cbrew version |
Show version |
| Type | Description |
|---|---|
marketing |
Full marketing copy with headlines and CTAs |
descriptions |
Product/service descriptions |
taglines |
Short memorable phrases |
headlines |
Attention-grabbing headers |
cta |
Call-to-action button text |
Start the API server:
# Install API dependencies
pip install -e ".[api]"
# Start server
uvicorn copybrewery.api:app --reload| Method | Endpoint | Description |
|---|---|---|
| GET | / |
Health check |
| POST | /crawl |
Crawl a website |
| POST | /generate |
Generate content |
| GET | /websites |
List all websites |
| GET | /websites/{id} |
Get website details |
| GET | /websites/{id}/elements |
Get copy elements |
# Crawl a website
curl -X POST http://localhost:8000/crawl \
-H "Content-Type: application/json" \
-d '{"url": "https://stripe.com", "depth": 1, "max_pages": 5}'
# Generate content
curl -X POST http://localhost:8000/generate \
-H "Content-Type: application/json" \
-d '{"source": "stripe", "content_type": "taglines", "count": 3}'
# List websites
curl http://localhost:8000/websites┌─────────────────────────────────────────────────────────────┐
│ CLI / REST API │
└─────────────────────┬───────────────────────────────────────┘
│
┌─────────────────────▼───────────────────────────────────────┐
│ LangGraph Agent │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Start │→ │ Crawl │→ │ Extract │→ │ Store │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ │ │
│ ┌──────────┐ ┌──────────┐ │ │
│ │ Generate │← │ Query │←───────────────────────┘ │
│ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘
│
┌─────────────────────▼───────────────────────────────────────┐
│ SQLite Database │
│ Tables: websites, pages, copy_elements, generated_content │
└─────────────────────────────────────────────────────────────┘
copybrewery/
├── pyproject.toml # Dependencies and project config
├── .env.example # Environment variables template
├── Dockerfile # CLI Docker image
├── Dockerfile.api # API Docker image
├── docker-compose.yml # Docker Compose config
├── src/copybrewery/
│ ├── cli.py # Typer CLI commands
│ ├── api.py # FastAPI REST API
│ ├── agent/ # LangGraph workflow
│ ├── scraper/ # Playwright crawler & extractor
│ ├── database/ # SQLAlchemy models & repository
│ └── generator/ # GPT-4 content generation
└── docs/
└── DEPLOYMENT.md # Deployment guide
See docs/DEPLOYMENT.md for detailed deployment instructions.
# Set your API key
export OPENAI_API_KEY=sk-xxx
# Start API server
docker-compose up api
# Or run CLI commands
docker-compose run --rm cli crawl https://stripe.comCopyBrewery can be deployed to:
- Railway - One-click deploy
- Fly.io - Global edge deployment
- Render - Free tier available
- AWS/GCP/Azure - Container services
| Variable | Description | Default |
|---|---|---|
OPENAI_API_KEY |
OpenAI API key (required) | - |
DATABASE_URL |
SQLite database path | sqlite:///data/copybrewery.db |
OPENAI_MODEL |
Model for extraction/generation | gpt-4o |
- Competitor Analysis - Study how competitors position their products
- Landing Page Copy - Generate A/B test variations
- Product Descriptions - Create descriptions inspired by successful brands
- Marketing Research - Understand industry messaging patterns
- Content Ideation - Generate taglines and headlines
- Python 3.10+
- OpenAI API key
- Playwright (Chromium)
MIT License - see LICENSE for details.
Contributions welcome! Please read the contributing guidelines first.
Built with ❤️ using LangGraph, Playwright, and GPT-4