In-production AI marketing platform for Tessan. RAG on pgvector + orchestration of 9 AI models (GPT-4o, Imagen, Veo, HeyGen) generating text, image and video while preserving brand voice. Autopilot scheduling, human-in-the-loop, Meta publishing. Solo build.
Tessan is a French telemedicine company: kiosks, cabins, and teleconsultation tables deployed in pharmacies. The marketing team needs to publish regularly on Facebook and Instagram while honoring a strong brand book: credible medical tone, core values ("technology serves care, never the other way around"), and visual consistency of real products that must appear identical on every visual. Sustaining this level of rigor at a steady publishing cadence is time-consuming — social media is the first task to be sacrificed under pressure. The CEO asked me to design and build, solo, an internal AI-driven marketing automation platform.
The problem isn't generating content — it's producing content that sounds like Tessan. Honoring the editorial restrictions, the credible medical framing, and zero product hallucinations — no "compact kiosk" or "Tessan Pro" invented by the model.
Goals set:
Three-tier architecture. Next.js 15 frontend (static export) on Firebase Hosting, async FastAPI backend on Cloud Run, Postgres + pgvector on Cloud SQL. The backend acts as a secure proxy — no secret (OpenAI, Meta, HeyGen) ever reaches the browser.
RAG on pgvector as the technical core. Ingestion of PDF, DOCX, and — crucially — images: GPT-4o Vision describes every visual (products, brand book, past posts) with a prompt specialized per collection. Embeddings via text-embedding-3-small (1536 dim.). Cosine-distance search with a boost on chunks validated by user feedback — the system aligns over time with what the team considers good.
Orchestration of 9 AI models. GPT-4o (text + Vision), Imagen 4 + Nano Banana 2 (image), Veo 3.1 (video), HeyGen v2 (talking avatar).
Key innovation — product auto-detection. GPT-4o and Imagen, left to their own devices, invent Tessan product variants: "compact kiosk", "Tessan Pro", terminals that have never existed. I built a keyword-matching module (with Unicode normalization for French) over the 7 real products pre-registered in the database. When a product is detected in the user's description, silent switch from Imagen 4 to Nano Banana 2 with injection of reference photos (up to 14 simultaneously) and an explicit instruction: "NO modification, NO variant invention". Zero product hallucination, zero technical choice asked of the user.
Human-in-the-loop, two phases on heavy workflows (carousels, video). Phase 1: a single GPT-4o call produces an editable plan. Phase 2: the expensive generation only runs once the plan is validated. Avoids burning credits if the model goes down the wrong path. 10-slide carousel in ~1 min (vs 5 min sequential).
Autopilot — the most complex module. The team defines weekly slots, feeds a topic pool (manual or GPT-4o suggested), and only intervenes at validation. 9-state workflow, traceable batches, dual authentication (manual JWT or shared secret for Cloud Scheduler triggers).
Meta publishing via Graph API v21.0 — feature flags, double-publishing protection, full traceability.
Deployed in production on GCP. Used daily by the Tessan marketing team.
Measurable impact. A simple piece of content takes minutes (vs the full manual cycle: writing, validation, visual creation, per-platform variants, publishing). Avatar video in 2 to 10 minutes. Brand consistency guaranteed by the RAG. Complete traceability: every generation timestamped with its prompt, RAG chunks, model, and publish status.
Scale. 13 Postgres tables · 28 API endpoints · ~120 unit tests · 9 AI models orchestrated.
Solo build, end-to-end. Design, backend dev (FastAPI + RAG + orchestration), frontend dev (Next.js), GCP infra, deployment, handover. From the first line of code to production.