AdsPilot AI — Build an AI That Runs Your Ads
Blueprint for Viber teams — AI creates, tests, and optimizes ads across 6 platforms with 9 AI Agents + Thompson Sampling. Starting at $28/month.

From Ad Creation to Optimization — One AI System Does It All
A full blueprint for building an AI-powered ad management platform. Read this, and you'll understand the entire vision — from architecture to pricing.
Last updated: 2026-03-21
What's actually wrong with how businesses run ads today?
Here's the reality: businesses pay ad agencies $550 to $2,800+ per month, and they still end up staring at confusing reports themselves. They don't know which ads are working, which ones to kill, and where the budget is leaking. AdsPilot AI fixes all of that.
Quick Summary
- AdsPilot AI is a 6-layer automated ad management system — from content creation to budget optimization
- 9 AI agents act as the system's brain, working alongside an AUTOPILOT engine
- Built in 6 phases over 30 days, with clear pricing plans for every business size
- Designed for businesses that want to cut ad costs without cutting performance
Sam — SME Owner
No time to monitor ads, agencies are expensive, no idea where the money goes
Maya — Marketing Manager
Can't keep up with multiple platforms, manual optimization wastes time and leads to mistakes
Alex — E-commerce Owner
ROAS keeps fluctuating, doesn't know how to adjust ads, reports make no sense
The ad budget that leaks every month adds up to tens of thousands a year — AI can fix that starting at $28/month.
What exactly is AdsPilot AI?
An AI system that creates, tests, and optimizes ads automatically — end to end, in one place. No agency fees. No manual optimization. The AI handles everything from writing ad copy to reallocating budget across platforms.
AI Ads Analyst
Analyzes ad performance across every platform in real-time, with alerts when something's off
AI Creative Generator
Writes ad copy automatically — 6 headline styles, localized for your market
AUTOPILOT
Creates and tests 100+ variations using Thompson Sampling — the heart of the system
Multi-Platform
Google, Meta, TikTok, LINE, Shopee, Lazada — every platform in a single dashboard
Multi-AI
Claude, GPT-4o, Gemini via OpenRouter + Direct API — picks the best model for each task
Market-Aware
Built with local market context from day one — not a generic tool with a translation layer
What makes it different from everything else?
MARKET-AWARE
TRUE AI (MAB)
END-TO-END
6 PLATFORMS
FROM $28/MO
How does the 6-layer architecture actually work?
The system is split into 6 layers, each with a clear job. Understand this, and you'll see the full picture.
🌐 Presentation Layer
Next.js 15 (App Router) + PWA + Slack Bot + LINE Bot | TailwindCSS + Shadcn/UI + Recharts + Zustand
🚪 API Gateway Layer
Go + Fiber v3 | JWT Auth | Rate Limiting | CORS | RESTful API v1 | Unified Response
📦 Application Layer
Campaign | Analytics | User | Billing | Notification | Report | CQRS-Lite + Repository Pattern + SQLC
🤖 AI Orchestration Layer
Temporal Workflows | 9 AI Agents | AUTOPILOT Engine (Picasso + Darwin + Sherlock) | LLM Router
🔌 Connector Layer
Google Ads | Meta | TikTok | LINE | Shopee | Lazada | GA4 | Circuit Breaker + OAuth2 Token Management
🗄️ Data Layer
PostgreSQL 16 (Core) | TimescaleDB (Metrics) | Redis Stack 7 (Cache) | Qdrant (Vector) | NATS JetStream (Events)
6 layers, each with a clear responsibility — a team member can own one layer without needing to understand the whole system.
See the full tech stack (complete table)
| Layer | Technology | Why This Choice |
|---|---|---|
| Monorepo | Turborepo + pnpm | Fast builds, shared packages |
| Frontend | Next.js 15 (App Router) | SSR, RSC, TypedRoutes |
| Styling | TailwindCSS + Shadcn/UI | Utility-first, accessible |
| State | Zustand + TanStack Query | Lightweight + server cache |
| Backend | Go 1.22 + Fiber v3 | High performance, type safety |
| DB Access | SQLC | Type-safe SQL to Go code gen |
| Auth | JWT (HS256) + bcrypt(12) | Stateless, secure |
| Core DB | PostgreSQL 16 | ACID, JSONB, extensions |
| Metrics DB | TimescaleDB | Time-series optimization |
| Cache | Redis Stack 7 | Session, rate limit, pub/sub |
| Vector DB | Qdrant | Semantic search for creatives |
| Queue | NATS JetStream | Lightweight, at-least-once |
| Workflow | Temporal | Durable async workflows |
| AI Router | OpenRouter + Anthropic | Multi-model, cost optimization |
| Container | Docker + k3s | Lightweight Kubernetes |
| CDN/WAF | Cloudflare (Free) | DDoS, SSL, caching |
| CI/CD | GitHub Actions | Automated pipeline |
How do the 9 AI agents work as the system's brain?
Nine AI agents work together, each using the AI model that's best for its job. Commander is the team lead — it takes your request, breaks it into tasks, and assigns them to other agents running in parallel.
Commander
Analyst
Creative
Audience
Budget
Forecast
Competitor
Reporter
Scout
How does AUTOPILOT work as the core engine?
This is the feature that makes AdsPilot different from every other tool. It creates 100 ad variations, tests them, and optimizes automatically using Thompson Sampling — not simple rule-based logic.
🎨 GENERATE
🚀 DEPLOY
📚 LEARN
⚡ OPTIMIZE
📊 REPORT
Thompson Sampling — simpler than it sounds
Think of it like 100 slot machines (= 100 ads). You need to figure out which ones pay best. Thompson Sampling does that by:
Winners get more budget. Losers get cut. All automatic — no manual optimization needed.
Safety constraints — so the AI can't blow your budget
The AI makes decisions on its own, but safety rails prevent disasters — big budget swings need human approval, and it can't shut everything off at once.
See the score calculation + decision tiers
Score = (ROAS/10 x 0.4) + (CVR/0.2 x 0.3) + (CTR/0.1 x 0.2) + (Confidence x 0.1)
🟢 SCALE UP ≥80th percentile → increase budget +20-50%
🔵 MAINTAIN 40-80th percentile → keep testing
🟡 SCALE DOWN 20-40th percentile → reduce budget -20-30%
🔴 PAUSE <20th percentile → stop this ad
See the data flow — how information moves through the system (4 main flows)
Flow 1: Ad Data Sync (every 1-6 hours)
⏰ Scheduler
📨 NATS
⚙️ Worker
🌐 APIs
🗄️ DB
Flow 2: User Requests Analysis
👤 User
🚪 API
🎖️ Commander
📊+✍️+💰 Parallel
📋 Result
Flow 3: Authentication
📝 Register
🔒 bcrypt 12
🎫 JWT 15m
🔄 Refresh 7d
Flow 4: AUTOPILOT End-to-End
🎨 Generate
🚀 Deploy
📚 Learn
⚡ Optimize
📊 Report
See security and compliance (5 layers)
Layer 1 Edge: Cloudflare DDoS + WAF + Bot Filter + Geo Block
Layer 2 Transport: TLS 1.2+ Full Strict + HSTS + Let's Encrypt
Layer 3 Application: JWT HS256 (15min) + bcrypt 12 + Rate Limiting + RBAC (Owner/Admin/Member/Viewer)
Layer 4 Data: AES-256-GCM (OAuth tokens) + Input Sanitization + GDPR/PDPA Compliance
Layer 5 AI Safety: Confidence thresholds (≥90% OK, 70-90% Warn, <70% Block) + Budget limits + Human-in-the-Loop
What does the 6-phase, 30-day development plan look like?
The entire project is split into 6 phases. Phase 1 is 95% done — the rest is waiting for the team to jump in.
✅ Phase 1: Foundation
Monorepo + Docker + Next.js + Go API + DB Schema + SQLC + Auth (JWT + bcrypt)
Phase 2: Core Backend
Platform Connectors (Google, Meta, TikTok) + Data Ingestion + Campaign Service + Analytics
Phase 3: AI Agents
LLM Router + Agent Framework + 9 Core Agents — the AI can analyze and generate content
Phase 4: Autopilot
Creative Generator (Picasso) + Thompson Sampling (Darwin) + Autopilot Workflow
Phase 5: Frontend
Design System + Dashboard + Campaign UI + Autopilot UI + Settings
Phase 6: Polish
Testing (Unit + E2E) + Security Audit + Monitoring (Prometheus + Grafana) + Deploy
What kind of help does the project need?
If you're interested, pick the task that matches your skills — there are 3 priority levels to choose from.
| Priority | Task | Skills Needed | Phase |
|---|---|---|---|
| 🔴 High | Platform Connectors (Google, Meta, TikTok) | Go + OAuth2 + REST APIs | 2 |
| 🔴 High | Data Ingestion Pipeline | Go + NATS + TimescaleDB | 2 |
| 🔴 High | LLM Router + Agent Framework | Go + AI APIs + Temporal | 3 |
| 🟡 Medium | Dashboard UI | Next.js + Recharts + TanStack Query | 5 |
| 🟡 Medium | Campaign Management UI | Next.js + Shadcn/UI | 5 |
| 🟡 Medium | AUTOPILOT UI + Wizard | Next.js + Complex Forms | 5 |
| 🟢 Normal | Thompson Sampling Engine | Go + Statistics + MAB | 4 |
| 🟢 Normal | Testing (Unit + E2E) | Go Test + Playwright + k6 | 6 |
| 🟢 Normal | Monitoring Setup | Prometheus + Grafana + Loki | 6 |
How do you actually get started building?
Type these prompts in Cursor AI — the AI sets everything up for you. No manual terminal work needed.
01Clone repo + Install
02Start Infrastructure (Docker)
03Setup Environment + Run Migrations
04Start API + Frontend
API: http://localhost:8080/health | Frontend: http://localhost:3000
See the actual commands (if you prefer typing them yourself)
git clone <repo-url> && cd adspilot && pnpm install
docker-compose -f infra/docker/docker-compose.yaml up -d
cp .env.example .env
docker exec -i adspilot-postgres psql -U adspilot -d adspilot < packages/db/migrations/001_init.up.sql
cd apps/api && go run ./cmd/server/
cd apps/web && pnpm dev
See the full project structure
adspilot/
├── apps/
│ ├── web/ # Next.js 15 Frontend
│ └── api/ # Go Backend API
├── services/
│ ├── agents/ # AI Agent Service (9 agents + LLM Router)
│ ├── autopilot/ # AUTOPILOT Engine (Picasso + Darwin + Sherlock)
│ ├── connectors/ # Platform Connectors (Google, Meta, TikTok...)
│ └── worker/ # Background Workers (Sync, Scheduler)
├── packages/
│ ├── db/ # Migrations + SQLC queries + Schema
│ └── shared/ # Shared utilities
└── infra/ # Docker + Kubernetes
See the full database schema (11 tables)
PostgreSQL 16 (Core): organizations, users, ad_accounts, campaigns, ad_sets, ads, autopilot_sessions, autopilot_variations, autopilot_decisions, agent_tasks, reports
TimescaleDB (Metrics): ad_metrics (hypertable, 1-day chunks, compress after 7 days, retain 2 years) + continuous aggregates: hourly + daily
Key Fields: Every table has UUID PK + org_id FK + created_at/updated_at | autopilot_variations has alpha/beta for Thompson Sampling + ctr/cvr/roas/score
See all API endpoints
Auth: POST /auth/register, /auth/login, /auth/refresh, /auth/logout
Campaigns: GET /campaigns, GET /campaigns/:id, PATCH /campaigns/:id/status, POST /campaigns/bulk-status, GET /campaigns/:id/ads
Analytics: GET /analytics/dashboard, /analytics/timeseries, /analytics/top-campaigns, /analytics/platforms
AUTOPILOT: GET+POST /autopilot/sessions, GET /sessions/:id, POST /sessions/:id/launch, GET /sessions/:id/variations, GET /sessions/:id/decisions
AI Agents: POST /agents/chat, GET /agents/tasks, GET /agents/tasks/:id
Settings: GET+PATCH /settings/profile, GET /settings/connections, POST /settings/connections/:platform/oauth, GET /settings/organization
Last section — Pricing
Starting at $28/month vs $550+ for agencies — affordable for any business size.
What do the pricing plans look like?
Starter
1 Ad Account
Analyst only
AUTOPILOT ❌
Growth
3 Ad Accounts
3 Agents
AUTOPILOT Manual
Pro ⭐
10 Ad Accounts
All 9 Agents
AUTOPILOT Full Auto
Enterprise
Unlimited
All Agents
Custom AUTOPILOT
AI is about to change how every business runs ads — the only question is whether you'll build the tool or pay someone else to use one.
Want to help build this?
Check the Issues on GitHub — there are good-first-issue labels for newcomers
Read the Docs in Docs/ — every phase has detailed specifications
Send a PR — every contribution is welcome
Related Articles

Server Disk Full — Git Worktree Cuts 90% Instantly
Stop cloning repos for every team member. Git Worktree shares one codebase — disk dropped from 7.7 GB to 0.8 GB. Add new members in 5 seconds, zero extra disk.
Cursor Guide — Tell AI to Build, No Code
A complete Cursor IDE guide covering 9 categories and 38 topics — from basics to advanced. Packed with ready-to-use prompt examples. Written for executives and business owners who aren't developers.

Cursor for Vibe Coding Teams — Command AI, Skip Code
A complete guide to using Cursor for team collaboration on a shared Dev Server — set up AI, manage Secrets, Git Workflow, and prevent Conflicts, all through plain-language prompts without writing code yourself