Skip to content
← Field notes

I Built an AI Agent Loop That Runs My SEO. Here's What Happened.

How I rewired a one-way SEO flywheel into a real feedback loop. The agent now measures its own work, learns from live data, and decides what to do next.

I Built an AI Agent Loop That Runs My SEO. Here's What Happened.

The latest AI trend everyone is talking about is Agent Loops.

Agent Loops are automated AI systems that run continuously to achieve a specific goal without needing constant human prompting. Serious AI heavy hitters Boris Cherney (Head of Claude Code at Anthropic) and Peter Steinberger (Creator of OpenClaw) are widely credited with leading the loop engineering trend.

An Agent Loop acts like an autonomous digital employee. You give it a final objective, and it continuously thinks, acts, checks its own work, and adjusts its strategy until the job is done.

However, most of the conversation I’ve seen has been hypothetical, so loving a challenge I decided to try and build one.

Rather than start from scratch I already had a SEO Agent (built using Claude Code) that was a great candidate for converting into a Loop. The SEO Agent and a connected Content Agent made up a “flywheel” a one-directional automated workflow that created content for a website I had recently launched.

In just 3 months the flywheel workflow started generating a healthy amount of organic traffic for the site (more detail about this later). But the SEO Agent part of the workflow couldn’t tell me what was working. It just executed from the static brief it was given.

Access to live data and smarter

So my idea was to rewire my flywheel workflow and transform it into an actual feedback loop. To do this I only needed to update the SEO Agent as it fed the Content Agent with what to write and publish. So the plan was to make the SEO Agent smarter and better at telling its digital employee the Content Agent what to do.

First I will need to give the SEO Agent rich data to loop back as feedback. As my Agents are publishing SEO/AEO content I connected live performance data from Google Search Console, keyword intelligence from DataForSEO, and AI search citation data from Perplexity.

Then I updated the brief telling the SEO Agent to use all this rich data to decide what should be done next. To handle this new responsibility, I upgraded its brain from Sonnet to Opus 4.8. I kept Sonnet for the Content Agent that does the grunt work to cut costs.

With Opus 4.8 my SEO Agent now has genuine reasoning. It can measure whether its own past work succeeded, spots trends, and adjusts course on its own.

Why I setup the Agents in the first place

Earlier this year I began building a micro-SaaS MissingLinkz an automated quality control tool that stops marketing teams from launching campaigns with broken links or messy tracking data. This is a big problem for anyone running automated ads at scale as human error and AI hallucinations, cause havoc on the reliability of using UTM links to track attribution. Most UTM tools are webforms and AI Agents can’t reliably use them, this is the gap MissingLinkz is built around.

A big part of the go-to-market strategy for MissingLinkz was to create content that will drive highly targeted organic traffic to the website and make sure it was being cited by LLM’s. As the website is built using Claude Code I was able to also build two Agents to execute this strategy on autopilot. Phase 1 is what I call the Flywheel and Phase 2 the Loop.

A quick note on the publishing of content on autopilot. For most use cases ie a personal brand, company blog or anything where a voice and nuance matter, I do not recommend it. At minimum keep a human in the loop before publishing. MissingLinkz is a completely solo project, bootstrapped, no funding and the content is the type where factual accuracy matters more than a creative voice. The brief provided to the Content Agent has guardrails and a tone of voice guide but they are a substitute not the ideal. And for what it’s worth the article you’re reading right now is written by me. Full disclosure I used AI to help create an outline plus gather facts and figures. Anyway, back to the flywheel.

Phase 1: The Flywheel (Months 1 to 3)

The Flywheel workflow wasn’t smart. But it was diligent.

Using a mix of Claude and Gemini (Gemini is better for SEO research, being built by the world’s largest search engine Google) I created a detailed SEO brief: target keywords from prior research, competitive positioning, audience definition, content priorities. I handed it to the agents and let them run with it.

The SEO Agent’s task was to work from that static brief the same keyword list, the same priorities, every single week and feed the Content Agent with what articles need writing.

However it had no way to see real-world performance. It didn’t know which articles were getting impressions, which keywords were actually driving clicks, or whether anything it recommended was working. It just followed the brief, diligently.

The Content Agent job is to take it’s instructions from it’s boss the SEO Agent, write and publish an article, and wait for its next set of instructions. It does this every day, on autopilot.

The flywheel results

Starting from ground zero, with a brand new domain, no backlinks, no existing content, no paid promotion in just three months the system published 170+ articles and produced these numbers:

