UGGAD

llms.txt: what it is and how to write one

A plain-text file at the domain root that tells AI agents what the site is. Template, rules, serving details and the mistakes that make it useless.

Title:llms.txt: What It Is and How to Write One Meta:llms.txt is a plain-text file that tells AI agents what your site is and which pages matter. Template, rules, mistakes and how to keep it current. H1:llms.txt: a plain-text map for AI agents Slug:/guide/llms-txt 主词:llms.txt(美国 3,600/月,竞争 LOW)


llms.txt is a Markdown file served at the root of a domain that describes the site for language models: what the business does, who it serves, and which pages are worth reading. It is not a ranking factor, not a replacement for robots.txt, and not an official standard. It is a hint — a cheap one — that saves an agent from guessing what your site is about when it arrives.

The reason it exists is structural. An AI agent that retrieves your homepage receives navigation, cookie banners, hero copy and a dozen links of equal apparent weight. It has no idea whether you are a manufacturer, a retailer, a blog, or a lead-generation page. A short text file answers that in three seconds of reading, which is often cheaper than parsing the site.

This guide covers what belongs in the file, how it differs from the other files at your domain root, how to write one that is actually useful, how to serve it correctly, how to tell whether it helps, and the mistakes that turn it into decoration.

Why a plain-text map exists

Retrieval pipelines operate under a budget. Every document they fetch costs tokens, latency and money, so an agent that can orient itself cheaply is more likely to fetch the right pages and less likely to fetch the wrong ones. The homepage is an expensive orientation document: it is large, it is mostly navigation, and its structure implies that all links matter equally.

A domain root file is the cheapest orientation document possible. It is one small text file, it sits at a predictable location, and it can state in one sentence what would otherwise require reading four pages to infer. That is the entire theory. Everything else is formatting conventions that the community has converged on by imitation rather than by specification.

The practical consequence: the value of llms.txt is highest for sites whose purpose is not obvious from their markup — manufacturers, B2B service firms, multi-brand portfolios, documentation-heavy product sites. It is lowest for sites where the homepage already says exactly what the site is in the first heading.

What belongs in the file

A useful llms.txt has four parts, in this order.

One sentence describing the business. Not a slogan. “Manufacturer of custom knitted socks for trampoline parks and retail brands, based in Zhejiang, shipping to the US and EU” is useful. “Redefining comfort, one sock at a time” is not, because it contains no fact an agent can use.

A short list of core pages, each with a phrase explaining it. Five to fifteen entries is the useful range. Each line should say what the page contains, not what it is called: “/process: sampling, bulk production and pre-shipment inspection steps” tells an agent more than “/process: Our Process”.

A contact point. An email address or a form URL. Agents increasingly answer “how do I contact them” questions, and a contact line that is unambiguous is cheaper than a crawl of the contact page.

Optional: notes on pricing model or minimum order. If your business has a structural fact that changes how a buyer would interpret everything else — minimum order quantity, made-to-order only, wholesale only — state it once here. It prevents an agent from describing your B2B factory as a consumer store.

What does not belong: a full sitemap, marketing claims, keywords, or a hundred URLs. The file competes with the agent’s attention span, and dumping the sitemap into it defeats the purpose.

A minimal template

# Example Knitting Co
> Manufacturer of custom knitted socks for trampoline parks and retail
> brands. Zhejiang, China. Ships to US, EU, AU. Wholesale only.

## Core pages
- /products: sock types, yarn options, grip sole constructions
- /capabilities: knitting gauges, monthly capacity, in-house processes
- /sampling: sample process, lead time, what a sample costs
- /process: bulk production and pre-shipment inspection steps
- /faq: minimum order, lead times, payment terms
- /contact: enquiry form and response time

## Notes
- Minimum order: per colour and per design, quoted separately
- Not a retailer: no single-pair sales

## Contact
sales@example.com

That file is under thirty lines. It answers what the business is, what the site contains, and what a buyer should know before interpreting anything else.

