Flywheel β€” self-improving ads

πŸ’‘ Inspiration

Every hackathon has a hundred "agents" that do one thing, once. We wanted to build the opposite: a loop β€” an agent that plans, acts, observes the real world, and corrects itself, over and over, against feedback it cannot fake.

The spark was a gap we noticed in ad tooling. Tools like Adbox can generate a beautiful ad campaign in two minutes β€” but then they stop. They render and walk away. Nobody closes the loop: did real users actually respond to the new ad? And if they didn't, does the ad rewrite itself?

So we set out to build ads that improve themselves β€” an agent that watches how users respond to each ad, keeps the winners, and regenerates the ones users ignore (the copy, the image, the video), then ships the champion to every ad platform. Adbox's creative factory becomes the hands; our loop becomes the brain; and the two hackathon sponsors we cared most about β€” Zero and Nexla β€” become the engines underneath.

🎯 What it does

A single agent loop runs a population of ads through a repeating cycle: plan β†’ act β†’ observe β†’ correct, forever.

  • Observe β€” user response arrives as a governed Nexla Nexset (schema-enforced, validated, lineage-tracked). The loop trusts only that data.
  • Correct β€” it diagnoses each ad. Underperformance has two causes with two different fixes: "bid too low" β†’ spend more; "the creative doesn't resonate" β†’ make a new one.
  • Act β€” for a creative problem, the agent runs Adbox's decide β†’ render pipeline, powered entirely by Zero: it discovers and pays (x402, no keys) for an LLM to draft concepts, an image model to render the winner, and a video model to animate it.
  • Ship β€” when an ad wins with real users, Nexla publishes it to Shopify, Google Merchant, and Meta Catalog as a governed pipeline.

Every money-spend passes a Pomerium gate. And the whole thing is visible on a dark, Adbox-style dashboard β€” the four steps pulse, the ads evolve, a cost ledger ticks up, and the winning ad plays as a freshly generated video.

πŸ› οΈ How we built it

The engine (loopkit). A tiny, domain-agnostic Python loop with zero external dependencies β€” the fallback that always runs. Everything else is a plugin.

Ground-truth feedback in seconds. Real ad feedback takes 30 days, which never closes a loop on stage. So we made a simulator that is the reward model the agent must discover. The trick was giving it a genuine sweet spot so there's something to learn toward: each keyword has a hidden "winner's curse" β€” bidding to the top of the page makes clicks explode in cost for little extra value, while bidding too low buys poor ad placement that converts badly. The best result sits at a middling win-rate. The agent hill-climbs this surface it can't see, and the portfolio's conversions-per-dollar visibly bends upward over a dozen periods. A second domain β€” recruiting, optimizing reply-rate over message tone and targeting β€” runs on the same engine object, proving it's real loop engineering, not a chatbot in a trench coat.

Self-correction that's real. An explicit explore/exploit budgeter states its tradeoff every period ("probing one unknown ad at 10% of budget, exploiting the top three"). A thrash detector halts a keyword when it oscillates within a noise band, and stops the whole loop when the objective stalls for several periods in a row β€” the agent catching itself and quitting rather than burning budget.

Zero as keyless compute. We registered an anonymous Zero agent wallet and drove the CLI from the server. The agent searches for a capability, pays per call from an x402 wallet, and reviews it — no pre-wired keys. We pinned three verified models: Groq Llama 3.3 70B (concepts), fal.ai FLUX.1 Schnell (image), and Grok Imagine (image→video), plus Zero Host Website (which really deployed a live page for $0).

Nexla as the data plane. Both directions: the user-response Nexset in, and the winning campaign out to Shopify/Google/Meta via governed feeds β€” Nexla's core competency.

Pomerium, Adbox, and a dark neo-brutalist UI finish it: an infra-layer spend gate, the two-tier decide→render factory, and a clean single-page app plus an illustrated /about architecture diagram.

πŸ“š What we learned

  • Closing the loop is the whole game. A renderer that never measures its output is a demo; the moment you feed conversion lift back into "which creative survives," creative generation becomes a measured optimization.
  • Payment rails are real infrastructure. The x402 world is a maze of chains and settlement protocols. Our $5 credit read as "5 USDC" but couldn't pay Base-bridged endpoints (Bridge failed) or a mismatched contract (balanceOf returned no data). It only worked via mpp on the Tempo network β€” a discovery that took a dozen live test calls.
  • Keyless is genuinely different. Watching an agent discover an image API and pay pennies for it, with no config, reframes what "integration" means.
  • If a judge can't see the correction in three seconds, it didn't happen. We rebuilt the UI twice chasing clarity.

πŸ§— Challenges we ran into

  • The month-over-month trap β€” solved with a discoverable simulator plus time compression so the loop closes 12+ times a minute.
  • Payment-rail hell β€” both x402 and mpp failed on the models we first pinned. We reverse-engineered which rail the welcome credit could actually reach (Tempo mpp) and re-pinned every model to it β€” image and video now generate live for $0.003–$0.50, paid from the credit.
  • Flaky third-party capabilities β€” arbitrary x402 endpoints have inconsistent schemas and reliability, so we pinned verified models and made every step degrade gracefully to a prebuilt asset. The loop never stalls.
  • Scope creep β€” the project got cramped (bids + recruiting + security + governed data + replay + multimedia). We re-centered hard on one idea β€” self-improving ads β€” with Zero and Nexla as the two visible engines.
  • Windows + a long-running server β€” pkill doesn't kill Windows Python; orphaned servers piled up until we managed them via PowerShell. Small, real, and time-eating.

πŸš€ What's next

Wire the loop to a live ad platform's real user response (the Nexla seam is already there), let the agent A/B multiple generated creatives per ad and evolve a population with a bandit over user segments, and let Nexla push winners to real Shopify/Meta accounts the moment nexla-cli login lands.


One loop engine. Ads that learn from your users and rewrite themselves β€” keyless compute on Zero, governed data on Nexla, measured live.

Built With

  • nexla
  • zero.xyz
Share this project:

Updates