Implementation Plan | March 2026

Content Factory

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.

3 Brands 130 Posts/Mo ~$59/Mo Quality Tier 7 Waves, 30 Units
dokwallet doktransfers vesappsai
Scroll to explore

Content Factory — AI-Powered Brand Content Pipeline

Section 1: Overview

1.1 What Is Content Factory?

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

3
Brands
130
Posts / Month
$59
Quality Tier / Mo
30
Implementation Units

1.2 Key Decisions

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

1.3 Volume & Output

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

Section 2: Architecture

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.

2.2 Alternative Deployments

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

VPS Provider Comparison (8 vCPU, 16GB)

Provider Price/mo
Hetzner CPX41 ~$21
Contabo ~$12–15
DigitalOcean ~$96
Vultr ~$96

2.3 Database Architecture

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.

Section 3: AI Costs

3.1 Budget Tier (~$15/mo)

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

3.3 Premium Tier (~$836/mo)

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

3.4 Scaling (Sublinear)

AI Cost vs Number of Brands

Scale Posts/mo AI Cost/mo
3 brands 130 ~$33
6 brands 260 ~$55
10 brands 430 ~$85
1000 posts 1000 ~$150

3.5 Grand Total Monthly

Monthly Cost by Tier ($)

Budget Quality Premium
Hetzner VPS + backup $26 $26 $26
AI costs $15 $33 $836
Monthly total ~$41 ~$59 ~$862

Section 4: Agent Team

4.1 Agent Architecture

Researcher

Domain knowledge, competitor insights, trends

Gemini 2.5 Flash

Writer

Text, image prompts, video scripts

Claude Sonnet 4.6

Editor

Brand voice, quality review, revisions

Claude Sonnet 4.6

Router

Content 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

4.2 Data Flow

Scrape
Analyze
Ideate
Generate
Approve
Publish
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

4.3 Video: Template-Based vs AI-Generated

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

Section 5: Services & Modules

5.1 FastAPI Modules

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

5.2 Human-in-the-Loop (n8n + Slack)

  1. Generator creates draft → webhook triggers n8n
  2. n8n sends preview to brand Slack channel (#dokwallet-content, etc.)
  3. Manager clicks: Approve / Reject / Revise
  4. Approve → Postiz calendar → Publisher
  5. Revise → feedback to Editor agent → new draft → re-review
  6. 24h timeout → escalate to #content-factory-admin
  7. Weekly: Sunday 6pm — next week’s content ideas to Slack
  8. Emergency: /kill-post {id} Slack command

Section 6: Brands & Competitors

6.1 Brand Profiles

All competitors have active LinkedIn + Facebook + Instagram presence.

dokwallet (Crypto Wallet)

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

doktransfers (File Transfer)

Competitor Description
fromsmash Large file sharing, no size limit
wetransfer Iconic simple file transfer
jumbomail Large attachment email service

vesappsai (AI Chat)

Competitor Description
Character.ai AI character conversations
Replika AI companion chatbot

Section 7: Implementation Waves

7.1 Wave 0 — Local Development MVP

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

7.2 Wave 1 — Foundation

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

7.3 Wave 2 — Data Ingestion

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

7.4 Wave 3 — Intelligence & Generation

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

7.5 Wave 4 — Workflow & Publishing

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

7.6 Wave 5 — Analytics & Polish

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

7.7 Wave 6 — Multi-brand & Phase 2

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

7.8 Dependency Graph

Wave 0
Local Dev MVP
0a0b0c
Wave 1
Foundation
12345
Wave 2
Data Ingestion
6789
Wave 3
Intelligence
101112131415
Wave 4
Publishing
1617181920
Wave 5
Analytics
2122232425
Wave 6
Multi-brand
2627282930
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]

Section 8: Existing Repos

8.1 Reusable Components

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

Section 9: Risks & Mitigation

9.1 Risk Matrix

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

Section 10: Premium Models Available (March 2026)

10.1 Text Models

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

10.2 Image Models

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

10.3 Video Models

Model Cost per Second
Veo 3.1 $0.20–0.60
Kling 2.1 Master $0.28
Runway Gen-4 ~$0.48

10.4 TTS Models

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.