AI Ad Generation System
Ad Library Scraping • Video Speech-to-Text • AI Creative Scoring • Auto-Brief Generation
Watch Demo VideoWrite to our Agent & Get personal pricing
AI Ad Generation System Case Study — Arihant Web Tech
What This System Does
We engineered an autonomous AI agent for a fast-growing D2C brand that was spending 15–20 hours per week manually reviewing competitor Facebook and Instagram ads. The system automatically monitors competitor ad libraries, analyzes creative formats, transcribes text and speech, and writes actionable briefs for designers and media buyers.
"The result is a major operational shift: the creative team opens a custom dashboard every Monday morning and immediately finds a prioritized list of ad briefs adapted to their exact brand voice and visual style, based on what competitors ran successfully the previous week. Intelligence that used to take a full-time analyst is delivered in under 30 minutes of compute time."
The Problem We Were Solving
Performance marketing teams fight a constant creative arms race. Winning on paid social requires iterating fast: spotting a competitor's hook mechanic, adapting it to your brand, and launching it before market fatigue sets in. But doing this manually is slow and error-prone.
What the Client Did Before
- A marketing analyst manually checked the Meta Ad Library 2–3 times per week for each competitor brand.
- Screenshots were saved to a shared folder, and notes were scattered across Google Docs.
- A separate strategist reviewed the notes to decide which ideas to develop.
- A copywriter wrote the brief—often 7-10 days after the competitor's ad first appeared.
- Video ads were largely ignored because transcribing and analyzing them was too time-consuming.
Speed Bottlenecks
By the time a competitor's creative pattern was identified and actioned, it was already in creative fatigue. The window to capitalize is narrow.
Incomplete Coverage
Human reviewers missed ads. The Meta Ad Library shows hundreds of active creatives across multiple competitors, making manual coverage impossible.
Shallow Analysis
Manual review produced surface-level notes ('hook: before/after'). It couldn't quantify trend frequency, predict CTR, or cross-reference trends.
Video Blindspot
Video ads (which often outperform static images) were skipped entirely because transcription and visual frame parsing were too expensive manually.
The Solution: AI Ad Generation System
We designed and built a fully autonomous AI agent following the DOE Framework (Directives, Operations, and Evaluations). The agent runs on a weekly schedule, processing competitor ads end-to-end to surface only what matters.
LLM Reasoning
Six carefully engineered system prompts govern how the language model reasons at each stage. Includes strict JSON schema constraints so outputs are validated before moving downstream.
- Creative & Video analysis
- Pattern & Trend detection
- Performance prediction
Async Pipeline
Thirteen async Python functions form the backbone of the pipeline. Each operation has a single responsibility, returns structured JSON, and can be toggled via config flags.
- Parallel media downloads
- Concurrent pattern detection
- Asyncio.gather processing
Quality Gates
Three automated validators run after every LLM step to check analysis coverage, pattern confidence scores, and brief quality. Low-quality outputs are flagged and excluded.
- Coverage verification
- Confidence score filter
- Brief quality validation
How It Works: Step by Step
Every scheduled execution runs an end-to-end pipeline. The system features a persistent memory store, deduplicating assets across runs by media URL to keep API costs minimal and performance high.
Scrape Meta Ad Library
Headless Chromium running via Playwright scrapes live competitor ads—capturing ad copy text, media URLs, CTA actions, and run durations (up to 50 ads per competitor brand).
Collect & Classify Assets
Deduplicate ads by media URL to save API budget. Separate image vs. video creatives and cache assets locally to avoid redundant network overhead.
Media Processing
Download image assets and video clips concurrently. Extract video audio streams via FFmpeg and transcribe vocal dialogue with OpenAI Whisper.
AI Creative Analysis
GPT-4o Vision processes static images and video keyframes alongside transcripts to identify hook type, emotional tone, CTA placement, and design quality.
Pattern Detection
LLM clusters ads into recurring creative archetypes (e.g. 'pain-point opener', 'UGC testimonial', 'before/after') and calculates frequency metrics.
Messaging Trend Analysis
Analyze narrative framing shifts across the entire ad corpus over a rolling timeframe, checking which marketing angles are gaining or losing share of voice.
Performance Prediction
A heuristic scoring model predicts CTR probability, scroll-stop power, and creative fatigue risk, categorizing ads into Elite, Strong, Average, or Weak tiers.
Adaptation Brief Generation
For every Elite or Strong ad, the brief engine automatically rewrites the proven competitor hook and framework into the client's brand voice, visual guidelines, and product context.
Export & Strategy Report
Output structured database records to a shared Google Sheet via idempotent batch writes, and write a summary strategy JSON report with weekly creative priorities.
Parallelism for Speed: By executing downloads, vision analysis, pattern/trend detection,
and exporting concurrently using asyncio.gather, we bypass sequential queue bottlenecks. A
standard weekly run processing 100+ creative variants completes in 20 to 30 minutes
instead of several hours.
Technology Stack
We constructed the pipeline with a robust, enterprise-grade open-source stack that runs entirely on your own cloud infrastructure—eliminating recurring SaaS seat fees.
Key Features & Capabilities
The system delivers senior-level strategic creative direction at scale, resolving several long-standing marketing analysis limitations.
Full-Funnel Creative Analysis
While basic tools only scrape copy, our system digests video completely. It extracts audio with Whisper, visual frames via GPT-4o Vision, and evaluates pacing, emotional tone, and CTA quality.
Compounding Pattern Detection
Instead of analyzing ads in isolation, the database tracks how the frequency of ad styles changes over rolling 12-week windows, warning you when competitor formats show fatigue.
Performance Triage
Every ad is rated for CTR potential, scroll-stop power, and fatigue risk. Only "Elite" and "Strong" creatives trigger adaptation brief generation, focusing creative resources on high-probability concepts.
Ready-to-Brief Ad Adaptations
Converts competitor mechanics into design-ready briefs. Includes rewritten hooks, typography directions, visual styling constraints, CTA suggestions, and production checklists.
Deduplicating Memory Store
Features a JSON-backed MemoryStore. Tracks previously scraped media URLs to avoid analyzing identical creative variations, saving substantial API execution costs.
Secure Admin Dashboard
A secure internal dashboard protected by JWT token authentication and HTTP-only cookies, allowing team members to execute manual runs and browse visual brief history.
Problems Solved for Our Customers
Our AI system converts structural marketing bottlenecks into streamlined automated operational workflows.
Losing the Creative Iteration Race
Solution: Spot and replicate competitor hooks in real time. The agent closes the loop between competitor execution and your designer briefs to under 24 hours.
Teams Drowning in Manual Research
Solution: Eliminates screenshotting, copy-pasting, and doc sorting. The system handles raw research autonomously, freeing staff to make high-level decisions.
Video Creative is a Blindspot
Solution: Audio extraction combined with frame-by-frame LLM vision parsing translates video assets into structural briefs just as easily as static images.
Uncertainty on Which Competitor Ads Actually Work
Solution: Heuristic prediction score filters out low-performing ad tests, focusing your design resources purely on proven hook archetypes.
Brief Writing Takes Days
Solution: The brief writing engine automatically populates copy angles, production checklists, and brand parameters, allowing copywriters to refine rather than write from scratch.
No Institutional Trend Memory
Solution: 12-week rolling historical database compiles market share-of-voice trends, highlighting when competitor creative concepts begin to saturate.
How We Implement It
Onboarding a brand onto the Creative Intelligence Agent is a fast, 3-step process that completes in under 5 business days.
Configuration & Rules
- Compile competitor brand lists and Meta Ad Library search parameters.
- Ingest your brand guidelines: tone of voice, visual styling parameters, and fonts.
- Provide historically high-performing briefs to align output styling.
- Establish secure credentials and link Google Sheets workspaces.
First Validation Run
- Trigger first pipeline executions on active competitor campaigns.
- Collect and review initial batch of briefs with the brand's creative lead.
- Adjust brand adaptation prompts and response guidelines.
- Verify visual quality and Google Sheet formatting rules.
Schedule & Handover
- Schedule automatic execution runs (typically weekly on Sunday nights).
- Establish admin access and review dashboard layouts.
- Provide full code walkthroughs and engineering documentation.
- Initialize 30-day technical support window.
Technical Highlights & Design Decisions
A deep dive into our core architectural decisions that optimize cost, speed, and accuracy.
Who This Is For
We constructed the system for scaling brands seeking to institutionalize competitive intelligence and creative output velocity.
Ideal System Fit
- Meta Ad Spend $50K+ Monthly: Creative variations represent your primary conversion multiplier.
- 2+ Active Competitors: Competitors regularly update campaigns on Facebook/Instagram.
- Creative Output 10+ Ads/Mo: Your design team requires structural briefs to scale creation.
- Seeking Institutional Asset Base: You want a persistent trend database rather than manual reviews.
Might Not Be a Fit
- Niche/Low Ad Spend: Ad volumes are low, and creative iteration speed is not a priority.
- Fewer Than 2 Main Competitors: Very little competitor activity to monitor.
- Restricted/Niche Industries: Niche categories where Meta Ad Library coverage is restricted or delayed.
- No Internal Design Team: No setup to digest automated briefs and build design assets.
Ready to Automate Your Ad Briefs?
We build tailored Creative Intelligence systems on your own cloud infrastructure—giving you complete code ownership with no recurring SaaS fees or seat licenses. Get in touch to schedule a demo.
Start Your Project Today