An AI-powered platform that generates hyper-personalized advertising campaigns for X (formerly Twitter) using xAI's Grok. Transform a company name and product description into laser-focused audience segments, X-ready ad creatives, and 1:1 personalized campaigns tailored to individual users.
XAI helps companies create targeted advertising campaigns by:
-
Demographic Segmentation: Analyzes your product and generates 3-4 diverse, relevant audience demographics with detailed targeting parameters (age range, gender, geolocation)
-
Ad Creative Generation: Creates X-ready ad creatives for each demographic segment, including:
- Custom tweet text with hashtags
- AI-generated images using Grok Imagine
- Product context summaries
-
1:1 Personalization: Generates personalized ads for specific X users by:
- Fetching their X profile information and activity
- Analyzing their interests and engagement patterns
- Creating tailored ad copy and visuals
-
Campaign Management: Provides a streamlined workflow to:
- Input company information and campaign goals
- Select target demographics
- Preview and launch personalized campaigns
The application follows a Client-Side Rendering (CSR) architecture with server-side API routes:
- Frontend: Next.js 16 with React 19, TypeScript, and Tailwind CSS
- State Management: Zustand for client-side state with localStorage persistence
- UI Components: Radix UI primitives with custom styling
- Animations: Framer Motion for smooth transitions
-
get_ads.ts: Generates demographic-based ad campaigns- Uses Grok-4-1-fast-non-reasoning model for demographic analysis
- Generates images via Grok Imagine API
- Returns structured ad data with Zod schema validation
-
get_x_personalized_ads.ts: Creates personalized ads for specific X users- Fetches X user profile and activity via X API SDK
- Analyzes user's tweets, likes, and engagement patterns
- Generates personalized ad copy and visuals
-
system_prompts.ts: Contains AI prompts for:- Demographic segmentation
- Personalized ad generation
Multi-step wizard flow:
- Company Name (
/studio/company/name): Input company information - Company Description (
/studio/company/description): Product details - Campaign Goal (
/studio/company/goal): Campaign objectives - Segments (
/studio/segments): Select target demographics - Ads Preview (
/studio/ads): Review generated ad creatives - Personalization (
/studio/personalization): Generate 1:1 personalized ads
- Start the application (development or production)
- Navigate to the landing page and click "Get Started"
- Enter company information:
- Company name
- Product description
- Campaign goal
- Select target demographics from generated segments
- Review generated ad creatives with images and copy
- Generate personalized ads by entering an X handle
- Launch campaigns when ready
- Framework: Next.js 16 (App Router)
- Language: TypeScript
- UI Library: React 19
- Styling: Tailwind CSS 4
- State Management: Zustand
- Animations: Framer Motion
- UI Components: Radix UI
- AI SDK: Vercel AI SDK
- LLM: xAI Grok
- Image Generation: Grok Imagine
- X API: @xdevplatform/xdk
- Validation: Zod
- Runtime: Bun / Node.js