AI-Powered Brand Content Pipeline
Scrape competitors. Generate platform-optimized content with a multi-agent AI team. Approve via Slack. Publish everywhere. 130 posts/month across 3 brands for ~$59/mo.
An AI-powered content pipeline that replaces manual social media and blog management for 3 brands. The system learns from competitors, generates platform-optimized content, routes through human approval, and publishes automatically.
Three Brands:
| Brand | Domain | Category |
|---|---|---|
| dokwallet | dokwallet.com | Crypto wallet |
| doktransfers | doktransfers.com | File transfer |
| vesappsai | vesappsai.com | AI chat |
Pipeline: Scrape competitors → Analyze patterns → Generate ideas → AI agent team creates content → Human approval via Slack → Publish to platforms
| Topic | Decision |
|---|---|
| Project name | content-factory |
| Monorepo | Yes, single Python repo |
| Platforms (primary) | LinkedIn, Facebook, Instagram, branded blogs |
| Platforms (Phase 2+) | X/Twitter, TikTok, YouTube Shorts |
| Workflow engine | n8n (scheduling/HITL/Slack) + CrewAI or ADK (agents) |
| Database | PostgreSQL 16 (pgvector + Apache AGE) |
| Content calendar | Postiz or mixpost |
| Batch execution | Claude Code CLI batch mode |
Monthly output across 3 brands: 130 posts/month
| Format | Count/month |
|---|---|
| LinkedIn posts | 40 |
| Carousels (IG/FB) | 30 |
| Blog articles | 12 |
| Reels/short videos | 30 |
| Stories | 18 |
Server: Hetzner CPX41 — 8 shared vCPU, 16GB RAM, 240GB NVMe — ~$21/mo
Docker Compose — 6 containers:
| Container | RAM | Purpose |
|---|---|---|
app (FastAPI) |
512MB–1.5GB | All services as modules |
postgres (pgvector + AGE) |
1.5GB | Document + Vector + Graph DB |
n8n |
512MB | Scheduling, Slack HITL, workflows |
postiz or mixpost |
512MB–1GB | Content calendar UI |
redis |
128MB | Required by n8n + Postiz |
caddy |
64MB | Reverse proxy + auto HTTPS |
| Total | ~4–5GB | Fits easily on 16GB |
Monthly cost: ~$26 (server $21 + backup $5)
Migration path to Fargate: 5–8 days effort when revenue justifies $300+/mo.
| Option | Monthly Cost | Notes |
|---|---|---|
| Hetzner VPS (recommended) | ~$26 | Best value, Docker Compose |
| AWS Fargate | ~$300–420 | Managed, follows vest-ai-cdk |
| GCP Cloud Run | ~$105–115 | Scale-to-zero |
| Hybrid VPS + Free Tiers | ~$22–28 | Risk: free tier expiry |
| Provider | Price/mo |
|---|---|
| Hetzner CPX41 | ~$21 |
| Contabo | ~$12–15 |
| DigitalOcean | ~$96 |
| Vultr | ~$96 |
MVP: Unified PostgreSQL 16 with extensions handles all 3 DB roles:
| DB Role | Solution | Notes |
|---|---|---|
| Document DB | PostgreSQL JSONB | 90–95% of MongoDB for this use case |
| Vector DB | pgvector extension | Good for <500K vectors |
| Graph DB | Apache AGE extension | Cypher queries, content relationships |
| Object Storage | S3 / Hetzner / R2 | Generated media, templates, brand assets |
Scale-up path: Split to dedicated FalkorDB (graph) + Qdrant (vector) when needed.
| Phase | Model | Cost/mo |
|---|---|---|
| All LLM phases | Gemini 2.0 Flash | ~$2 |
| Images (195) | Flux Schnell ($0.015/img) | ~$3 |
| Video (24 reels) | Template-based (MoviePy + FFmpeg) | ~$0.24 |
| TTS | Google Cloud TTS free tier | $0 |
| Total | ~$15 |
| Phase | Model | Cost/mo |
|---|---|---|
| Scraper analysis (4.2M tokens) | Gemini 2.0 Flash | $0.62 |
| Routing/decisions (650 calls) | Gemini 2.0 Flash | $0.12 |
| Research agents | Gemini 2.5 Flash | $2–3 |
| Ideation | Claude Sonnet 4.6 | $0.83 |
| Writing | Claude Sonnet 4.6 | $8–10 |
| Editing | Claude Sonnet 4.6 | $4–5 |
| SEO/analytics | Gemini 2.5 Flash | $1–2 |
| Image prompts | Gemini 2.5 Flash | $0.50 |
| Images (195) | Flux Pro 1.1 ($0.055/img) | ~$5 |
| Video (24 reels) | Template-based + Pika | ~$5 |
| TTS | Google Cloud TTS free tier | $0 |
| Total | ~$33 |
| Phase | Model | Cost/mo |
|---|---|---|
| All LLM phases | Claude Opus 4.6 | $64 |
| Images (195) | Ideogram v3 Quality | $18 |
| Video (24 reels, 45s avg) | Veo 3.1 4K + audio | $655 |
| TTS | ElevenLabs Pro plan | $99 |
| Total | ~$836 |
| Scale | Posts/mo | AI Cost/mo |
|---|---|---|
| 3 brands | 130 | ~$33 |
| 6 brands | 260 | ~$55 |
| 10 brands | 430 | ~$85 |
| 1000 posts | 1000 | ~$150 |
| Budget | Quality | Premium | |
|---|---|---|---|
| Hetzner VPS + backup | $26 | $26 | $26 |
| AI costs | $15 | $33 | $836 |
| Monthly total | ~$41 | ~$59 | ~$862 |
Domain knowledge, competitor insights, trends
Gemini 2.5 FlashText, image prompts, video scripts
Claude Sonnet 4.6Brand voice, quality review, revisions
Claude Sonnet 4.6Content type classification, platform routing
Gemini 2.0 Flash| Agent | Role | Model |
|---|---|---|
| Researcher | Domain knowledge, competitor insights, trends | Gemini 2.5 Flash |
| Writer | Generate text, image prompts, video scripts | Claude Sonnet 4.6 |
| Editor | Brand voice check, quality review, revisions | Claude Sonnet 4.6 |
| Router | Classify content type, platform routing, quality gates | Gemini 2.0 Flash |
Scraper (n8n scheduled) → Competitor data → PostgreSQL (JSONB + pgvector)
RSS/News (n8n scheduled) → Ideation agents → Content ideas ranked
→ Agent team (researcher + writer + editor) → Draft
→ n8n → Slack approval (approve/reject/revise)
→ Postiz/mixpost calendar → Scheduled publish
→ Publisher → LinkedIn / Facebook / Instagram / Blog
Analytics (n8n scheduled) → Performance metrics → Slack weekly report
85–90% of business reels are template-based, not AI video generation:
| Approach | Cost/video | Monthly (24) | How |
|---|---|---|---|
| MoviePy + FFmpeg | $0.01 | $0.24 | Images + text + music + transitions |
| Remotion Lambda | $0.03 | $0.72 | React templates → MP4 |
| ShortGPT | $0.02–0.20 | $0.50–5 | Stock footage + TTS + overlays |
| Pika 2.2 API | $2.80 | $67 | AI video generation |
| Veo 3.1 4K | $27/reel | $655 | Premium AI video |
| Module | Function |
|---|---|
common/ |
Brand config, platform specs, shared models |
scraper/ |
Competitor intelligence (instaloader, linkedin_scraper, snscrape) |
ideation/ |
Trend detection + idea generation (RSSHub, miniflux, newspaper4k) |
generator/ |
AI agent team for content creation |
publisher/ |
Platform posting (instagrapi, LinkedIn API, Graph API) |
knowledge/ |
Domain knowledge RAG — feeds agents with brand/industry context |
analytics/ |
Cost tracking + performance collection |
/kill-post {id} Slack commandAll competitors have active LinkedIn + Facebook + Instagram presence.
| Competitor | Description |
|---|---|
| MetaMask | Most popular browser extension wallet |
| Exodus | Desktop + mobile multi-chain wallet |
| Phantom | Solana-native, expanding multi-chain |
| ZenGo | MPC-based, keyless security |
| Zerion | DeFi-focused portfolio + wallet |
| Competitor | Description |
|---|---|
| fromsmash | Large file sharing, no size limit |
| wetransfer | Iconic simple file transfer |
| jumbomail | Large attachment email service |
| Competitor | Description |
|---|---|
| Character.ai | AI character conversations |
| Replika | AI companion chatbot |
| Unit | Description | Test |
|---|---|---|
| 0a Local Docker Compose | docker-compose.local.yml with all services, hot-reload | All containers healthy on localhost |
| 0b End-to-end smoke test | Scrape 1 post → generate 1 draft → Slack preview | uv run python -m content_factory.smoke_test |
| 0c Dev tooling | Makefile, pre-commit (ruff, mypy), VS Code config | make up && make test |
| Unit | Description | Test |
|---|---|---|
| 1 Repo scaffold | src/ structure, pyproject.toml, Dockerfile,
CLAUDE.md |
uv sync succeeds |
| 2 Docker Compose | FastAPI, PostgreSQL, n8n, Redis, Caddy with health checks | docker compose up healthy |
| 3 PostgreSQL schema | SQLAlchemy + Alembic: brands, competitors, drafts, costs | alembic upgrade head |
| 4 Brand config | YAML configs for 3 brands with Pydantic validation | Unit tests pass |
| 5 Common utilities | LLM client, platform specs, cost tracker, logging | Unit tests pass |
| Unit | Description | Test |
|---|---|---|
| 6 Instagram scraper | Instaloader: posts, captions, hashtags, engagement | --dry-run succeeds |
| 7 LinkedIn scraper | LinkedIn pages: posts, articles, engagement | --dry-run succeeds |
| 8 Facebook scraper | Facebook pages: posts, reactions, shares | --dry-run succeeds |
| 9 RSS + news | RSSHub + newspaper4k: crypto/tech/AI feeds | --fetch populates DB |
| Unit | Description | Test |
|---|---|---|
| 10 Competitor analysis | Pattern extraction via Gemini 2.0 Flash | Patterns in DB |
| 11 Ideation pipeline | Ranked content ideas via Claude Sonnet 4.6 | Ideas for dokwallet |
| 12 Knowledge/RAG | pgvector similarity search for agent context | Query returns context |
| 13 Researcher agent | CrewAI/ADK researcher with Gemini 2.5 Flash | Research summary |
| 14 Writer + Editor | Writer (Sonnet) + Editor (Sonnet) + revision loop | LinkedIn draft |
| 15 Image generation | Platform-aware image prompts + Flux Pro API | Image generated |
| Unit | Description | Test |
|---|---|---|
| 16 n8n approval | Webhook → Slack preview → Approve/Reject/Revise | Slack buttons work |
| 17 LinkedIn publisher | Official API: text, images, documents | Post on test account |
| 18 Instagram publisher | Instagrapi: posts, carousels, stories | Post on test account |
| 19 Facebook publisher | Graph API: posts, images, videos | Post on test page |
| 20 Calendar integration | Postiz/mixpost API for scheduling | Post in calendar |
| Unit | Description | Test |
|---|---|---|
| 21 Cost tracker | Per-request LLM cost tracking in cost_ledger | Cost report generated |
| 22 Performance analytics | Engagement metrics collection | Metrics fetched |
| 23 Weekly Slack report | Sunday 6pm: ideas + performance per brand | Report sent |
| 24 SEO pipeline | Keywords, meta tags, schema markup | Meta tags generated |
| 25 Kill switch | /kill-post {id} Slack command |
Post removed |
| Unit | Description | Test |
|---|---|---|
| 26 doktransfers setup | Brand config + competitor scraping | Scrapers run |
| 27 vesappsai setup | Brand config + competitor scraping | Scrapers run |
| 28 Blog publisher | Ghost CMS or static page generation | Article published |
| 29 Calendar UI | Multi-brand calendar with drag-and-drop | Shows all 3 brands |
| 30 Video reels | MoviePy/Remotion: images + text + music → MP4 | 30s reel generated |
Wave 0: [local-docker] [smoke-test] [dev-tooling]
↓
Wave 1: [scaffold] [docker] [schema] [brands] [utils]
↓
Wave 2: [ig-scraper] [li-scraper] [fb-scraper] [rss]
↓
Wave 3: [analysis] [ideation] [rag] [researcher] [writer+editor] [images]
↓
Wave 4: [n8n-approval] [li-publish] [ig-publish] [fb-publish] [calendar]
↓
Wave 5: [cost-tracker] [analytics] [weekly-report] [seo] [kill-switch]
↓
Wave 6: [doktransfers] [vesappsai] [blog] [calendar-ui] [video-reels]
| Repo | Reuse For |
|---|---|
| social-media-agent | LangGraph + Slack HITL + LinkedIn/Twitter posting |
| crewAI-examples | Instagram Post, Content Creator, Marketing crews |
| neural-reels | ADK multi-agent video (Veo, Imagen, TTS) |
| ALwrity | SEO pipeline, Google Trends, content generation |
| agentic-rag-for-dummies | LangGraph + Qdrant RAG pattern |
| ai-knowledge-graph | FalkorDB schema + populate pattern |
| postiz-app | Content calendar, multi-platform scheduling |
| mixpost | Alternative scheduler with analytics |
| MoneyPrinterV2 | YouTube Shorts automation |
| Auto_Social_Media_Content_Generator | Canva API + platform specs |
| Risk | Likelihood | Mitigation |
|---|---|---|
| Instagram account bans | High | Residential proxies, rate limits, warm-up, official API |
| LinkedIn API approval delays | Medium | Apply Week 1, manual posting via Postiz |
| Content quality / brand safety | Medium | Mandatory human approval, brand voice calibration |
| Scraper breakage | High | Multiple fallbacks, 48h health alerts, degrade to RSS |
| VPS single point of failure | Medium | Automated backups (restic → object storage) |
| Multi-model API dependency | Low–Med | Fallback models per phase |
| Platform T&C violations | Medium | Official APIs where possible |
| Model | Input/Output per MTok |
|---|---|
| Claude Opus 4.6 | $5 / $25 |
| Gemini 3.1 Pro Preview | $2–4 / $12–18 |
| GPT-5 | $1.25 / $10 |
| Model | Cost per Image |
|---|---|
| Ideogram v3 | $0.09 |
| Flux Kontext Max | $0.08/MP |
| Imagen 4 | $0.02–0.06 |
| Nano Banana 2 | $0.04 |
| Model | Cost per Second |
|---|---|
| Veo 3.1 | $0.20–0.60 |
| Kling 2.1 Master | $0.28 |
| Runway Gen-4 | ~$0.48 |
| Model | Cost |
|---|---|
| ElevenLabs | $99/mo (best quality) |
| OpenAI TTS-1-HD | $15/1M chars |
Note: No Gemini 3.5 Pro exists (latest is 3.1 Pro Preview). Midjourney still has no public API.