Vision RealityCase study 04 / 20
Content Factory
One place to take a brand from raw idea to posted, in a voice that actually sounds like that brand, with performance data flowing back into what it writes next.
Role
Sole designer and engineer
Status
● Running in production
Models
Claude via the Agent SDK · vision re-rank for images
Stack
Next.js + React · Claude Agent SDK · Prisma · Worker queue · Meta APIs · GA4
The short version
- Each brand has its own voice fingerprint, context files and pipeline board, so no two brands sound the same.
- Generates carousels, posters, video scripts and threads for Instagram, LinkedIn, X, TikTok and YouTube, then schedules and publishes.
- Ad campaigns are always created paused. Only an explicit activate step can start spending.
01Why I built it
The agency posts for several brands across five platforms. That used to mean separate tools for writing, design, scheduling, ads and analytics, and none of them knew what each brand sounds like. Generic AI copy sounds like everyone else.
I wanted one workspace where each brand's voice is a first-class object, and where what performed last month shapes what gets written this month.
02How it works
- BrandEach brand holds colours, fonts, tone, logo, toggleable context files and a trained voice fingerprint.
- IdeateTrend research (Brave Search, then Claude synthesis) on a per-brand cadence, ideas fed in from Butler, and a thumbs up/down loop that trains future ideation.
- GenerateTen named carousel structures, posters, reel scripts and threads, with per-slide regeneration and one-click repurposing to each platform's rules.
- DesignA 13-template library, plus image search where Claude writes the query and a vision pass re-ranks the results for aesthetics.
- PublishInstagram and Threads through official APIs, a QR handoff page for platforms without a free API, and token auto-refresh. Reels cut in the Video Studio come back here to be scheduled.
- LearnDaily insights pulled back and matched to posts and ads, GA4 conversions read for paid traffic, and a weekly rundown that proposes next week's plan.
03Model choices, and why
Ideas, copy, structure, weekly plan
Claude via the Agent SDK
Brand voice is a nuance problem. It needs a strong writer that can follow a structured fingerprint and a set of tactics at the same time.
Picking background images
A vision pass over search results
Search finds candidates; only a model that can see them can tell which ones look right for the brand.
Keeping models current
A daily model-update timer
Model lists refresh automatically, so the app doesn't quietly pin itself to something old.
04Context: what the model sees
- A voice fingerprint, not a pile of examples. Every 30 days the brand's context and its last 30 posts are distilled into a structured JSON fingerprint. Generators read that, and a scoring endpoint grades drafts against it.
- Toggleable context files. I choose which brand documents a generation can see, rather than sending everything every time.
- A capped tactics bank. Hooks, structures and CTAs mined from viral posts are injected into every generator, but capped so they guide rather than drown the brief.
- Feedback stays in its lane. The thumbs up/down learning loop is scoped per brand, so one brand's taste doesn't leak into another's.
05Token and cost discipline
- The fingerprint is the big one: a compact summary rebuilt monthly instead of 30 posts pasted into every prompt.
- Per-slide regeneration fixes one slide without regenerating the whole carousel.
- Usage and cost are metered per generation, so I can see what each format costs to make.
06Performance
- Generation runs on a separate worker process, so the web app stays responsive during long jobs.
- Images are stored content-addressed, so the same image is never stored twice.
- Slideshow MP4s are derived automatically from carousels at 1080×1920.
07Trade-offs I made
Chose
Official APIs where they're free, a QR handoff where they aren't
Over
Unofficial posting everywhere
Chose
Ads created paused
Over
Push-and-go
Chose
A chat agent that proposes
Over
An agent that acts
Chose
Self-hosted
Over
A stack of SaaS subscriptions
08Guardrails
- No money is spent without an explicit activate step.
- The brand chat agent can propose write actions but never executes them on its own.
09What I'd do next
- Meta App Review, so publishing opens beyond my own accounts.
10What this shows
Applied AI engineering
Context compression (the fingerprint), capped retrieval, vision re-ranking and a feedback loop that's scoped correctly.
Product
Replaces five tools with one workflow, and is built around the outcome (posts that perform) rather than the output (posts).
Solutions
Meta Marketing API, Instagram and Threads publishing, and GA4 conversions joined up so ads are judged on real leads.
Across the fleet: every build runs on one self-hosted Linux server, binds to localhost and is reached only over a private Tailscale network. AI inference runs on a Claude subscription through one in-house router (part of Sentry) rather than per-token API keys, with open-weight models on Ollama as the local layer: on the server, and on a 64 GB MacBook Pro shared over Tailscale for heavier local work. Everything is backed up to GitHub and a separate cold disk, and nothing reaches another person without a human tap.
Hiring for applied AI, product or solutions work? I'd like to hear about it.