Building AI Agents for AI Search Visibility

DiscoveredBy shows brands how they appear in ChatGPT, Gemini, Perplexity, Claude, Grok, and Google's AI answers, then uses twelve AI agents to explain why and what to fix. We built it end to end on FastAPI and SvelteKit, and we run it.

DiscoveredBy overview screen: visibility, share of voice, position, sentiment and citation rate for a demo brand, a 28-day visibility trend, and a ranking against four competitors.
The overview a team opens each morning: how often AI engines name the brand, how they rank it, and who is gaining. Shown with the product's demo data.

Category

AI Agents / FastAPI / SvelteKit

Project Type

Our own product: we build, run, and operate it

Industry

Generative engine optimization (GEO) and AI search visibility

The Problem

Buyers now ask AI engines which product to choose. Traditional SEO tools do not show whether those answers mention a brand, how they frame it, which pages they cite, or why a competitor gets recommended instead.

Marketing teams, PR teams, and agencies needed that picture across engines, countries, cities, and buyer personas, plus specific changes that would improve it, not another dashboard of raw numbers.

What We Built

  • visibility, position, and share of voice for every tracked prompt, by country, city, persona, or language
  • how each AI answer frames the brand, with the quoted line behind every verdict
  • which pages AI engines cite, and where competitors win citations you lose
  • ranked fixes, copy-ready page edits, article drafts sent to WordPress, and llms.txt audits
  • Search Console and GA4 data joined to AI visibility, down to revenue attribution
  • which AI crawlers fetch your pages, from Cloudflare or server logs
  • daily alerts, weekly reports, agency client reports, and a customer API and MCP server

Engines tracked: ChatGPT (app), Gemini (app and API), Perplexity, Claude, Grok, Google AI Overviews, Google AI Mode.

12
AI agents in production
From business profiling to revenue attribution
8
AI engines tracked
Including ChatGPT, Gemini, Claude, and Google AI Mode

From a Buyer's Question to a Fix

One tracked prompt, followed through the platform: the engines answer, the agents read what they said, and the team gets a change to make.

Step 1

A buyer asks an AI engine

"What is the best bookkeeping app for freelancers?"

Step 2

Eight engines answer, every day

  • ChatGPT
  • Gemini
  • Gemini API
  • Perplexity
  • Claude
  • Grok
  • AI Overviews
  • AI Mode

Step 3

Agents read every answer

  • Sentiment & Framing

    Named as a top pick, positive

  • Visibility Watchdog

    Named in 5 of 8 engines

  • Citation Gap Finder

    Competitor table cited, not yours

Step 4

Your team gets a ranked fix

88 out of 100

Add a comparison table

Engines answering the comparison prompt cite a third-party table, never yours.

Example data from DiscoveredBy's fictional demo brand, a bookkeeping app called Quillstone.

Twelve Agents in Production

Each agent does one job and hands its findings to the others. Together they move from tracking, to diagnosis, to a fix a team can ship.

Business Profiler

Reads the site on connect and builds the business profile every other agent works from.

Prompt Discovery

Finds the high-intent prompts a brand should be tracking.

Sentiment & Framing

Classifies how each answer positions the brand and quotes the line that shows why.

Visibility Watchdog

Runs daily, flags material moves, and names the prompts and engine behind them.

Citation Gap Finder

Reads the competitor page AI chose and ranks the fixes that could close the gap.

Article Topic Planner

Plans the articles most likely to earn citations.

Article Writer

Decides which page should win a prompt and drafts it, grounded in scraped evidence.

On-Page Optimization

Turns a citation gap into a copy-ready edit for an existing page.

llms.txt Advisor

Audits llms.txt against the spec and writes a compliant version.

Search Console Reconciliation

Finds queries that win in Google but vanish from AI answers.

Revenue Attribution

Connects AI citations to traffic and revenue in GA4.

Growth Advisor

Writes a weekly or on-demand growth briefing from everything the other agents found.

DiscoveredBy citation gaps screen: the highest-impact page fix scored 88 out of 100, with counts of gaps waiting and shipped, and a ranked list of opportunities with evidence and Accept buttons.
Agent output a team can act on: page fixes ranked by impact, each backed by the competitor citations behind it. Shown with the product's demo data.

How It Is Built

A plain, observable stack: one async API, agents as queued workers, and every model call logged with its cost.

Async FastAPI backend

An async FastAPI backend on PostgreSQL, with versioned schema migrations.

Agents as queued workers

Each agent runs as a background job, so slow AI calls never hold up the app, and daily scans run on a schedule.

One gateway for every model call

Every agent call goes through one gateway that enforces a strict output schema and records the call and its cost.