MetricNumber
Impressions (3 months)16,800
Clicks (3 months)103
Average CTR0.6%
Average position9.8 (first page)
Google Search Console results chart showing the flywheel's impressions ramping over three months, with the steepest growth from late May onwards.

The growth curve is steep. The first month is essentially flat brand-new domain, nothing indexed yet. Then after a few weeks of some momentum building mid-May it started ramping up. The three-month window now shows nearly 17,000 impressions. Not viral numbers, but for a niche B2B tool with zero ad spend, it’s real organic traction built entirely by AI from nothing.

The system also ranks for the exact developer-intent queries we targeted: utm cli, cli marketing automation, utm mcp terms where our ideal buyer is actively searching.

I’m currently working on optimising clicks. In the last couple of weeks, I’ve added a CTA banner across all blog articles and improved the CTA on the homepage. The CTR appears is improving but it’s early days.

Word of warning don’t start publishing hundreds of articles every day/week. Google will penalise you for scaled content abuse. A new website needs time to warm up, get indexed. I published about 170 articles over a 3-month period that’s less than two articles per day. I’ve heard some big time AI marketing influencer give bad advice about scaling content fast, don’t fall for it, many have never actually put into action the advice they give.

AI Search (Perplexity) citations:

This is the metric many marketing teams aren’t tracking yet. When someone asks a LLM ie Perplexity or ChatGPT a question in our space, does it cite us as a source? The system monitors 14 specific prompts weekly, they are questions my target buyer would ask an AI search engine.

WeekCitation rateAvg position when cited
Week 10% (0/12)
Week 233% (4/12)mixed
Week 342% (5/12)2.4
Week 558% (7/12)1.6
Week 650% (6/12)3.3

From completely invisible to being cited in over half of our target queries and when cited, frequently as the first source. Here are a few of the prompts as you can they are very specific to the product:

“What CLI tool validates campaign links, OG tags, and UTM parameters before publishing?”

“How do I automate UTM link validation in a CI/CD pipeline?”

“What npm package builds UTM links and validates the destination URL?”

So it’s safe to say The flywheel is doing sterling work. Content went out, rankings went up, AI citations increased. Job done? Not yet, it has a couple of fundamental problems.

Why a flywheel isn’t a loop

The flywheel moves in one direction: brief, write, publish. The Agents generated output every week, like clock work but it was working from a static brief. It never asked itself “what’s actually working?”. It couldn’t because it had no data it could reference to answer that question.

Two big blind spots:

  1. No real-world performance data. The agent had a keyword brief to work through but no way to know whether the published articles were actually ranking, getting impressions, or clicks. It just followed the same plan without connecting cause to effect.
  2. Google and Perplexity were siloed. I gave the SEO Agent some exported Google Search Console data but it did not cross reference that against the Perplexity citations it monitors.

Phase 2: Building the Loop

I had to make four fundamental changes to turn the flywheel into a feedback loop.

1. Live data: Google Search Console (GSC) integration

The biggest change was giving the agent real performance data. I wired up Google Search Console (you need to create a Google Cloud service account and generate a JSON key) so the SEO Agent now pulls live data Sunday morning. Impressions, clicks, CTR, average position, broken out by query, page, country, and device.

This is the fresh data a static brief could never provide.

Before writing the Action Brief for the Content Agent, the SEO Agent reviews:

  • Query movement: which target queries gained or lost position
  • Impression trajectory: which pages are growing vs declining
  • CTR validation: whether previous title rewrites actually improved click-through rate
  • Click concentration: whether traffic is spreading across more pages (healthy) or concentrating on fewer (fragile)

Now it can look at what we planned to do, what actually happened and what does that mean.

2. Covering GSC’s blind spot with DataForSEO

Search Console has a limitation, it only shows you queries you already rank for. If there’s a keyword where you have zero presence that’s a blind spot. An agent working only from GSC data will keep optimising the pages it can already see and stay blind to the opportunities it can’t.

So I plugged in a second live feed; DataForSEO it provides an API and is infinitely cheaper than a SEMrush subscription. Interestingly Claude Code recommended them to me so they can thank it for my business.

DataForSEO fills in the blindspot:

  • Real difficulty and search volume for candidate keywords. High-difficulty terms get deprioritised automatically, low difficulty, on-intent terms move to the top.
  • Competitor ranked-keyword intelligence. Now I know what my competitors rank for.

3. Cross-channel synthesis

The SEO Agent now cross-references all data sources SEO (GSC, DataForSEO) and LLM citations from Perplexity. It then writes a Cross-Channel Insights section:

