Agent Experiences

Technical implementation

The technical side of getting your site ready for AI agents (AI assistants that carry out tasks for someone, such as booking, buying, or filling in a form). Much of this is work for a developer. Each guide explains its terms in plain words, so you can follow it yourself or know exactly what to ask for.

Many AI agents can't see content that JavaScript adds

Many of the bots AI tools send to read your pages see only the HTML your server sends (the page code before any JavaScript runs). If your site builds its pages in the visitor's browser with JavaScript, those bots may find an empty page where your content should be.

What to do

  • • Use server-side rendering (SSR, where your server builds each page before sending it). Or build every page ahead of time with static site generation (SSG)
  • • Add <noscript> fallbacks (content shown when JavaScript doesn't run) for anything important
  • • Put your key information in the HTML itself, not added later by JavaScript
  • • Turn JavaScript off in your browser and load your pages. What you see is roughly what these agents see

If your site uses one of these frameworks

  • • Next.js (App Router): Render content in Server Components. Prefer static rendering, and use dynamic rendering only when a page needs a value that changes on every request
  • • Nuxt: Keep SSR on (the default) or prerender routes with nuxt generate; avoid client-only rendering for content
  • • React: Use a framework that renders on the server, such as Next.js, Remix/React Router, or Astro
  • • Vue: Use Nuxt or Vite SSG

Where to spend the effort

Structured data (labels in your page's code) states facts such as the price, the author, or the date a page last changed. Together with clear documentation for your API (the way other software connects to your service), it lets an agent read what you offer instead of guessing from your wording. Two Ahrefs studies should shape where you put that effort. One found that ranking well in Google no longer reliably predicts whether AI answers will cite you. The other found that almost none of the sites that publish llms.txt (a proposed file that points AI tools to your most useful pages) saw a single request for it in a month. Put the effort into structured data and pages that work without JavaScript first.

76% → 38%
Ahrefs found that 76% of pages cited in Google's AI Overviews (the AI summary at the top of some results) also ranked on page one for the same search in July 2025, and only 38% by its March 2026 update
97%
of sites with a valid llms.txt got no requests for it in May 2026, Ahrefs found in its study of 137,000 sites

Structured data for AI agents

How to label your pages so software can tell who wrote them, when they changed, and what you sell. Includes working examples and an honest look at whether it helps you get cited in AI answers.

  • • Examples in JSON-LD (the block of code that holds the labels)
  • • Which fields matter most
  • • How to test your markup
  • • Mistakes that Google penalizes

AI opt-out controls

How to decide which AI bots may read your site and what they may do with your content. Includes templates for robots.txt (the file that tells bots which pages to leave alone) and ai.txt (a proposed file that states your rules for AI use), plus the server settings that enforce your choice.

  • • Blocking the main AI bots by name
  • • ai.txt policy examples
  • • Server and firewall rules
  • • Checking that a bot is who it claims to be

Product feeds for AI shopping

How to get your catalog into ChatGPT, Google AI Mode and Gemini, Copilot, Perplexity, and Amazon, and keep it there.

  • • Which platforms take a feed
  • • Required fields and a field mapping
  • • Refresh schedules
  • • Mistakes that get products dropped

API documentation

How to document your API so AI agents can find it and use it correctly, with a structure software can read as well as people.

  • • A clear OpenAPI file (the standard way to describe an API)
  • • Describing each endpoint (the address software calls for one action)
  • • An example for every request
  • • How agents sign in

Other structured data formats

The other ways to label page content besides JSON-LD, and how to lay out tables and related pages so agents read them correctly.

  • • Microdata (labels written into the HTML tags themselves)
  • • RDFa, another way to add the same labels
  • • Tables an agent can read
  • • Showing how pieces of content relate

Content versioning

How to keep information current without breaking what agents already rely on, and how to show what changed and when.

  • • Keeping track of versions
  • • Telling agents when something changes
  • • Keeping older versions working
  • • A public change log

Technical implementation checklist

Foundation

  • Valid HTML that uses the right tags for headings, lists, and navigation
  • Headings in order, from h1 down to h6
  • Accessible HTML that screen readers can follow
  • Pages that load in under 3 seconds

Advanced

  • Structured data on your main pages, checked with a validator
  • API documentation with examples
  • A way to track and publish content changes

Tools and resources

Check your markup

Google's Rich Results Test shows which of Google's rich results (extras such as stars and prices in search listings) a page qualifies for, and validator.schema.org checks your structured data against the full vocabulary.

See what an agent sees

Load a page with JavaScript turned off, or fetch its raw HTML with the curl command shown in the structured data guide.

Code you can copy

The structured data, AI opt-out, and product feed guides above each include examples you can copy and adapt.

Further reading from Field Notes

Posts with more on this topic, each with its date.

All Field Notes