MartechARTICLE

6 min read

The official llms.txt guide to getting your site read by generative AI

The official llms.txt guide to getting your site read by generative AI
Image: Sabrina Santos
Article · Martech
Reading
6 min
Tables
1
Code
1
In short

The llms.txt specification reached version 2 after two years of real-world adoption. See the checklist of required fields and how to measure whether it worked on your site.

What llms.txt solves (and what it doesn't)

AI agents (search-enabled chatbots, coding assistants, LLM crawlers) access pages constantly, but an HTML page carries menus, ads, and JavaScript that make clean text extraction difficult. The llms.txt specification, maintained at llmstxt.org, proposes a Markdown file at /llms.txt with a concise overview of the site, designed to fit within a model's context window and point to detailed content only when needed.

The proposal has two years of adoption behind it, according to the specification's own document: thousands of sites publish the file, documentation platforms generate it automatically, and Chrome's Lighthouse now audits its presence as part of agent-navigation checks. OpenAI, Anthropic, and Gemini publish llms.txt for their own developer documentation, reinforcing the format's informal adoption across the industry.

Structure of the llms.txt format with title, optional description, sections, and links organized in markdown
Structure of the llms.txt format with title, optional description, sections, and links organized in markdown. Credit: llmstxt.org.

This doesn't make llms.txt a substitute for robots.txt or sitemap.xml (see the table below). On its own, it also doesn't guarantee that a model will cite the site: the specification defines a format, not crawler behavior. What happens afterward (whether the agent reads, caches, summarizes, or ignores the file) depends on each provider and falls outside the spec.

Checklist: the fields the v2 spec requires

The structure described by the specification follows a fixed order, with only one mandatory section:

Expert views

What people are saying about it.

S&P Global signaled a possible downgrade of Nvidia's credit rating within 90 days, but the trigger isn't leverage: it's the web of crisscrossing deals the chipmaker has struck with its own AI customers.

Vanessa Guerrain an iMasters article · Read the article: S&P Puts Nvidia on Credit Watch Over Governance Risk, Not Debt

Alibaba has rolled out to the general public the feature that has Qwen Go place phone calls on the user's behalf to book a table, check on a lost item or follow up on a delivery, with a mandatory disclosure that an AI is speaking.

Lucas Cardosoin an iMasters article · Read the article: Alibaba's Qwen Go opens free AI calling for everyday tasks
  1. An optional BOM (byte-order mark) at the start of the file.
  2. An H1 with the project or site name: the only mandatory section in the entire document.
  3. A blockquote right after the H1, with a short summary containing the key information needed to understand the rest of the file.
  4. Zero or more free-text sections (paragraphs, lists) without a heading, with additional details.
  5. Zero or more H2 sections, each working as a "file list": items in the format [name](url): optional note.

Notice that, aside from the H1, everything else is technically optional. In practice, an llms.txt without a blockquote and without links is a valid file, but a useless one: it fails to fulfill the format's purpose, which is to give context and a path to the detailed content.

The convention, according to the specification, is to reserve an ## Optional section for secondary links that an agent can skip when it needs a shorter context. For technical SEO, this is, in practice, a form of editorial prioritization within the file itself.

Pages also need a machine-readable version

The specification's second pillar isn't the /llms.txt file itself, but the recommendation to publish a clean Markdown version of each relevant page, at the same URL with .md appended: page.html.md or page.md (and index.html.md / index.md when the URL has no file name).

For the client (agent) to find this version, the spec recommends two discovery mechanisms, which can coexist:

  • An HTML <link> element: rel="alternate" type="text/markdown" pointing to the page's Markdown version, and rel="describedby" pointing to the llms.txt that covers that path.
  • An HTTP Link header, which works even for resources that aren't HTML (such as the Markdown files themselves) and can be configured directly on the web server or CDN, without touching any page:
Link: </docs/page.html.md>; rel="alternate"; type="text/markdown", </docs/llms.txt>; rel="describedby"

The FastHTML project, cited as a reference in the specification itself, implements exactly this pairing: an llms.txt at /docs/ covering only the documentation pages, and each HTML page with its .md version mirrored at the same URL.

llms.txt is not sitemap.xml, nor robots.txt

The specification is explicit about what each file does, and mixing up the three is a common mistake in rushed implementations.

FileFor whomWhat it listsDoes it fit in a model's context?
robots.txtIndexing crawlersAccess rules (allowed/blocked)Not applicable
sitemap.xmlSearch enginesAll indexable URLs on the siteUsually not, it's too large
llms.txtAI agents / LLMsCurated overview, with links to the essentialsYes, by design

According to the document itself, sitemap.xml rarely lists Markdown versions, doesn't include links to external sites that would help with context, and covers too many documents to fit within a context window. robots.txt solves a different problem: what's acceptable to access, not what's relevant to understand. The three files coexist without conflict, each solving a different problem.

How to test before and after

The specification itself suggests the simplest test: take an agent, give it only the llms.txt as a starting point, and ask questions about the site's content. If the agent answers accurately and points to the right links, the file is doing its job. If it gets things wrong or makes things up, context is missing from the blockquote or from the link notes.

To measure real impact in production, you can go beyond manual validation:

  • User-agent log: filter the server log for GPTBot, ClaudeBot, PerplexityBot, and equivalent crawlers, and compare how many times each one hit /llms.txt before and after the file was published.
  • Citation rate: run the same questions about the product or documentation in a search-enabled chat (the kind of tool the specification cites as a use case) before publishing the file and again a few weeks later, recording whether the response cites the brand and how accurately.
  • .md page coverage: check, by sampling, whether the pages listed in llms.txt actually respond in .md with a 200 status and the Link header configured, because a dead link in the file is worse than not having one at all.

None of these three metrics is formally part of the spec, but they're a way to turn an implementation into data, instead of leaving the matter as a vague promise that AI understands the site better.

When it's worth implementing (and when it isn't)

For sites with technical documentation, APIs, or structured product content, the cost-benefit ratio is good: the file is plain text, with no complex build dependency, and several platforms (Mintlify, GitBook, VitePress via vitepress-plugin-llms, Docusaurus via docusaurus-plugin-llms, WordPress via Yoast SEO or AIOSEO, Wix) already generate it automatically.

The gain is smaller for small institutional sites without real technical documentation: an llms.txt with a generic H1 and blockquote doesn't help much more than a good meta description, because there's no "detailed file" at all to link to. And, as the document itself acknowledges, the expected use is mostly for inference (agents responding to a task), not for model training. Anyone expecting that publishing the file will change how an LLM is trained is aiming at the wrong effect.

It's worth remembering that robots.txt adoption took decades to become universal, and even so, not every crawler respects it. With llms.txt, the scenario is similar: it's an open convention, with no guarantee that every agent will read it, but with enough adoption (from AI labs themselves to the CMS plugin ecosystem) to justify testing it on any site that depends on being found through search or through an agent.

Translated from the Brazilian Portuguese original · Read the original

Read also