AI Agent Architecture

How to Build a Marketing Agent That Learns From Revenue

Direct Answer

A real marketing agent does four things in a loop: it reads unified business data, chooses from bounded actions, operates on a cadence, and measures whether those actions improved a business outcome.

That definition is the most useful part of Cody Schneider's conversation with Greg Isenberg. Researching pain points, generating ten ads, or scheduling a workflow is not enough. The system becomes agentic when the result returns as evidence: which creative attracted qualified buyers, which campaign created revenue, what failed, and what the next controlled experiment should be.

JQ AI SYSTEMS take: the model is not the marketing system. The system is the measured loop around it: approved inputs, a clear decision policy, constrained tools, revenue-linked feedback, and a human-controlled budget.

Watch the Full Conversation

Episode and production credit: Greg Isenberg and the Startup Ideas Podcast. Guest: Cody Schneider, cofounder of Graphed and previously a builder at Swell AI and Drafthorse AI. Follow Cody on X or LinkedIn.

Product and market details were checked on 28 July 2026 against WordPress, Meta Engineering, Airbyte, ClickHouse, and the relevant product documentation. Cody's campaign volumes, time windows, channel opinions, and client results are creator-reported operating examples, not guaranteed outcomes or universal platform rules.

1. What Counts as a Marketing Agent?

Cody draws a hard line between a linear automation and an agent. His working definition has three requirements: unified data across the customer journey, autonomous decisions on a cadence, and a thinking loop that reads the results back. I would add a fourth requirement for production: an explicit action policy.

SystemWhat it doesWhat it cannot prove
PromptGenerates one answer or asset.Whether the output changed a business result.
AutomationExecutes a predefined sequence after a trigger.Whether it should change the sequence next time.
CopilotAnalyzes data and recommends an action to a person.Whether the recommendation was executed consistently.
Marketing agentReads results, selects an allowed action, acts or requests approval, and evaluates the outcome on the next run.Nothing beyond its data, policy, tools, and evaluation design.

This does not require a general-purpose autonomous employee. A reliable agent can be narrow: one channel, one objective, a short action menu, and clear stop conditions. In fact, that is usually the better design.

2. The Complete Architecture

The episode's Meta Ads example can be organized into eight layers:

  1. Research: collect customer language, objections, desired outcomes, competitor ads, and category content.
  2. Creative planning: convert evidence into distinct angles, hooks, formats, and test hypotheses.
  3. Asset generation: produce static and video variants within a reviewed brand system.
  4. Quality review: check readability, claims, brand accuracy, legal restrictions, links, and landing-page continuity.
  5. Publishing: create approved campaigns or ads through Meta's Marketing API.
  6. Measurement: ingest ad delivery, site behavior, CRM status, and payment events.
  7. Decision policy: compare each experiment with thresholds, budgets, and uncertainty rules.
  8. Next action: keep, pause, revise, promote, or ask for human judgment.
Customer evidence + competitor creative
                |
                v
      Angles, hooks, and hypotheses
                |
                v
     Static/video creative factory
                |
                v
      Brand + policy + human review
                |
                v
        Meta Marketing API writes
                |
                v
Ad data + analytics + CRM + revenue events
                |
                v
       Pipeline -> analytical store
                |
                v
   Bounded decision policy on a cadence
                |
                +--> recommend
                +--> pause allowlisted loser
                +--> promote candidate for approval
                +--> stop and escalate

The critical path is not content generation. It is maintaining identity from ad to session, lead, opportunity, and payment so the agent learns from revenue rather than cheap clicks.

3. Why WordPress Is a Useful Business Sandbox

Cody uses an AI-first WordPress product as the episode's concrete business. The market premise is real: WordPress says it powers over 43% of sites across the web. That does not make every plugin idea attractive, but it creates a large installed base with familiar jobs, existing spend, and visible customer complaints.

Proven categoryAI-first version proposed in the episodeUseful validation question
SEO assistanceAn agent that drafts metadata, proposes internal links, and applies approved fixes instead of only scoring pages.Will users trust write access, and can every change be previewed and reversed?
FormsA conversational form that answers questions and qualifies leads.Does it improve qualified completion without collecting unnecessary personal data?
WooCommerce operationsA storekeeper that drafts product copy, segments abandoned carts, and suggests follow-up flows.Can it attribute incremental revenue without over-messaging customers?
Spam and securityAn agent that explains risk and recommends maintenance actions.Can deterministic security controls remain authoritative?
Site buildingA conversational layer that edits an existing WordPress site and bundles common capabilities.Can it preserve theme, plugin, accessibility, performance, and rollback constraints?

