llms.txt Agent Index Format, Path Scope and Markdown Alternate Links
What llms.txt is, required Markdown structure, v2 discoverability links, path-scoped files, and how agents consume curated documentation.
This page summarises the llms.txt v2 proposal and related material from llmstxt.org, Chrome Lighthouse agentic browsing checks, and Cloudflare Docs for agents. The convention is a small, machine-readable Markdown index that tells coding agents and assistants where to find LLM-friendly detail on a site—without replacing robots.txt, sitemap.xml, or human-oriented HTML.
llms.txt: what it is and when you need one
Section titled “llms.txt: what it is and when you need one”An llms.txt file is an emerging convention for a machine-readable summary of a site’s content, aimed at large language models and AI agents.
The llms.txt file is an emerging convention used to provide a machine-readable summary of a website’s content, specifically designed for LLMs and AI agents.
— Chrome for Developers, llms.txt (Lighthouse agentic browsing)
Agents already pull documentation, product pages, and APIs from the live web. HTML is built for people: navigation, scripts, and layout make clean extraction slow and lossy, and full sites rarely fit in a model context window.
Agents now use websites constantly: a coding agent fetches a library’s documentation to get an API call right, and a chat assistant with search reads pages to answer questions about a product.
— llmstxt.org, The /llms.txt file, v2
You typically publish llms.txt when you want agents to start from a curated map (summary plus labelled links) instead of crawling HTML or guessing URLs. Software docs are the most common case; the same shape works for businesses, personal sites, or schools that want a guided path into policies or course material.
Cloudflare applies the same idea at scale: site-wide and per-product endpoints expose Markdown indexes and optional full dumps for bulk or offline use—see Docs for agents.
llms.txt file format: required sections and link lists
Section titled “llms.txt file format: required sections and link lists”The spec lives at a fixed name, llms.txt, at the site root (/llms.txt) or under a subpath (e.g. /docs/llms.txt). The file is Markdown with a fixed section order so parsers can handle it with regex or small programs—see Python source introduction and the JavaScript parser demo.
| Section | Required? | Purpose |
|---|---|---|
| Optional UTF-8 BOM | No | Encoding hint |
H1 (# title) |
Yes (only hard requirement) | Project or site name |
Blockquote (> summary) |
Expected in practice | Short summary agents need before following links |
| Body paragraphs/lists (no headings) | No | Extra guidance on how to use linked files |
| H2 sections with link lists | No | Named groups of resources (e.g. ## Docs, ## Examples) |
Each link list entry is a Markdown bullet: [title](url) with an optional : description after the URL.
# Title
> Optional description goes here
Optional details go here
## Section name
- [Link title](https://link_url): Optional link details
## Optional
- [Link title](https://link_url)Use concise, clear language. When linking to resources, include brief, informative descriptions. Avoid ambiguous terms or unexplained jargon.
— llmstxt.org, llms.txt in Different Domains
Markdown is strongly recommended for linked resources; HTML is often verbose. An ## Optional section is a naming convention for secondary links agents may skip when context is tight—not a machine directive in v2 (see below).
Path scope: which llms.txt applies to a URL
Section titled “Path scope: which llms.txt applies to a URL”v2 clarifies behaviour that v1 left implicit:
a file covers the pages under its path, and the most specific file applies. This is also what lets a site that only controls a path, such as a GitHub Pages project site, participate fully.
— llmstxt.org, Changes (v2)
So /docs/llms.txt describes content under /docs/. If several files could apply, agents should pick the most specific path. That mirrors index.html as a path-local entry point rather than only a single root metadata file (contrast with RFC 8615 /.well-known/, which cannot help path-only publishers—see Existing standards).
Markdown alternate URLs and rel link discoverability
Section titled “Markdown alternate URLs and rel link discoverability”Besides the index file, the proposal recommends Markdown versions of pages at predictable URLs:
- Append
.mdto the full page URL (page.html.md), or - Replace the extension (
page.md). - Directory URLs use
index.html.mdorindex.md.
v2 standardises how clients find the index and alternates without guessing:
rel=“alternate” type=“text/markdown” points to a page’s markdown version, and rel=“describedby” points to the llms.txt file that covers it, provided as HTML
<link>elements or an HTTPLink:header.— llmstxt.org, Changes (v2)
Example header form from the main proposal:
Link: </docs/page.html.md>; rel="alternate"; type="text/markdown", </docs/llms.txt>; rel="describedby"Headers can be set at the CDN or web server for non-HTML resources too. nbdev-generated sites already ship .md alongside HTML pages by default, which pairs well with llms.txt—see How to help LLMs understand your nbdev project.
How agents consume llms.txt (v2 expectations)
Section titled “How agents consume llms.txt (v2 expectations)”v1 described tooling that expanded an entire file into one context blob. v2 states a simpler workflow:
agents view or search the llms.txt to find what they need, then follow the relevant links, which should point to LLM-friendly content.
— llmstxt.org, Changes (v2)
The index stays small; detail is fetched on demand. A hypothetical editor flow in ed, the standard text editor illustrates the pattern: load llms.txt, parse sections, fetch URLs from Docs and Examples, optionally skip Optional, then build context for a model—similar to what IDEs like Cursor or VS Code might do.
The llms-txt Python package still offers parse_llms_file, create_ctx, and the llms_txt2ctx CLI to merge linked content into XML-style context; that is optional helper tooling, not part of the v2 consumption model itself.
Cloudflare-style site and product endpoints
Section titled “Cloudflare-style site and product endpoints”For large doc sets, indexes can nest:
| Endpoint | Role |
|---|---|
/llms.txt |
Site-wide index by product category, linking to per-product llms.txt files |
/llms-full.txt |
Full documentation in one file for offline indexing or very large contexts |
/{product}/llms.txt |
Scoped index (e.g. /workers/llms.txt) |
/{product}/llms-full.txt |
Full content for one product |
Replace /workers/ with any product path listed from /llms.txt—Docs for agents.
llms.txt vs robots.txt and sitemap.xml
Section titled “llms.txt vs robots.txt and sitemap.xml”| Mechanism | Primary audience | Typical use |
|---|---|---|
robots.txt |
Crawlers / indexing bots | What automated access is acceptable |
sitemap.xml |
Search indexing | Exhaustive list of human-facing URLs |
llms.txt |
Agents at inference time | Curated overview and LLM-friendly link targets |
llms.txt information is instead used on demand, when an agent needs information about a topic while assisting a user.
— llmstxt.org, The /llms.txt file, v2
A sitemap rarely lists Markdown alternates, may omit helpful external references, and is usually too large to load whole into a context window—so it does not replace a curated llms.txt.
Authoring practices, automation, and common mistakes
Section titled “Authoring practices, automation, and common mistakes”Practical authoring
Section titled “Practical authoring”- Start from README or onboarding copy for the H1 and blockquote (nbdev guide).
- Group links under clear H2 names (
Docs,Examples, API lists). - For Python libraries, tools like
pysym2mdcan generateapilist.txtfrom docstrings and link it fromllms.txt(nbdev guide).
Lighthouse expects a root file that follows the spec:
Create an llms.txt file and place it in the root directory of your website (for example, https://example.com/llms.txt). The file should follow the llms.txt specification and provide a concise Markdown summary of your site’s purpose and key links.
— Chrome for Developers, How to fix
Many doc platforms and CMS plugins can generate llms.txt and Markdown pages automatically; the Integrations section lists examples (Mintlify, GitBook, WordPress plugins, Docusaurus/VitePress plugins, and others).
Common mistakes
Section titled “Common mistakes”- Only HTML links in the index—agents work better when targets are Markdown or similarly compact text.
- Missing or vague link descriptions—harder for agents to choose the right URL under token limits.
- Oversized index—the file should remain an overview; bulk content belongs in linked files or a separate
llms-full.txtpattern (as Cloudflare documents). - Wrong path scope—placing
llms.txtat the root when only/docs/is agent-relevant (or the reverse) without matchingrel="describedby"coverage. - Treating
Optionalas auto-skipped in v2—agents may still read it; it is a human convention, not enforced semantics after v2 (Changes).
How to check this on your site
Section titled “How to check this on your site”-
Fetch
https://your-site/llms.txt(and any path-scoped file such ashttps://your-site/docs/llms.txt) and confirm an H1, summary blockquote, and well-labelled link lists per the format spec. -
Open a representative HTML page and verify a Markdown alternate via
rel="alternate" type="text/markdown"in HTML or aLink:response header, andrel="describedby"pointing at the coveringllms.txt(v2 changes). -
Run Chrome Lighthouse agentic browsing checks if you use Lighthouse, and address missing or non-conformant root
llms.txtas documented under “How to fix”. -
Optionally parse the file with the JavaScript parser demo or
parse_llms_filefrom thellms-txtpackage to catch structural errors before agents do. -
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about, and we will correct or clarify it.