How it differs from the other root files

Four files at a domain root are commonly confused with each other. They answer different questions and are read by different systems.

File Question it answers Format Read by
robots.txt May this bot crawl this site? directives crawlers
sitemap.xml Which URLs exist and when did they change? XML crawlers and search engines
structured data (schema) What is this specific page about? JSON-LD in HTML search engines
llms.txt What is this site, in plain language? Markdown AI agents

Two practical implications follow. First, llms.txt does not grant or deny crawl permission; if robots.txt blocks a bot, the llms.txt will never be read. Second, llms.txt does not replace structured data; schema describes individual entities with machine-readable properties, while llms.txt describes the site as a whole in prose.

A useful analogy: sitemap.xml is the table of contents, schema is the index cards, robots.txt is the door policy, and llms.txt is the one-paragraph introduction at the front of the book.

Writing one that is actually useful

The quality difference between a useful and a useless llms.txt comes down to four decisions.

Describe pages by content, not by label. “Pricing: three tiers, monthly, credits for agencies” is useful. “Pricing: our pricing” is not. The phrase after the colon is the entire value of the line.

Order by importance to an unknown reader, not by navigation order. Navigation order reflects your site’s architecture. The reader’s question is different: what would someone need to know first? Usually that is what you make, then how you are different, then how to buy.

Keep it under a hundred lines. Beyond that, an agent will sample rather than read, and sampling a long file is no better than sampling the site.

State constraints once. Minimum order, wholesale-only, region restrictions, made-to-order. These are the facts that cause an agent to misrepresent a business when they are absent.

There is a fourth, less obvious decision: what to leave out. Do not list blog posts individually, do not list every product variant, do not include URLs with query parameters. The file is an introduction, not an inventory.

Serving it correctly

The technical requirements are minimal and easy to get wrong.

Location. https://example.com/llms.txt — the domain root, not a subdirectory. An agent looking for it will not search.

Content type. text/plain; charset=utf-8. Serving Markdown as text/html sometimes works and sometimes produces a rendered page full of tags.

Status and caching. Return 200, and cache it for a day rather than a year. It is a small file and staleness costs more than bandwidth.

No redirects. A redirect from a trailing slash variant, or from http to https, adds a failure point. Serve the exact path directly.

One per domain, not per language. If the site is multilingual, either describe the languages inside the file or provide the language map in the lines for core pages. Separate llms.txt per locale is not something agents expect to look for.

Telling whether it helps

llms.txt has no dashboard. You cannot see “agents who read llms.txt” in any analytics product, because the file is fetched by infrastructure, not by users. That does not mean it is unmeasurable; it means the measurement is indirect.

Server logs. Every fetch appears as a request for /llms.txt with an identifiable user agent. Counting requests by agent tells you which systems read it and how often. A file that is never fetched is a file that is not being looked for.

Crawl sequence. If an agent fetches llms.txt and then requests the pages listed in it — rather than the homepage and a random walk — the file is doing its job. That sequence is visible in the same logs.

Answer quality. The noisy but real signal: do AI answers about your business describe it accurately, including the constraints you stated? A file that stops an assistant from calling a wholesale factory a retail store has paid for itself, even if no metric moved.

What you should not expect: a ranking change, an immediate citation increase, or a visible traffic lift. Those come from the pages, not from the pointer to the pages.

A workflow that keeps it current

Most llms.txt files are written once and never updated, which makes them worse than absent: a stale map misdirects.

Generate the page list from the sitemap, then curate it by hand. Automated generation gives you coverage; curation gives you the descriptions that make the file useful. A reasonable split is one hour of automation and one hour of editing per quarter.

Review on three triggers. A site restructure, a new product line, or a change to commercial terms (minimum order, regions, pricing model). Those are the events that make the file wrong.

Version it in the repository. Treat it as content, not as an infrastructure file. If it lives in code review, it stays current; if it lives in a CMS with no owner, it decays.