The defensible version is not "add AI to a plugin." It owns a painful outcome, keeps changes reversible, and learns from approved site and business data. The 43% statistic is an opportunity signal, not a revenue forecast.

4. What Meta's Andromeda Changes, and What It Does Not

Meta describes Andromeda as a personalized ads retrieval engine. Retrieval selects a smaller candidate set from tens of millions of eligible ads before later ranking systems decide what is shown. Meta says the system was designed to handle much larger and more diverse volumes of creative while improving personalization.

Cody's practical interpretation is that creative increasingly carries the audience signal. An ad that explicitly names a WordPress maintenance problem gives Meta richer material than a generic "build faster" message. That makes creative diversity, landing-page coherence, and clean conversion events more important.

Important nuance: creative is not literally the only targeting. Andromeda sits inside a larger ads system. Objectives, placements, eligible audiences, account history, budget, conversion quality, policy, landing-page experience, and downstream ranking still affect delivery.

The correct response is not to generate endless cosmetic variants. Build meaningfully different hypotheses: distinct pains, desired outcomes, levels of awareness, proof formats, and offers. Let the system compare ideas, not just colors.

5. Two Creative Pipelines: Static and Video

Cody describes a static pipeline using a multi-model media API and Google's Nano Banana image model, plus a video pipeline using HeyGen avatar content while experimenting with Seedance. The transcript appears to transcribe the first service as "Kai AI"; the product matching his description is Kie AI, a unified API for image and video models.

Static pipeline

  1. Start from one evidence-backed angle and a reference format, not a request to "make a good ad."
  2. Generate multiple compositions while preserving the offer, audience, and hypothesis label.
  3. Run vision checks for legible text, product accuracy, logo use, colors, typography, dimensions, and prohibited claims.
  4. Require a human to approve the first batches and any regulated or comparative claim.
  5. Store the source evidence, prompt, model, asset hash, and campaign ID together.

Video pipeline

  1. Convert one customer pain into a short script with a clear hook, proof, mechanism, and action.
  2. Generate scenes or an avatar draft, respecting the selected model's duration and identity limits.
  3. Review speech, captions, disclosure, product behavior, continuity, and music rights.
  4. Export versions with unique creative IDs so later revenue can be traced back to the script and source.

Useful tools from the episode include Kie AI, Google's official Nano Banana model documentation, HeyGen, and ByteDance's Seedance. Model limits and pricing change frequently, so verify them before encoding assumptions into an agent.

6. The Data Layer: Pipeline, Warehouse, and Identity

In Cody's open-source stack, Airbyte moves approved source data into ClickHouse. Airbyte documents hundreds of source and destination connectors; ClickHouse is an open-source, column-oriented analytical database suited to fresh, high-volume event data.

The episode's example joins four classes of evidence:

SourceQuestion it answersMinimum useful keys
Meta AdsWhat was delivered, at what cost, from which campaign and creative?Account, campaign, ad set, ad, creative, date, spend, impressions, clicks.
Web or product analyticsWhat did the visitor do after the click?Session or user ID, landing page, campaign parameters, key events, timestamp.
CRMDid the lead become qualified, enter a pipeline, or close?Lead/contact ID, source, stage, value, owner, timestamps.
PaymentsDid the journey create collected revenue or a refund?Customer/order ID, amount, currency, status, timestamp.

Tools such as PostHog, HubSpot, and Stripe can supply parts of that journey. Hosting can be as ordinary as Heroku, Railway, or another environment that supports secrets, schedules, logs, and rollback.

A warehouse does not repair bad attribution. Before automating decisions, test duplicate events, missing campaign IDs, currency conversion, refunds, offline sales, attribution windows, consent, retention, and deletion. The agent should expose confidence and missing data instead of manufacturing certainty.

7. How the Decision Loop Should Work

Cody describes a client workflow that publishes two ad sets per day with five ads each, gives them roughly two to three days for an initial signal, pauses the poorest performers, and moves candidates into a winners pool. Treat those numbers as one team's operating configuration, not a template to paste into every account.

