AI · Marketing Technology
·Live in productionAdley: an AI agent that thinks like a CMO.
Adley optimizes paid search and social campaigns across Google, Meta, Bing, TikTok, and LinkedIn using actual customer lifetime value, not just clicks.
Ad platforms
5
Optimization signal
LTV
Stop-loss latency
< 1h
Stack
AWS-native
The challenge
Almost every paid search tool on the market optimizes for clicks or conversions. The problem is that clicks and conversions are not what subscription businesses get paid for. They get paid for customers who stick around. A campaign that delivers a $30 conversion that churns in two weeks is worse than a campaign that delivers a $60 conversion that pays for two years.
Most agencies cannot solve this because they do not have access to the customer's database. They optimize on what the ad platform shows them: CTR, CPC, conversion rate. The downstream signal, who actually stayed and paid, is invisible from the ads dashboard.
The other half of the problem is cross-platform comparability. Google attributes everything to Google. Meta attributes everything to Meta. The numbers do not add up because each platform is grading its own homework. A real LTV-aware optimizer needs a single source of truth that all five platforms feed into.
The solution
Adley is a closed-loop attribution and optimization layer that sits between the ad platforms and the company's database. Every click on every platform writes to a shared session record. The session links to a lead, the lead to a customer, the customer to a subscription, and the subscription to a billing history. Adley owns the join.
On top of that data layer sits an AI agent. The agent uses Claude to read campaign performance, draft new ad variants from real customer review language, and propose budget shifts. The proposals are not guesses. They are grounded in the LTV data Adley already owns, which means the agent can reason about which audiences are worth spending more on and which are not.
The system runs continuously. BullMQ jobs poll the platforms, reconcile new conversions against the customer database, and queue optimization actions. Stop-loss rules fire automatically when a campaign trips a configurable spend threshold without converting. That last piece is the single most important guardrail in the system, because it turns every campaign into a safe experiment instead of an open-ended commitment.
What we built
The architecture has four moving pieces. A closed-loop attribution ingest layer that normalizes click data from Google Ads API, Meta Marketing API, Microsoft Advertising, TikTok Marketing API, and LinkedIn Marketing API. A customer LTV pipeline that joins the click data against subscription and billing events to produce per-customer-per-cohort lifetime values. An AI Copy Lab that pulls the company's actual customer reviews and asks Claude to write ad variants in the customer's voice, not in agency-speak. And a stop-loss and budget reallocation engine that takes proposals from the AI and either applies them automatically (within configurable guardrails) or surfaces them for human approval.
All of it runs on AWS ECS Fargate, with PostgreSQL for the attribution store, Redis-backed BullMQ for the job queues, and S3 for ad creative storage. The admin portal is a Next.js app where operators configure platforms, set guardrails, review AI proposals, and watch the LTV signal in real time.
Hard problems we had to solve
Five ad platforms have five different attribution models, five different conversion APIs, and five different rate limits. We built per-platform service modules with their own retry, backoff, and reconciliation logic. The unified abstraction at the top is what lets the AI agent reason cross-platform without knowing which API it is talking to.
The LTV signal arrives late by definition. A 90-day LTV is, well, 90 days late. The pipeline has to handle backfill correctly so that a customer who churns in month four updates the cohort attribution for month one. We solved this with append-only event tables and recalculated cohort views, which lets us travel back in time without losing audit trail.
AI-generated copy can hallucinate compliance landmines. So the AI Copy Lab has a pre-publish review step that checks for claims the company has not made, statistics the company has not published, and language patterns the legal team has flagged. Copy that fails review never reaches the platforms.
The result
Adley is live, optimizing real campaigns on real budgets across all five platforms. The closed loop produces an LTV signal the ad platforms can act on through value-based bidding APIs, which means Google and Meta progressively get smarter about which audiences to surface. The AI Copy Lab produces ad variants faster than a human team could, with the company's brand voice intact. Stop-loss has prevented multiple campaigns from overspending their daily budget on traffic that was not going to convert.
The technical proof point is that the system has been shipping continuously without rollback. New ad platforms get added. New guardrails get configured. The AI prompts get tuned. Through all of it, the underlying attribution data has stayed clean, which is the part that matters most. Once the data goes wrong, every downstream optimization is wrong. Once it stays right, every downstream optimization compounds.
Why this case matters
Adley is a proof point for the larger thesis: AI is not a feature, it is a layer. The interesting work was not the AI part. The interesting work was the data plumbing that made the AI useful. Anyone can call Claude. Almost no one builds the closed-loop attribution that lets Claude reason about real money.
That is the kind of work we look for. Not "add a chatbot." Not "ship a hackathon prototype." Real systems that connect AI to real business outcomes, built by senior engineers, deployed on AWS, shipped in weeks.
More work
More from the field.
Want one of these for your business?
Tell us what you would optimize.
If you have an ads budget and a database, you have everything you need for closed-loop attribution. We will build the layer that connects them.