Keep a short changelog in the file itself if the terms change often. One line — “Updated 2026-11: minimum order now quoted per design” — is enough for a reader to know the file is maintained.

Common mistakes

Writing a brochure. Slogans and adjectives in a file whose only purpose is orientation. An agent cannot do anything with “passionate about quality”.

Dumping the sitemap. Three hundred URLs with no descriptions. The file becomes a second sitemap, and agents ignore it.

Blocking the crawlers you want. A robots.txt that disallows the agent’s user agent, with a perfectly written llms.txt that will never be fetched.

Serving HTML. The file rendered as a web page, with navigation and footers, because the server treated .txt as unknown.

Never updating it. A file that describes a product line you discontinued two years ago actively misleads.

Using it as a keyword surface. Padding the descriptions with search terms. Agents read for orientation, and keyword stuffing reduces clarity, which is the opposite of the file’s purpose.

Assuming it is a standard. It is a convention. Some engines read it, some ignore it, and behaviour changes without notice. Adopt it because it is cheap, not because it is guaranteed.

How it fits into a GEO program

llms.txt is a twenty-minute fix inside a larger discipline. It belongs in the technical phase, alongside crawl access, static rendering, sitemap hygiene and valid schema.

Its role is narrow and real: it improves the probability that an agent that has already decided to look at your site understands it quickly. It does not create citations, and it does not compensate for content that cannot be quoted.

The order of operations that actually moves AI visibility: make the site retrievable, make passages quotable, make claims specific enough to be worth quoting, and get mentioned where engines already look. llms.txt sits in the first step. It is cheap, so do it early, but do not mistake it for the second step.

FAQ

Is llms.txt an official standard? No. It is a community convention that some AI agents and tools have adopted. It is not maintained by a standards body, and adoption is uneven, which is why it should be treated as a low-cost improvement rather than a requirement.

Does llms.txt improve rankings? Not directly. Search rankings come from relevance and authority signals. llms.txt may help an AI agent orient itself quickly, which can influence whether your pages are selected for citation, but that is a second-order effect.

Where exactly does the file go? At the domain root: https://yourdomain.com/llms.txt. Not in a subfolder, not at /docs/llms.txt. Agents that look for it request that exact path.

Should it be Markdown or plain text? Markdown, served as text/plain. The formatting — headings, list items, blockquote for the description — is what makes it scannable for both humans and models.

Can I generate it automatically? The page list, yes. The descriptions, not well. Automated descriptions tend to restate the page title, which is the least useful part of the line. Automate coverage, curate meaning.

Does it replace structured data? No. Schema describes entities and their properties on individual pages; llms.txt describes the site as a whole in prose. They operate at different levels and are read by different systems.

What if my site is multilingual? Keep one file and describe the languages inside it, either in the opening description or within the core page lines. Agents do not expect per-locale llms.txt files and will rarely find them.

Is it worth doing for a small site? Yes, because it costs almost nothing. For a ten-page manufacturer site, a fifteen-line file can be the difference between an agent describing you as a factory and describing you as a shop.

Checklist

  • File exists at https://yourdomain.com/llms.txt.
  • Served as text/plain; charset=utf-8, status 200, no redirects.
  • Opening blockquote states what the business does in one factual sentence.
  • Five to fifteen core pages, each with a description of its content.
  • Commercial constraints stated once (minimum order, regions, wholesale only).
  • Contact point present and unambiguous.
  • Under one hundred lines.
  • robots.txt does not block the agents you want to read it.
  • Reviewed after any site restructure or change in commercial terms.
  • Versioned in the repository with an owner.
  • Logs checked quarterly for fetches by agent user agent.

A file that takes twenty minutes and answers “what is this site” for an agent that arrived from a search result is a good trade. The mistake is treating it as a strategy rather than as plumbing — and plumbing is exactly what it is: unglamorous, inexpensive, and noticed only when it is missing.


内链:/guide/generative-engine-optimization、/guide/geo-metrics、/product/health-check、/audit 字数:约 2,600 英文词

Related