A safer decision record looks like this:

decision_id: 2026-07-28-ad-184-pause-proposal
objective: qualified_customer_acquisition
creative_id: ad-184
hypothesis: "Plugin maintenance is the primary pain"
evidence_window: 2026-07-25 to 2026-07-28
spend: [amount]
impressions: [count]
qualified_conversions: [count]
collected_revenue: [amount]
data_quality:
  campaign_mapping: pass
  revenue_join: pass
  attribution_delay_complete: false
recommendation: wait
reason: "Revenue attribution window is still incomplete"
allowed_actions:
  - keep_running
  - request_human_review
prohibited_actions:
  - increase_budget
  - create_new_campaign

Each run should preserve the evidence, recommendation, chosen action, approver, and next evaluation time. That audit trail is how a team distinguishes learning from random account churn.

8. Prevent the Agent From Repeating Itself

Cody calls the failure mode "entropy": the agent converges on the same concepts and produces increasingly similar creative. His countermeasure is to inject fresh external material, including the Meta Ad Library, customer discussions, YouTube transcripts, podcast transcripts, and current category formats.

Freshness alone is not enough. Add diversity rules:

  • Do not reuse the same pain, hook, proof device, or visual grammar within a defined window.
  • Track semantic similarity between new concepts and the active library.
  • Separate customer evidence from competitor inspiration so imitation does not become the strategy.
  • Record why each new concept is meaningfully different.
  • Reject unsupported claims even when they appear frequently in competitor ads.
  • Reserve a percentage of tests for human-originated ideas and qualitative customer insight.

Perplexity can accelerate open-web research, but a research agent should link the source discussion and preserve the date. Reddit posts, transcripts, and competitor ads are inputs to investigate, not truth or permission to copy.

9. Give the Agent an Action Budget, Not the Account

ActionRecommended starting permissionRequired control
Read approved campaign and business dataAutomaticAllowlisted account, fields, date range, and rate limits.
Generate research, concepts, and draft assetsAutomaticSource links, brand checks, claim checks, and asset provenance.
Create draft campaigns or adsApproval requiredPreview, naming rules, destination check, and no automatic activation.
Pause an underperforming adEligible after testingAllowlist, minimum data, maximum daily actions, reason log, and easy rollback.
Increase budget or promote a winnerApproval requiredIncrement cap, account budget check, attribution confidence, and approver identity.
Change billing, permissions, pixels, audiences, or account settingsHuman onlySeparate credentials and no agent tool access.

Meta's Marketing APIs support both management and insights workflows. Cody recommends using the API primarily for bounded writes while reading consolidated analytics from the warehouse. That is an architectural preference, not a Meta requirement. Whichever route you choose, follow API rate limits, platform terms, and the Advertising Standards.

Minimum production controls: a hard daily spend cap, campaign allowlist, maximum number of actions per run, dry-run mode, human approval queue, immutable decision log, secret isolation, alerting, rollback, and one visible kill switch.

10. A Four-Stage Starter Build

Stage 1: Manual evidence loop

Pick one offer and one conversion event. Gather ten customer statements and ten relevant ads. Write five distinct hypotheses. Produce a small reviewed batch. Run it manually and record the creative ID through to the conversion.

Stage 2: Read-only measurement agent

Consolidate campaign, analytics, CRM, and revenue data into one queryable view. Schedule a daily brief that flags tracking failures, spend anomalies, weak evidence, and candidate actions. It should link to source records and change nothing.

Stage 3: Approval-based operator

Let the agent prepare research, creative briefs, assets, naming, and draft API requests. A person reviews claims, brand fit, landing pages, and spend before activation. Compare its recommendations with the human's decisions for several cycles.

Stage 4: Narrow autonomy

Permit one reversible action, such as pausing an allowlisted ad that exceeds minimum-spend and minimum-evidence thresholds. Cap actions per day, notify the owner immediately, and review false positives weekly. Expand only when the logs show that the control is dependable.

This progression is slower than giving an agent an API key and a goal. It is also how the system earns the right to touch real budget.

11. Measure the Business, the Model, and the Guardrails

