AI Marketing Assistant
Autonomous branded poster generation — agents for meaning, code for pixels.
A full-stack AI content platform that generates production-ready marketing posters and Instagram stories for any brand. Three specialized LLM agents — Creative Director, Image Strategist, and Quality Auditor — orchestrate a 9-step pipeline from user prompt to published poster, with vision-based QA and automatic revision loops. 25+ poster archetypes, multi-platform output, and real-time progress streaming.
See It Work
User types: “Summer sale: 30% off all appetizers this weekend!”
The pipeline runs 9 steps:
- Creative Director (GPT-5.4) → selects
hero_image_overlayarchetype, writes headline, maps brand colors - Image Strategist (GPT-4o) → chooses FLUX.2-pro, writes 600-word image prompt, selects portrait aspect ratio
- Asset Generation → FLUX.2-pro renders photorealistic background image
- Vision Analysis → detects safe text zones and busyness in the generated image
- Overlay Policy → selects scrim overlay for readability on busy backgrounds
- Typography Engine → computes responsive font sizes for headline, subheadline, CTA
- Template Compositor → Jinja2 renders complete HTML with brand colors, logo, computed typography
- Puppeteer Renderer → HTML to PNG at 1080x1080 (2x DPI)
- Quality Auditor (GPT-5.4 vision) → evaluates the rendered poster, approves or triggers revision
Output: Production-ready poster + platform-specific caption + hashtags. If the auditor finds issues (text overflow, color mismatch, readability), it triggers automatic fixes and re-renders — up to 2 revision cycles.
Variants: Same creative brief → automatically re-rendered for Instagram (1080x1080), Facebook (1200x630), LinkedIn (1200x627), and Twitter (1200x675).
Currently powering Kaiwa’s social media presence — generating marketing posts for Instagram, Facebook, and LinkedIn.

The Three Agents
Creative Director — The strategist. Takes the user’s prompt and brand context, selects from 25+ poster archetypes (hero image overlay, split image/text, quote card, tip list, event promo, and more), writes the headline and CTA, maps colors to brand palette roles, and determines image strategy. Enforces brand consistency by reverse-mapping hex values back to semantic color keys.
Image Strategist — The visual planner. Decides whether the poster needs an AI-generated image (FLUX.2-pro), a GPT-Image fallback, or a CSS programmatic background (gradient, geometric pattern). Writes detailed 600+ token image prompts optimized for the selected model and aspect ratio.
Quality Auditor — The QA layer. Uses GPT-5.4 with vision to evaluate the final rendered poster. Checks text readability, brand color consistency, logo alignment, and visual hierarchy. Returns a restricted-vocabulary fix type (TEXT_REWRITE, IMAGE_ISSUE, OVERLAY_ESCALATION) — no hallucinated suggestions, just actionable fixes that the pipeline can execute automatically.
Key Technical Decisions
-
Agents for meaning, code for pixels — LLM agents make creative decisions (archetype, copy, image model). Everything downstream — typography computation, HTML composition, Puppeteer rendering — is deterministic and testable. The poster is rendered from HTML templates, not generated by an image model.
-
Vision-based QA, not rule-based — A rule engine can’t evaluate whether text is readable on a complex background. GPT-5.4 vision can. The auditor evaluates the actual rendered PNG, not the template parameters.
-
25+ archetypes, not free-form layout — Constrained creativity. The Creative Director selects from tested layout patterns, ensuring every poster has professional structure. The LLM decides which archetype fits; the template guarantees pixel-perfect execution.
-
Multi-model image strategy — FLUX.2-pro for photorealistic images, GPT-Image as fallback, CSS programmatic backgrounds when no image is needed. Selection is per-brief, with rate limiting and cost tracking via Redis.
-
Puppeteer rendering, not Pillow — HTML/CSS gives full typographic control (kerning, line-height, letter-spacing, responsive clamp). Puppeteer renders at 2x DPI for retina quality. Jinja2 templates are version-controlled and testable.
More Features
- Instagram Stories — Multi-slide story generation (3-7 slides) with narrative arc planning per slide, concurrent rendering, and per-slide creative direction
- Brand Discovery — Automated brand profile extraction from website + social media using parallel tool-calling agents (website scraper, social media analyzer, web search, palette generator)
- Magic Canvas UI — Interactive studio with chat-based input (left pane), real-time poster preview (right pane), SSE progress streaming via Redis Pub/Sub, and download/share actions
- Real-time Progress — 9-step progress bar streamed via Server-Sent Events with Redis Pub/Sub; polling fallback for unreliable connections
- Caption Generation — Platform-specific captions + hashtags generated concurrently with rendering
Tech Stack
Backend: FastAPI (async) · SQLModel ORM · PostgreSQL 16 · ARQ (Redis-backed task queue) · Azure Blob Storage
Frontend: Next.js 16 (App Router) · React 19 · shadcn/ui · Tailwind CSS 4 · Zustand · TanStack Query
AI/Image: Azure OpenAI (GPT-5.4, GPT-4o) · FLUX.2-pro (Azure AI) · GPT-Image-1.5 · FLUX Kontext (revisions)
Rendering: Puppeteer (Node.js microservice) · Jinja2 templates (25+ archetypes) · Typography engine with responsive clamp()
Auth: Clerk (JWT + JWKS) · Infra: Azure App Service + Static Web Apps · Quality: Ruff + ESLint · Mypy · pytest + Vitest · Playwright E2E
Want to build something like this?
Let's talk about your project. No commitment, no slides — just a conversation about what's possible.
Get in Touch