Sub topic 5
What llms.txt is for
This chapter assumes you know how a website is served over HTTP, can read Markdown, and understand in general terms what a large language model (LLM) and an AI assistant are. You do not need to have written an llms.txt file before.
The problem llms.txt tries to solve
An LLM that answers questions about your product has to read your documentation. Web pages make that harder than it looks. A typical documentation page contains navigation menus, cookie banners, footers, scripts, and styling markup. The useful text is a small part of the HTML. An LLM also has a limited context window, which is the amount of text it can consider at one time. Filling that window with page chrome wastes space and can bury the facts you want the model to see.
A second problem is discovery. A human visitor finds the right page through search, a sidebar, or a site map. An assistant that has been asked to "use the Example library" has to guess where the relevant pages are, or crawl the site and sort through everything it finds.
llms.txt is a proposal that addresses both problems with one file. It was suggested in 2024 by Jeremy Howard of Answer.AI. The idea is that a site publishes a short, curated, Markdown index at /llms.txt. The index describes the site in a sentence or two and links to the pages that matter most, ideally in plain Markdown form. A model or an agent that reads the file gets a map of the site and a cheap way to fetch the content.
The proposal is not a formal standard. It is not an RFC, it has no standards body behind it, and no one is required to implement it. It is a convention that site owners can follow and that tools may choose to read.
Who the file is written for
The most important design decision in the proposal is its intended reader. llms.txt is aimed at an LLM that is working at inference time. Inference time is the moment a model is answering a request, as opposed to training time, when the model is built from a large body of data.
Typical consumers are:
- A coding assistant in an editor that a developer has pointed at your documentation.
- An agent that browses the web to complete a task for a user.
- A retrieval pipeline that a developer builds, which loads your index and then fetches selected pages.
This differs from the audience of robots.txt. A robots.txt file talks to crawlers and says which paths they may request. An llms.txt file talks to a model that is trying to understand your site, and it says which pages are worth reading. One file is about permission. The other is about guidance.
| Question | robots.txt | llms.txt |
|---|---|---|
| Main purpose | Say which paths a crawler may request | Point a model to the best content |
| Typical reader | Crawler software | An LLM or agent, often at inference time |
| Format | Line-based directives | Markdown |
| Can restrict access | Asks compliant crawlers to stay out | No |
| Status | Long-standing convention, now an IETF standard (RFC 9309) | Community proposal |
What the file contains
The proposal fixes a small structure so that both people and programs can parse it. The file is Markdown, in this order:
- An H1 heading with the name of the project or site. This is the only required part.
- A blockquote with a short summary of the site.
- Optional paragraphs or lists with extra notes. These contain no headings.
- Zero or more H2 sections. Each holds a list of links, and each link can have a note after a colon.
One section name has a special meaning. A section titled Optional marks links that can be skipped when the reader is short on context.
# Example Docs
> Documentation for the Example library, a Python client for the Example API.
The quickstart is the best place to begin. All links point to plain Markdown pages.
## Docs
- [Quickstart](https://example.com/docs/quickstart.md): Install the library and make a first request
- [API reference](https://example.com/docs/api.md): Endpoints, parameters and error codes
## Optional
- [Changelog](https://example.com/changelog.md): Release historyThe file does the following work:
- The H1 and the blockquote tell the model what the site is before it reads anything else.
- The link lists give the model a short, prioritized reading list instead of a full crawl.
- The notes after each link let the model choose a page without opening it.
- The
Optionalsection lets an agent with a small budget drop the least important material.
The next chapter covers writing the file in detail. Here the point is the purpose: the file is an editorial choice about what a model should read first.
How a consumer is expected to use it
The proposal describes a simple flow. A tool fetches https://example.com/llms.txt, reads the summary and the link list, selects the links that fit the user's question, and fetches those pages. If the links point to Markdown versions of pages, the tool receives clean text with little noise.
The diagram below shows that flow.
Notice that every step in this flow depends on the consumer choosing to do it. Nothing in HTTP or in the file itself makes a tool look for llms.txt.
Where the idea came from
The proposal borrows from files that site owners already know. robots.txt shows that a well-known path at the site root can carry machine-readable information. sitemap.xml shows that a site can publish a list of its pages for machines. The llms.txt file takes the root-path convention of the first and the "here are my pages" role of the second, then changes two things: it uses Markdown instead of line directives or XML, and it adds human-written descriptions and a priority signal.
The choice of Markdown is deliberate. LLMs read Markdown well, people can write it without special tools, and ordinary scripts and parsers can process it with simple rules.
Where it fits best
The proposal was written with documentation-heavy sites in mind. Software libraries, APIs, and technical products benefit most, because users often ask an assistant for help with code, and the assistant's answer is only as good as the documentation it reads. Several documentation platforms and developer-tool companies publish the file, and some generate it automatically.
The idea is a poorer fit for other kinds of sites:
- A news site wants its articles found and attributed, and a link list adds little to that.
- A shop has thousands of product pages that change daily, and a hand-curated index cannot track them.
- A site with only a few pages has nothing to prioritize.
Common misunderstandings at this stage
Because the file has "llms" in its name and sits at the site root like robots.txt, people read more into it than the proposal says. Three misunderstandings come up often.
- "It tells AI companies not to train on my content." It does not. The format has no way to express a prohibition. Preferences about crawling and training belong in
robots.txtand in the usage-preference proposals covered in later chapters. - "Publishing it will make AI search engines cite my site." The proposal makes no such promise. Whether any given AI product reads the file is a question about that product, and you can test it with your own logs.
- "It replaces my sitemap." It does not. A sitemap is complete and machine-generated. An
llms.txtfile is short and selective by design.
The following chapters on limits and on measuring with logs go into these points with evidence. For now, hold a narrow definition: llms.txt is a curated, Markdown reading list that a model may use if it chooses to.
Summary of the model
- Purpose: guide an LLM to the most useful pages, in a form that is cheap to read.
- Reader: a model or agent at inference time, not a crawler deciding what it may fetch.
- Format: Markdown with an H1, a short summary, and H2 sections of annotated links.
- Status: a community proposal with voluntary adoption.
- Best fit: documentation and developer-focused sites.
Exercise
A colleague says, "We added llms.txt, so GPTBot will now stay away from our pricing pages." Explain what is wrong with this statement and say which file would be the right place to express that request.
Show answer
llms.txt is a reading list that guides a model toward useful pages. Its format has no directive for allowing or refusing access, so it cannot tell any crawler to stay away. The request to keep GPTBot out of the pricing pages belongs in robots.txt, for example a "User-agent: GPTBot" group with "Disallow: /pricing/". Even that is advisory, because only crawlers that choose to honor robots.txt will comply.
Exercise
Name the two parts of an llms.txt file that give a model context before it reads any linked page, and say what the Optional section is for.
Show answer
The H1 title and the blockquote summary give the model context. The Optional section holds links that can be skipped when the reader has limited context space, so an agent with a small budget can drop the least important material first.