LayerExamplesWhy it matters
BusinessCollected revenue, gross margin, CAC, payback period, qualified pipeline.Prevents cheap clicks from masquerading as growth.
FunnelLanding-page conversion, qualified-lead rate, opportunity rate, close rate.Shows where performance changed after the ad.
CreativeHook hold, click-through, cost per qualified conversion, fatigue, angle-level revenue.Teaches the system which ideas deserve more tests.
Agent qualityRecommendation acceptance, false-pause rate, attribution confidence, human correction time.Measures whether automation is actually trustworthy.
SafetySpend-cap breaches, policy rejections, unauthorized actions, rollbacks, data-access violations.Makes reliability part of performance.

The market can help select a winner, but only from the experiments you choose to run and the outcomes you choose to measure. An agent optimized for click-through will become very good at clicks. An agent evaluated on qualified revenue, truthful creative, and controlled spend has a chance to improve the business.

Video Chapters

TimeSectionPractical takeaway
00:00IntroductionCustomer acquisition is still harder than producing software.
01:54Defining a marketing agentUnified data, cadence, decisions, and feedback separate an agent from automation.
04:00Startup idea: AI for WordPressUse a large installed base and proven plugin categories as a validation sandbox.
07:27AI-first plugin ideasRebuild outcomes, not interfaces, around reversible agent actions.
09:55The current state of Meta AdsCreative and conversion signals play a larger role in automated delivery.
12:48Bundling the stack and choosing channelsCustomer-language research seeds testable ad angles.
15:23Static and video pipelinesGeneration needs brand, claim, readability, and provenance checks.
17:25Data pipeline and warehouseJoin ad delivery to analytics, CRM, and revenue before automating optimization.
24:11Ad strategyStore each experiment and let performance inform the next batch.
25:51Solving for entropyInject fresh evidence and enforce concept diversity.
28:01Let the market pick the winnerTest hypotheses at volume without confusing early signal with certainty.
34:26Closing thoughtsThe same architecture can support search, outreach, SEO, and social agents.

Bottom Line

Cody Schneider's strongest idea is not that AI can make more ads. It is that marketing can become a closed, inspectable operating loop: evidence becomes creative, creative becomes an experiment, experiments become revenue data, and revenue data shapes the next decision.

Small teams should resist the urge to automate the whole account first. Build one truthful attribution path. Add one read-only brief. Package one repeatable creative method. Then give the agent one reversible action with a hard limit.

The useful marketing agent is not the one that acts most often. It is the one that can show what it saw, why it acted, what happened, and when it needs a person.

Sources and Useful Links

Common questions

What is a marketing agent?
A marketing agent is a recurring system that reads approved business data, selects an action under a defined policy, executes or proposes that action through tools, and evaluates the resulting business outcome. A linear workflow that produces content but never reads performance back is automation, not a complete agent loop.
Does a small business need Airbyte and ClickHouse to build one?
Not initially. A first version can export a small set of campaign, analytics, CRM, and revenue data into one reviewed table. Airbyte and ClickHouse become useful when the number of sources, history, query volume, freshness requirements, or team access makes manual consolidation unreliable.
Can an AI agent safely run Meta Ads by itself?
It should earn autonomy gradually. Start read-only, then allow recommendations, then approval-based publishing, and only later permit narrow actions such as pausing an allowlisted ad after minimum-spend and minimum-conversion checks. Keep budgets, new campaigns, claims, targeting changes, and account settings behind human approval.
Did Meta Andromeda eliminate audience targeting?
No. Meta describes Andromeda as a personalized ads retrieval system within a larger recommendation stack. Rich, diverse creative and clean conversion signals matter more, but campaign objectives, audience controls, policy compliance, landing pages, measurement, and offer quality still matter.
How long should the agent wait before judging an ad?
There is no universal 48-hour rule. Cody describes a two-to-three-day initial window in one operating example, but the correct threshold depends on budget, conversion volume, attribution delay, sales cycle, and statistical uncertainty. Use minimum spend, minimum impressions, and minimum conversion-event thresholds rather than time alone.
What is the best first marketing-agent workflow?
A daily read-only performance brief is the safest first loop. It should reconcile ad spend, qualified conversions, and revenue; flag broken tracking or unusual changes; link to the underlying records; and propose actions without changing the ad account.
Share
X LinkedIn Reddit
Build Yours

Want a system
like this one?

Book a free 30-minute call. We map your situation, identify the highest-impact automation, and figure out if we are a fit.

Book Free 30-min Call