One adapter per engine

Each AI engine sits behind the same small interface, so engines can be added or changed without touching the agents.

Raw data kept, scores derived

Answers and citations are stored first and scores are derived from them, so results can be recalculated without paying for the AI call again.

Two SvelteKit apps

A Svelte 5 marketing site and a separate SvelteKit product dashboard, both on Tailwind CSS, talking to the FastAPI API.

Integrations and Developer Access

The data has to meet teams where they already work: their Google accounts, their CDN logs, their CMS, and their own AI assistants.

Google Search Console and GA4

Connect a Google account and matching properties map to the right project on their own. Search demand and AI-referred sessions sit next to AI visibility.

AI crawler analytics

Cloudflare Worker or Logpush, NDJSON from log shippers, or Combined Log Format uploads. Only known AI bots are kept, and client IP addresses are never stored.

Customer API

A read-only JSON API with project-scoped keys that can expire or be revoked.

MCP connector

A read-only MCP server, so customers can ask their own AI assistant about their tracked answers.

Also: WordPress draft publishing, Google sign-in, CSV and Excel prompt imports, and CSV and JSON exports.

Why This Was Hard

Agents that call paid AI engines every day, on untrusted web content, for many customers, have to be cheap, safe, and repeatable before they are clever.

AI answers vary from run to run and engine to engine, so a single check is not a measurement: visibility had to be tracked over repeated daily runs

scraped pages and AI answers are untrusted input, so agents had to treat them as data, not instructions, and every output is validated before it is used

querying many paid AI engines for every customer needed cost control built in from the start, not added after the first bill

daily scans had to be safe to retry, and one failing engine could never stop the others

each engine returns answers and citations in its own format, and every one had to land in the same comparable shape

raw tracking was not enough: users needed ranked, specific fixes they could ship, then a way to see what changed afterwards

How It Shipped

Small releases, every week, in public. Each month below comes from the dated product changelog.

Read the changelog
  1. June 2026

    Google data inside the app

    Search Console queries and pages, and Google Analytics sessions, shown next to AI visibility.

  2. July 2026

    Agents that recommend, not just report

    Growth Advisor, llms.txt Advisor, citation gaps, page optimizations, and dated weekly reports.

  3. August 2026

    Showing the work

    Fan-out queries showing what each engine actually searched for, and CSV exports.

Outcome

  • live at discoveredby.ai as a GEO and AI search visibility platform for marketing, content, PR, and agency teams
  • tracks brands across eight AI engines, from ChatGPT to Google AI Mode
  • twelve production agents covering tracking, diagnosis, content, and reporting in one workflow

What Carries Over to Your Project

You may not need AI search tracking. If you are adding AI agents to your own product, these are the parts of DiscoveredBy we bring with us.

Agents you can audit

Every model call recorded with its input, output, and cost, so you can answer "why did the AI say that?"

Outputs your code can trust

Strict schemas on every agent response, with a repair retry or a clear error state instead of free text leaking into your product.

AI spend that stays predictable

Per-call cost tracking and usage limits, designed in from the start rather than added after the first bill.

Failures that stay contained

Idempotent jobs and isolated providers, so one slow or failing model never takes the rest of the pipeline down.

An API and MCP for your customers

Scoped keys and a read-only MCP connector, so your users can bring your data into their own AI tools.

Tests that let you ship weekly

A large automated test suite is what makes weekly releases safe. We bring the same habit to client builds.

Questions About This Build

Did MicroPyramid build DiscoveredBy?

Yes. DiscoveredBy is our own product. Our team designed, built, and runs the FastAPI platform, the twelve agents, and both SvelteKit apps, and we ship to it every week.

Can you build a similar AI agent platform for our business?

Yes. The patterns on this page (audited model calls, schema-locked outputs, cost controls, queued agents, and a customer API) apply to any product where AI agents read data, make a judgement, and hand a result to a person or another system. We start with a discovery sprint and give a fixed estimate after it.

Which AI models do you work with?

DiscoveredBy works with OpenAI, Anthropic Claude, Google Gemini, Perplexity, and xAI Grok, each behind its own adapter. We pick models per task for client builds and keep them swappable, so you are not locked to one vendor.

Can you add AI agents to an existing product instead of starting fresh?

Yes. Most agents in DiscoveredBy are ordinary background jobs that read from the database and write structured results back. The same approach fits into an existing Django, FastAPI, or Node application without a rewrite.

Need AI Agents That Hold Up in Production?

We build agents with the same guardrails we run on DiscoveredBy: strict output schemas, cost tracking, safe retries, and a team that keeps them running.