PatternWhat it meansAction
Ranks in Google + cited in PerplexityStrong positionProtect, don’t over-optimise
Ranks in Google + NOT citedGEO gapRestructure for AI-extractability
NOT ranking + cited in PerplexityAI-first discoveryStrengthen traditional SEO
NeitherTrue gapBrief new content only if it matches ICP

This turns two separate data feeds into a single strategic picture.

4. Content performance attribution

The agent now checks articles published in the last 2 to 4 weeks against both GSC and Perplexity data:

  • Does the article’s target keyword appear in GSC? At what position?
  • Is the URL getting impressions/clicks?
  • Was the target prompt cited in the latest AEO snapshot?

This closes the loop.

The decision framework for new briefs handed from the SEO Agent to the Content Agent changed from a simple task of picking the next keyword on the list to:

  1. Fix what’s broken first. If an article has zero impressions or lost citations, diagnose before briefing new content.
  2. Deepen what’s working. If a page is climbing in position, brief supporting content that links to it.
  3. Fill strategic gaps. Create new content only when the first two are addressed.
Diagram comparing the one-directional flywheel (brief, write, publish on a weekly cycle with no live data) against the loop, which adds a measure step that feeds live data back into the brief so the system learns and adjusts.

The Loop has started proving itself

Let me be clear it’s early days, but I’m getting excited. I’ve only run a handful of forced runs to confirm everything’s wired up. But even in those first runs, the loop has started proving itself in ways the flywheel never could.

The SEO Agent measured its own previous recommendation and found it didn’t work (at least not yet). The highest-traffic page had plenty of impressions but a click-through rate of just 0.7%. The agent recommended a title tag rewrite to improve CTR, then implemented it. After checking the latest data it saw the CTR hasn’t improved. The agent’s recommendation is let’s hold for one more measurement cycle before trying something else. No panic, no second rewrite. It observed no change and chose to wait for more data rather than overreact.

The SEO Agent attributed a win to a specific article. One of our AI search monitoring prompts had returned no citation for weeks. So the order to the Content Agent was to publish a targeted article on June 17th. Six days later that new article was now the primary answer. The SEO Agent logged it as a direct attribution win, then used that signal to prioritise similar recommendations for other prompts where we’re still absent.

Brief it, publish it, measure it, learn from it. That’s the loop.

As I said before it is early days, but it is showing restraint, patience, and judgement. Each one is something the flywheel running on a static brief could never have done.

The model split: strategy vs execution

The flywheel ran everything on Claude Sonnet a fast, cheap model that’s excellent at following instructions. But for what I need the Loop to do I needed more brain power.

The upgraded Loop architecture uses two models:

  • Claude Opus 4.8 for the SEO Agent (weekly). Strategic analysis, multi-source data crunching, judgment calls about what to prioritise.
  • Claude Sonnet for the Content Agent (daily). Executing the instructions provided: read a brief, write an article, follow the style guide, commit. High output, lower cost.

What it costs to run

This is the question everyone asks about agent loops, so here my real numbers.

Weekly SEO Agent (Opus 4.8)

ComponentCost per runMonthly
Claude Opus (~150 turns)~$3–5~$12–20
Perplexity API (14 prompts × sonar model)~$0.05~$0.20
Google Search Console APIFreeFree
DataForSEO Labs (keyword difficulty + competitor gaps)~$0.05~$0.20
Total SEO Agent~$3–5~$13–21

Daily Content Agent (Sonnet)

ComponentCost per runMonthly
Claude Sonnet (~80 turns, 2–4 articles)~$1–2~$30–60
Total Content Agent~$1–2~$30–60

Total system

Monthly estimate
SEO Agent (strategy, Opus, weekly)~$13–21
Content Agent (execution, Sonnet, daily)~$30–60
External APIs (Perplexity, DataForSEO)~$0.50
GSC + GitHub ActionsFree
All-in~$45–80/month

For context: a single freelance SEO article costs $200–500. The system publishes 170+ articles in three months, monitors AI citations across 14 prompts weekly, audits pages, tracks competitors, and adjusts its own strategy, for less than the cost of one freelance piece per month.

The flywheel phase (everything on Sonnet, no DataForSEO, no GSC) ran at roughly $30 per month. The Opus upgrade for strategic analysis approximately doubled the LLM cost but the quality of the analysis and therefore the quality of the content briefs it produces has improved meaningfully.

Whether the increase in costs is worth it depends on whether you value the loop’s judgment or just it’s throughput. I’m betting on the power of the Loop but will be monitoring how it gets on over the next few months. I also have some ideas on how to make it even smarter more about that another time.