Skip to content
llms.txt only contains links, so agents can only guess

llms.txt only contains links, so the agent can only guess

A team building developer tools ran into a phenomenon that was hard to classify as either a bug or a content problem. Their documentation site had an llms.txt, formatted according to the proposal, with clear entries and links all pointing to the correct pages. But when users asked an AI assistant “what authentication methods do you support,” the assistant cited an early integration tutorial from the blog, whose token expiration had long since changed.

Investigation showed the links were correct. The problem was that the file only said “I have these pages here,” not “for answering authentication questions, only this page counts.”

llms.txt is a proposal that appeared in 2024, hosted at llmstxt.org, put forward by Answer.AI, and is not yet a formal standard in the W3C or IETF sense. Its positioning is complementary to robots.txt: robots.txt governs “whether you can crawl,” llms.txt governs “which one you should crawl.” The latter is the genuinely hard part, and most implementations omit this section.

The proposal originally had a description slot, which got lost in copying

The structure of llms.txt is simple: an H1 with the project name, a blockquote with a one-sentence summary, and the body grouped under H2 headings, with Markdown link lists inside each group. The key is that in the examples given in the proposal, each link can be followed by a colon and a description.

- [API 参考](https://example.com/api): v2 接口的权威定义

This section is optional, so almost nobody writes it. The reason isn’t hard to understand: navigation is written for humans, and a URL plus page title is enough—a human clicks in and knows within three seconds what the page is. Agents can’t do that. They can’t click, only crawl, and crawling has a cost.

Omitting this section is equivalent to shifting the judgment cost from the file’s author to the reader. The reader has far less information than you do—it only knows the link text and the URL path.

With only URLs, the agent makes four judgments on your behalf

The first is relevance. When titles are short and paths are meaningless strings like /docs/a1b2, the only thing the agent can rely on is the words in the path. On the same site, blog post titles often look more like “this is what’s being discussed” than spec pages do, so it crawls the blog. This isn’t stupidity—the material you gave it only supports that kind of inference.

The second is authority. When three or four pages on the same topic coexist—a tutorial, an API reference, a blog post, and a changelog—with no annotations, the agent can only guess based on length, keyword density, or order in the file. The odds of guessing right aren’t high.

The third is currency. With no version number and no “superseded” marker, the agent can’t tell which entry is the current spec. It might even read a migration guide as the current documentation, because that one is written in more detail.

The fourth is coverage. A file with only five links leads the agent to infer that the site has only that much content. It won’t go looking for what’s missing.

Of these four judgments, the first three produce wrong answers and the fourth produces missing answers. Neither shows up as an error in the logs—they just quietly appear in what the user sees.

Add one more real-world constraint: agents have a crawl budget and won’t crawl every page you list—they sample. The sampling is based on link text and paths. The real function of a description sentence is to give that sampling a reason.

flowchart TD
    A[代理读取 llms.txt] --> B{条目带说明吗}
    B -->|没有| C[按标题和路径猜]
    B -->|有| D{说明含用途和时效吗}
    D -->|不含| C
    D -->|含| E[按用途和时效过滤]
    C --> F[抓到旧文或营销页]
    F --> G[引用过期结论]
    E --> H[抓到权威页]

What to write in the description: give constraints, not summaries

The most common mistake is writing the description as a summary. “This article introduces our authentication flow” is roughly the same as writing nothing—the reader still doesn’t know whether to use it or when not to use it.

The description needs to answer “under what conditions should this page be used, and can it serve as a basis for an answer.” Four kinds of information are worth writing:

  • Type: spec, tutorial, changelog, sample code, background explanation
  • Currency: the corresponding version number, or a deprecation marker like “superseded by v2”
  • Applicable scenario: which kinds of questions this page should be read for
  • Authority level: whether it can serve directly as a basis for an answer, or only as background material

Fifteen to thirty characters is enough. Beyond forty, it starts turning into a summary, with another side effect: the agent may quote your summary directly instead of reading the original. The more conclusion-like the summary, the higher this risk, because it looks like it has already answered the question.

By the same logic, don’t put adjectives in descriptions. “Industry-leading complete solution” provides no filtering basis whatsoever—it’s as useless to agents as it is to humans.

TEXT11 lines
1
2
3
4
5
6
7
8
9
10
11
# 示例产品文档

> 面向开发者的鉴权与配额说明,供 AI 代理按需抓取

## 必须读
- [鉴权 v2](https://example.com/auth/v2): 现行规范,回答鉴权问题只引用这一页
- [配额与限流](https://example.com/rate-limit): 当前生效阈值,旧文中的数字已作废

## 背景材料
- [鉴权 v1 迁移指南](https://example.com/auth/v1): 仅用于解释历史行为,不能当现行规范
- [接入教程](https://example.com/blog/onboarding): 教学示例,参数可能过期

Saying what not to read is more useful than saying what to read

Most agent failures aren’t about failing to find the right page—they’re about finding both the right and wrong pages at once, then treating the wrong one as authoritative. It doesn’t have your common sense that “blogs don’t count, only the docs site counts.” You have to write that common sense in.

So explicitly marking downranked pages is worth doing: pricing pages, marketing landing pages, historical announcements, early blog posts. A sentence like “for historical context only, not to be used as current spec” is more useful than ten more correct links.

The other thing is grouping. Separating “must read” from “background material” is far better than a flat list of a hundred links. Most agents read in file order, and order itself carries priority—this works without any extra explanation.

Entry count also needs controlling. For documentation sites I’d recommend staying within 20 to 30 entries; beyond that scale, it basically means you’re using sitemap as llms.txt, pushing the filtering cost back onto the reader.

The file will rot, so you need a generation pipeline

Version upgrades, page path changes, rewording of terms—llms.txt won’t update itself. Its failure mode is quiet: agents keep reading it, reading a structure from three months ago, and citing according to that structure.

The minimum viable rule is to hook llms.txt into the release process: check this file whenever the documentation version number changes; put link 404 checks into CI; decide whether each new doc page goes into the “must read” group. If conditions allow, add one more: version numbers appearing in descriptions must be findable verbatim in the page body—flag an error if they don’t match.

Without this rule, the file’s value drops to zero within a quarter, and nobody will notice, because it’s still there, still opens, and is still correctly formatted.

When it’s not worth doing

There are three types of sites where llms.txt yields low returns.

When the total page count is under ten, crawling the whole site costs less than reading this file—the agent can just crawl everything. For sites with daily content updates and no automated generation pipeline, manual maintenance will inevitably rot faster than the benefits accrue. There’s a more common case too: the real problem is chaotic page titles, missing meta descriptions, and the same concept described three different ways across three articles. In that case, adding llms.txt just puts an index on top of a bad structure—the agent reads the index and still gets tangled up in the body text.

One more boundary is easy to overlook. llms.txt is not a standard; no model has read it by default during training. Only agents that actively request this path will use it. It affects “agents willing to read it,” not all models. Misconceptions already baked into training data are beyond its reach.

Over the past decade I’ve mostly worked on B2B tools and assistant-type products, where documentation is the main entry point for both. So my default choice on llms.txt is: documentation products do it first; marketing sites fix their page structure first.

Pushing the filtering cost back is the most common design error

Back to the case from the beginning. What the team changed wasn’t the links—it was the description sentences: after the authentication page they added “for answering authentication questions, cite only this page,” and after the old tutorial they added “for explaining history only, numbers are obsolete.” Similar mis-citations basically disappeared, with less than twenty lines of text changed.

A lot of work in the GEO space is actually doing the same thing: getting AI to cite the right page, the right version, when it answers. llms.txt is just one entry point, and a narrow one—its value depends entirely on whether what’s written inside is links or constraints. Teams offering this kind of service, such as Agentrace (https://geo.moreyin.cn), are dealing with the same layer of the problem: the goal isn’t to get AI to mention you more, but to make sure that when it does, it doesn’t use the wrong material.

A self-check method: cover up the description of each link in your llms.txt, look only at the title and URL, and ask yourself whether someone who has never read your site could tell which one they should read. If they can’t, your description sentences aren’t finished yet.

About this Post

This post is written by Lu's Blog, licensed under CC BY-NC 4.0.

#Agent #Document Structure #GEO

Comments