AdReverse AI
Autonomous competitor ad reverse-engineering and UGC counter-campaign synthesis studio.
introduction
AdReverse AI is an end-to-end competitive intelligence and counter-advertising engine built during the ITFest Adobe 12-hour Hackathon. Designed for performance marketers and direct-to-consumer (DTC) brands, it automates the traditional weeks-long creative audit into an autonomous, real-time pipeline that deconstructs competitor scaling strategies and generates production-ready counter-campaigns in seconds.
Instead of static spreadsheets, the system crawls live competitor creatives across Meta and TikTok, pinpoints their underlying psychological mechanisms and offer weaknesses, and synthesizes high-converting counter-ads complete with frame-by-frame UGC creator scripts.
architecture & monorepo structure
AdReverse is built as a contract-first monorepo, enforcing strict type safety across both frontend and backend layers via a centralized contracts package in /shared.
By maintaining strict camelCase properties in all Pydantic schemas and TypeScript models, JSON payloads serialize seamlessly between Next.js client components and FastAPI endpoints without manual field translation.
adreverse/
├── shared/ # Single source of truth: TypeScript data contracts & mock fixtures
│ └── types.ts # CamelCase interfaces shared across Next.js and FastAPI
├── back/ # Asynchronous Python FastAPI backend
│ ├── app/
│ │ ├── routers/ # REST endpoints (brand, discovery, ads, campaign)
│ │ ├── schemas/ # Pydantic V2 domain models with CamelModel aliases
│ │ └── services/ # AI inference, LangChain orchestrator, Supabase persistence
│ └── main.py # FastAPI entrypoint
└── front/ # Next.js 16 App Router frontend
└── src/
├── app/ # App Router pages (/ and /dashboard) & Clerk auth
└── components/ # 4-Step workflow modules (Onboarding, Radar, Analysis, Studio)the ai pipeline: from live crawl to synthesis
The core of AdReverse is a reactive, multi-stage AI workflow engineered for low-latency market analysis and high-fidelity creative synthesis. The architecture links live web scraping with parallelized LLM reasoning across four distinct phases:
- —1. Real-time Ingestion (Jina Reader & Tavily API): When a brand domain is onboarded, Jina Reader (https://r.jina.ai/) strips boilerplate HTML to extract clean markdown, while Tavily Search API runs targeted search queries across live Meta Ad Library and SERP records.
- —2. Competitor Radar & Market Discovery: Tavily web context is fed into LangChain's structured output model (Pydantic V2), identifying top rivals, market share tiers (dominant, challenger, niche), active channels, and opportunity gaps.
- —3. Concurrent Ad Deconstruction (asyncio.gather): Active competitor creatives are scraped and processed simultaneously across asynchronous worker pools, deconstructing hooks, emotional triggers, and vulnerability gaps in parallel.
- —4. Multi-Angle Counter-Campaign Synthesis: Once vulnerabilities are extracted, concurrent LLM workers synthesize three distinct counter-campaign angles (Direct Comparison, Problem Agitation, Social Proof) alongside frame-by-frame UGC storyboards in under 3.5 seconds.
competitor radar & market discovery
The discovery engine continuously scans the target vertical. It retrieves active competitors, quantifies their market share tier, and computes an Estimated Reach Score (0–100%) alongside active media channels across Meta, Instagram, and TikTok.
The platform analyzes cross-channel competitor saturation to uncover blind spots and opportunity gaps before generating ad counter-attacks.
concurrent ad scraping & reverse-engineering
Rather than evaluating ads sequentially, the Ad Breakdown engine uses Python's asyncio.gather to dispatch independent extraction tasks for every creative unit in parallel. Each ad is dissected through a rigorous performance marketing lens:
- —3-Second Hook Extraction: Identifies whether the opening leverages a bold statement, pattern interrupt, or problem agitation.
- —Psychological Mechanism: Analyzes how the competitor promises resolution (e.g. proprietary formulations, speed, convenience).
- —Offer Structure: Parses pricing, bundle incentives, guarantees, or hidden fees.
- —Vulnerability Gap Mining: Exposes strategic flaws (such as unverified claims, subscription lock-ins, or premium markups) ready for targeted counter-messaging.
# Parallel ad deconstruction in back/app/services/ads_service.py
async def _deconstruct_ad(ad: CompetitorAd) -> AdAnalysisResult:
prompt = f"""Deconstruct competitor ad for {competitor_name}:
Headline: {ad.headline}
Copy: {ad.ad_copy}
Platform: {ad.platform}
Extract: hook, hookType, painPoint, mechanism, offerStructure, vulnerabilityGap, effectivenessScore."""
res = await llm.ainvoke(prompt)
breakdown = AdBreakdown.model_validate(json.loads(extract_json(res)))
return AdAnalysisResult(ad=ad, breakdown=breakdown, analysed_at=now_iso)
# Dispatch all creatives concurrently
tasks = [_deconstruct_ad(ad) for ad in ads_to_analyse]
analyses: List[AdAnalysisResult] = await asyncio.gather(*tasks)multi-angle campaign synthesis & ugc storyboards
Once competitor vulnerabilities are identified, the Campaign Studio synthesizes counter-strategies across three distinct psychological angles concurrently: Direct Comparison, Problem Agitation, and Social Proof.
Running angle generation concurrently dropped full campaign synthesis latency from 90+ seconds down to under 3.5 seconds.
# back/app/services/campaign_service.py
tasks = [
_generate_angle_campaign(angle)
for angle in ["direct_comparison", "problem_agitation", "social_proof_reviews"]
]
results = await asyncio.gather(*tasks, return_exceptions=True)
for campaign, strategy in results:
generated_campaigns.append(campaign)
adaptation_strategies.append(strategy)fault-tolerant tiered inference pipeline
To guarantee reliability and eliminate downtime during intense hackathon demos or production spikes, AdReverse employs a multi-tier fallback pipeline with LangChain. Requests route first to ultra-low latency Groq models and automatically cascade to Google Gemini if rate limits occur.
Primary inference runs on Groq in ~0.3s, cascading down to secondary models and Google Gemini without throwing 500 errors to the client.
# back/app/services/ai_service.py
def get_llm():
primary = ChatGroq(
model="openai/gpt-oss-20b",
api_key=settings.GROQ_API_KEY.strip(),
temperature=0.2,
timeout=15,
)
fallback_models = [
ChatGroq(model="openai/gpt-oss-120b", timeout=15),
ChatGroq(model="qwen/qwen3.8-27b", timeout=15),
ChatGoogleGenerativeAI(model="gemini-3.5-flash-lite", timeout=15),
ChatGoogleGenerativeAI(model="gemini-3.8-flash", timeout=15),
]
return primary.with_fallbacks(fallback_models)frame-by-frame ugc storyboard engine
The final deliverable bridges AI strategy with real-world production. For every campaign angle, the studio generates an actionable UGC storyboard formatted specifically for TikTok and 9:16 Instagram Reels.
Includes precise time-stamps, visual directions, audio scripts, and transition cues, enabling creators to film counter-ads immediately without additional scriptwriting.
// Frame-by-frame storyboard structure from /shared/types.ts
export interface UgcStoryboardFrame {
second: number; // e.g. 0, 3, 7, 15
visualFrame: string; // Creator action, split-screen comparison, b-roll
audioScript: string; // Spoken voiceover or direct-to-camera hook
textOverlay?: string; // Punchy on-screen caption hook
transitionNote?: string; // Quick cut, zoom punch-in, match cut
}tech stack
- —Frontend: Next.js 16 (App Router), Turbopack, React 19, Tailwind CSS, Radix UI Primitives, Lucide Icons.
- —Backend: FastAPI (Python 3.12, fully async), Pydantic V2 with CamelModel serialization.
- —AI & Orchestration: Groq (ultra-low latency inference), LangChain with multi-cloud fallbacks (Google Gemini), Tavily Search API, Jina Reader.
- —Database & Auth: Supabase (PostgreSQL with JSONB caching <50ms), Clerk Authentication (Multi-brand vaults & user isolation).
conclusion
Built under the pressure of a 12-hour hackathon at ITFest Adobe, AdReverse AI proves how autonomous multi-agent pipelines and contract-first architecture can democratize competitive intelligence. By bridging raw web crawling, psychological hook deconstruction, and instant creative synthesis, it gives brands an unfair advantage in performance marketing.