llms.txt 是一项尚在提议中的约定:在 /llms.txt 放一个 Markdown 文件,为 AI 智能体概述网站,并链接到值得阅读的页面。 本指南介绍该提议的具体规定,给出一个可直接复制的文件,展示 60 个知名网站在该地址发布了什么,并提供一个验证您自己文件的脚本。随后报告谁读取了我们的文件:有请求点击了只存在于我们 llms 文件中的链接,其中三个自称 Claude,还有 ChatGPT、Claude、Gemini 和 Perplexity 在被要求使用该文件时的表现。 最后,它介绍了让智能体向网站的 AI 智能体提问、而不必再读取更多文件的那一行,Quickchat AI 的 AI assistant access 会为您准备好可复制的这一行。
读完后,您将得到三样东西:位于 /llms.txt 的有效文件、通过验证脚本的一次运行,以及从您自己的访问日志中统计出的、哪些用户代理请求了该文件。

下载 llms.txt 检查工具包。其中包含示例文件、验证脚本、十项检查清单、日志脚本和示例日志。您需要一个可以添加文件的网站、带有 curl 的终端,以及 Node.js 22 或更高版本。只有最后一步需要访问请求日志。
如果您已经有文件,可直接跳到验证文件。如果想先看证据,请阅读谁请求了我们的文件。
什么是 llms.txt?
llms.txt 是一个 Markdown 文件,为 AI 智能体提供网站的简短摘要,以及一份精选的链接列表,供其按需深入阅读。 Answer.AI 的 Jeremy Howard 于 2024 年 9 月 3 日在 llmstxt.org 发布了该提议,并在 2026 年 8 月修订为第 2 版。它描述了两件事:文件本身,以及一项建议,即页面应在可预测的地址提供自身的干净 Markdown 版本。
这个文件的用途是在回答时使用。提议中说,其信息“在智能体协助用户时,需要了解某个主题时按需使用”,并且作者预计它主要用于推理,而不是训练。智能体应当读取或搜索该文件,然后顺着与当前问题相关的链接继续读。

llms.txt 是标准吗?
llms.txt 是一项已发布的提议,没有任何标准化组织采纳它。 是否请求这个文件,由各家 AI 厂商和各个工具自行决定。现有的支持来自工具:文档平台可以生成该文件,Chrome 的 Lighthouse 有一项实验性审核来查找它。两者都会在下文介绍。
llms.txt 与 robots.txt 和站点地图有什么不同?
robots.txt 说明爬虫可以请求哪些 URL,站点地图列出所有供索引的 URL,而 llms.txt 是一份用 Markdown 写成的简短阅读清单。 三者不能互相替代。llms.txt 不授予也不拒绝任何访问,所以想控制 AI 爬虫的网站应在 robots.txt 中设置。
| 文件 | 它回答的问题 | 格式 | quickchat.ai 于 2026 年 11 月 24 日发布的内容 |
|---|---|---|---|
robots.txt | 哪些爬虫可以请求哪些路径? | 纯文本规则,RFC 9309 | 全部允许,并为七个 AI 爬虫标识设置了命名分组 |
| 站点地图 | 供搜索引擎使用,哪些 URL 存在? | XML,站点地图协议 | 33 种语言的 3,545 个 URL |
llms.txt | 这个网站是什么,智能体应先读哪几个页面? | Markdown | 291 个链接:290 个英文页面的 Markdown 版本和文档索引 |

llms-full.txt 和 llms-small.txt 是什么?
llms-full.txt 是一种约定:用一个文件容纳网站所有页面的全文,llms-small.txt 则是更短的变体。 两者都不属于该提议。它们来自文档工具:Mintlify 会为其托管的每个网站生成 llms.txt 和 llms-full.txt,starlight-llms-txt 插件则会生成全部三个。quickchat.ai 也发布这三个文件。完整文件包含博客文章,精简文件则不含。
全文文件可能非常大。下面的调查测量了其中几个。
第 1 步:llms.txt 文件长什么样?
一个有用的 llms.txt 包含:写有网站名称的 H1、引用块中的摘要、可选的自由文本,以及若干 H2 章节,每个章节是一列带说明的链接。 这是工具包中的示例文件。Northwind Bikes 是一家虚构的商店,使用的是保留的示例域名。
# Northwind Bikes
> Northwind Bikes sells city bikes and e-bikes online and from one store in Springfield. The pages below cover returns, shipping, warranty, sizing, servicing and store hours.
Every link below points to the Markdown version of a page. Remove .md from the URL for the HTML version. Prices are in USD.
## Help pages
- [Returns and exchanges](https://northwind-bikes.example.com/help/returns.md): Return windows, fees and how refunds are issued
- [Shipping and delivery](https://northwind-bikes.example.com/help/shipping.md): Costs, delivery times and where we ship
- [Warranty](https://northwind-bikes.example.com/help/warranty.md): What the frame, component and battery warranties cover
- [Bike sizing and fitting](https://northwind-bikes.example.com/help/sizing.md): Frame size by rider height
## Store
- [Store hours and test rides](https://northwind-bikes.example.com/stores/springfield.md): Opening hours, test rides and in-store pickup
## Optional
- [Servicing and repairs](https://northwind-bikes.example.com/service.md): Tune-up prices and turnaround times
复制它,替换名称和摘要,并列出您自己的页面。提议中说,文件“小到可以放进上下文”,而“细节在链接背后,只在需要时才去获取”。

llms.txt 的哪些部分是必需的?
只有 H1 是必需的。 其余都是可选的,但顺序是固定的:先是 H1,然后是引用块,再是不含标题的自由文本,最后是 H2 章节。在 H2 章节内,每个列表项是一个 Markdown 链接,后面可以跟冒号和说明。提议称之为“一种精确的格式,允许固定的处理方法”,这正是脚本能够检查该文件的原因。
链接应该指向哪些页面?
链接到智能体回答有关您网站的问题所需要的页面,并在有 Markdown 版本时指向该版本。 提议建议在页面自己的 URL 后加上 .md 来提供该版本,所以 /pricing 变成 /pricing.md,不含文件名的 URL 变成 index.md。列表要精选。站点地图已经列出了所有内容。
也可以链接到其他网站。提议自带的示例就链接到了 GitHub 上的一个参考页面。
Optional 章节是什么意思?
名为 Optional 的章节存放次要链接,智能体需要更短的上下文时可以跳过。 在提议的第 1 版中,配套工具会用这个名称来决定省略什么。第 2 版移除了该工具,现在这个名称只是一种约定,没有机械性的含义。
知名网站上的 llms.txt 文件是什么样的?
在我们 2026 年 11 月 24 日请求的 60 个知名网站中,有 33 个在 /llms.txt 返回了文本文件,其中 6 个完全符合提议的格式,没有任何问题。 样本是六个分组,每组十个网站,在请求之前选定。它不是网络的随机样本,每个网站都只在某一天从一台机器上请求过一次。

各组之间差别很大。十个 AI 开发者文档网站中有九个发布了文件,包括 OpenAI、Anthropic、Google 的 Gemini API、Mistral、Cohere、xAI 和 Perplexity 的文档。AI 公司的主站大多没有:10 个中有 7 个返回 404。在十个消费、电商和媒体网站中,只有 Shopify 有文件。有五个网站对我们的两个客户端都返回了拦截或质询页面,所以我们无法判断它们是否发布了该文件。
已发布的文件形态各异。OpenAI 和 Shopify 的遵循该格式,Intercom 的大部分是散文,Twilio 的开头没有标题。

| 文件 | 大小 | 链接数 | 值得注意的地方 |
|---|---|---|---|
| developers.openai.com/llms.txt | 2 KB | 41 | 索引的索引:大多数链接指向另一个 llms.txt,每个产品一个 |
| docs.anthropic.com/llms.txt | 12 KB | 958 | 重定向到另一个主机。列出了文档的每一个页面 |
| developers.cloudflare.com/llms.txt | 5 KB | 111 | 每个产品一个链接,各指向该产品自己的文件 |
| docs.stripe.com/llms.txt | 99 KB | 475 | 第一个章节之前先给出面向编程智能体的说明 |
| docs.github.com/llms.txt | 10 KB | 117 | 告诉智能体调用哪个 API 来获取页面列表和文章正文 |
| docs.cohere.com/llms.txt | 300 字节 | 2 | 两个指向各版本文件的链接,并说明任何章节 URL 都有自己的 llms.txt |
| shopify.com/llms.txt | 5 KB | 71 | 是电商网站,不是文档。没有任何问题 |
| twilio.com/llms.txt | 2.5 MB | 10,018 | 调查中最大的索引,第一行是一个列表项 |
结构检查在 33 个文件中的 27 个里发现了问题。

这些偏差都不会妨碍模型读取文件,因为模型无论如何都能读 Markdown。它们对解析该格式的软件才有影响。遵循提议的解析器会跳过没有链接的项目符号,也不会预期出现 H3。顶部没有 H1 的两个文件,来自 Twilio 和 Salesforce,是脚本直接判定为失败的仅有的两个。
全文文件有多大?
33 个网站中有 17 个还提供 llms-full.txt,其中最大的几个大到智能体无法在一次请求中读完。 Cloudflare 的有 11.9 MB,按每个 token 四个字节算,约合 300 万个 token。调查中的三个文件都超过了一百万个 token。

第 2 步:如何在自己的网站上发布 llms.txt?
以 text/plain 或 text/markdown 并带 charset=utf-8 在 /llms.txt 提供该文件,如果网站有构建步骤,就用已发布的页面生成它。
- 把文件保存为
llms.txt,放在网站从根目录提供服务的文件夹中。在大多数静态网站生成器中,这个文件夹是public/。 - 部署,然后用非浏览器客户端请求该文件:
curl -sS -o /dev/null -w '%{http_code} %{content_type} %{size_download} bytes\n' https://example.com/llms.txt
- 阅读结果。您希望看到
200、文本内容类型,以及与您的文件相符的大小。text/html表示服务器返回的是一个页面,而不是您的文件。 - 可选:告诉客户端文件在哪里。提议的第 2 版推荐两种标准链接关系,可作为每个页面
<head>中的<link>元素,或放在 HTTPLink头中:
<link rel="describedby" href="/llms.txt">
<link rel="alternate" type="text/markdown" href="/pricing.md">
第一个从任意页面指向覆盖它的 llms.txt。第二个从页面指向它自己的 Markdown 版本。
文件也可以放在子路径中。/docs/llms.txt 覆盖 /docs/ 下的页面,如果有多个文件适用,提议规定智能体应使用最具体的那一个。
手写文件适合只有少量链接的情况。页面移动或改名后它就会过时,所以要么指定负责人,要么自动生成。
quickchat.ai 如何生成 llms.txt?
quickchat.ai 在网站构建时,用提供 HTML 的同一批页面生成 /llms.txt、/llms-full.txt 和 /llms-small.txt,所以页面一变,文件就跟着变。 没有人手动编辑它们。

构建过程如下:
- 搜索引擎可以索引的每个英文页面都有一个 Markdown 版本,地址与原页面相同,只是加上
.md。博客文章直接复制自它的 Markdown 源文件。其他页面则由构建出的 HTML 转换而来:保留主要内容,移除脚本、样式和装饰性图形,把链接和图片 URL 改为绝对地址,保留页内锚点,并添加包含标题、描述和源 URL 的前置元数据。 - 有些内容是有意省略的。 翻译页面、
noindex页面和工具类页面没有 Markdown 版本。产品页面上装饰性的演示对话会被标记为跳过,因为编造的示例数据不应作为页面内容发布。 - 每个页面都会公布自己的 Markdown 版本,方式是在 head 中加入
<link rel="alternate" type="text/markdown">。 - 转换失败会让构建失败,所以索引不会悄悄丢掉某个页面。


文档是另一个使用 starlight-llms-txt 插件的 Starlight 构建。每个文档页面还有一个菜单,可以把页面作为 Markdown 打开,或打开全文文件。

如果您的网站没有构建步骤,llmstxt.org 上的集成列表列出了多个平台的生成器,其中有适用于 VitePress、Docusaurus、Drupal 和 WordPress 的插件。
第 3 步:如何验证 llms.txt 文件?
验证 llms.txt 文件要检查四件事:提供方式是否正确,结构是否遵循提议,每个链接是否可访问,以及它列出的是否是您想列出的页面。 本指南为您提供一份清单和一个由您自己运行的脚本。脚本执行前三项检查。它不是在线检查器。
如何手动检查 llms.txt?
四条 curl 命令即可覆盖提供方式。 把 SITE 设为您自己的地址。
SITE=https://example.com
# Status, content type and size
curl -sS -o /dev/null -w '%{http_code} %{content_type} %{size_download} bytes\n' "$SITE/llms.txt"
# First lines: expect "# Site name", not HTML
curl -s "$SITE/llms.txt" | head -n 3
# A client that is not a browser gets the same answer
curl -sS -A 'llms-txt-check/1.0' -o /dev/null -w '%{http_code}\n' "$SITE/llms.txt"
# Response headers of one linked Markdown file
curl -sSI "$SITE/pricing.md" | grep -i -E '^(HTTP|content-type|cache-control)'

完整清单共十项,列在下面,也在工具包的 checklist.md 中。前六项可以用命令检查。上面的四条命令覆盖提供方式,另外两项的命令在 checklist.md 中。
- 已提供。
/llms.txt在它所描述的主机上返回 HTTP 200,内容类型为text/plain或text/markdown,并带charset=utf-8。 - 不是回退页面。 正文以
#开头,且不是 HTML。 - 非浏览器客户端可以访问。 使用普通用户代理的请求得到相同的响应,没有机器人规则用质询页面来应答。
- 没有被屏蔽。
robots.txt没有禁止该路径,您想触达的爬虫也没有被禁止访问网站。 - 链接。 每个链接都返回 200。没有 URL 出现两次。
- 目标可读。 有 Markdown 或纯文本版本时,链接指向这些版本,并且它们以文本内容类型提供。
- 结构。 先是一个 H1,接着是引用块中的摘要,然后是 H2 章节,每个章节包含一列
[name](url): note形式的项目。 - 名称和覆盖范围。 链接文本是读者能认出的页面名称。列表包含您希望被读取的页面,不包含
noindex、私有或过时的页面。 - 负责人。 文件由构建生成,或有指定的负责人和复查日期。
- 大小。 索引小到可以在一次请求中读完,并且您知道每个全文文件的字节大小。
如何用脚本检查 llms.txt?
check-llms-txt.mjs 用一条命令执行提供方式、结构和链接检查,发现错误时以非零状态退出。 它需要 Node.js 22 或更高版本,没有任何依赖。
node check-llms-txt.mjs llms.txt # a local file: structure checks only, no network
node check-llms-txt.mjs https://example.com/llms.txt # a live file: delivery, structure and links
每条检查结果都有级别、检查 ID 和适用的行号:
| 检查 | 覆盖内容 | 依据 |
|---|---|---|
| D1 到 D7 | 提供方式:状态、重定向、内容类型、字符集、HTML 正文、大小、robots.txt | HTTP 和 RFC 9309 |
| S1 到 S9 | 结构:H1、摘要、标题层级、列表项、说明、重复项、链接文本 | 提议,外加三项编辑性检查 |
| L1 到 L4 | 链接:每个链接都返回 200,Markdown 链接以文本提供 | HTTP |
| X1 到 X3 | 相邻内容:llms-full.txt、站点地图的 URL 数量、第 2 版的两种链接关系 | 仅作为信息报告 |
错误表示文件没有被提供、不是 Markdown、缺少 H1,或链接指向无法加载的内容。警告表示与提议格式不一致,或可能是个错误。工具包的 README.md 列出了每项检查及其级别。
循环操作:运行脚本,阅读结果,改一处,再次运行。工具包里有一份包含七个典型错误的初稿,可供练习:
Welcome to Northwind Bikes
## Help pages
- Returns and exchanges
- [Shipping and delivery](https://northwind-bikes.example.com/help/shipping.md)
- [Shipping again](https://northwind-bikes.example.com/help/shipping.md)
- [Warranty](/help/warranty.md) - what the warranties cover
### Sizing

| 检查结果 | 行 | 修复方法 |
|---|---|---|
| S1: first non-blank line is not an H1 | 1 | 让文件以 # Northwind Bikes 开头 |
| S2: no blockquote summary | 1 | 添加一行以 > 开头、说明网站是什么的文字 |
| S4: list item has no link | 5 | 把 Returns and exchanges 改成 [Returns and exchanges](url) |
| S7: duplicate URL | 7 | 删除第二个指向运费页面的链接 |
| S4: text after the link is not a note | 8 | 把 - what the warranties cover 换成 : What the warranties cover |
| S6: URL is not absolute | 8 | 写出完整的 https:// 地址 |
| S3: heading deeper than H2 | 10 | 把它改成带列表的 H2,或删除它 |
脚本还能发现仅检查状态码会漏掉的情况。许多网站对所有未知路径都返回一个页面,有些还带着状态 200。遇到这样的响应,脚本会报告 Content-Type is text/html 和 body is HTML, not Markdown,并判定失败。
复制完整的验证脚本
#!/usr/bin/env node
// check-llms-txt.mjs 1.0: checks one llms.txt file. Node.js 22 or later, no dependencies.
//
// node check-llms-txt.mjs https://example.com/llms.txt delivery, structure and link checks
// node check-llms-txt.mjs ./llms.txt structure checks only, no network
//
// Options: --strict (warnings fail too), --json, --no-links, --max-links=500
// Exit status: 0 no errors, 1 errors (or warnings with --strict), 2 usage error.
//
// Structure rules follow the llms.txt proposal, v2 (https://llmstxt.org/). Checks marked
// "editorial" in the README are this script's own opinion and are never errors.
import { readFile } from 'node:fs/promises';
const USER_AGENT = 'check-llms-txt/1.0 (+https://quickchat.ai/post/llms-txt-explained)';
const AI_TOKENS = ['GPTBot', 'OAI-SearchBot', 'ChatGPT-User', 'ClaudeBot', 'Claude-User', 'Claude-SearchBot', 'PerplexityBot', 'Perplexity-User', 'Google-Extended', 'Applebot-Extended', 'CCBot'];
const INDEX_WARN_BYTES = 100_000;
const TIMEOUT_MS = 10_000;
const CONCURRENCY = 5;
const args = process.argv.slice(2);
const target = args.find((a) => !a.startsWith('--'));
const flag = (name) => args.includes(`--${name}`);
const maxLinks = Number((args.find((a) => a.startsWith('--max-links=')) ?? '=500').split('=')[1]);
if (!target || !Number.isInteger(maxLinks) || maxLinks < 0) {
console.error('usage: node check-llms-txt.mjs <https-url-or-path> [--strict] [--json] [--no-links] [--max-links=500]');
process.exit(2);
}
const findings = [];
let sitemapUrl = null; // the first Sitemap line in robots.txt, when there is one
const add = (level, id, message, line) => findings.push({ level, id, message, line });
const isUrl = /^https?:\/\//i.test(target);
const number = (n) => n.toLocaleString('en-US');
async function request(url, { method = 'GET', redirect = 'follow', maxBytes = 5_000_000, timeout = TIMEOUT_MS } = {}) {
const response = await fetch(url, { method, redirect, headers: { 'user-agent': USER_AGENT, accept: 'text/markdown, text/plain, */*' }, signal: AbortSignal.timeout(timeout) });
const chunks = [];
let size = 0;
let truncated = false;
if (method !== 'HEAD' && response.body) {
for await (const chunk of response.body) {
size += chunk.length;
if (size <= maxBytes) chunks.push(chunk);
else truncated = true;
}
}
return { status: response.status, headers: response.headers, body: Buffer.concat(chunks), size, truncated, url: response.url };
}
const tryRequest = (url, options) => request(url, options).catch((error) => ({ failed: error.name === 'TimeoutError' ? 'timed out' : error.cause?.code ?? error.message }));
const mediaType = (headers) => (headers.get('content-type') ?? '').split(';')[0].trim().toLowerCase();
const looksLikeHtml = (text) => /^\s*<(!doctype html|html)\b/i.test(text);
// ---- Delivery (URL mode only): D1 to D7 ----
let text;
let fileUrl = null;
if (isUrl) {
let url = target;
let response;
let hops = 0;
for (;;) {
response = await tryRequest(url, { redirect: 'manual' });
if (response.failed || response.status < 300 || response.status > 399 || !response.headers.get('location')) break;
if (++hops > 3) break;
url = new URL(response.headers.get('location'), url).href;
}
if (response.failed) {
add('error', 'D1', `request failed: ${response.failed}`);
} else if (hops > 3) {
add('error', 'D1', 'more than three redirects');
} else if (response.status !== 200) {
add('error', 'D1', `HTTP ${response.status}${hops ? ` after ${hops} redirect(s), at ${url}` : ''}`);
} else {
fileUrl = new URL(url);
if (hops) add(fileUrl.host === new URL(target).host ? 'info' : 'warn', 'D1', `redirected ${hops} time(s) to ${url}`);
const type = mediaType(response.headers);
const charset = /charset=([^;\s]+)/i.exec(response.headers.get('content-type') ?? '')?.[1]?.replace(/"/g, '').toLowerCase();
if (type === 'text/html') add('error', 'D2', 'Content-Type is text/html');
else if (type !== 'text/plain' && type !== 'text/markdown') add('warn', 'D2', `Content-Type is ${type || 'missing'}, expected text/plain or text/markdown`);
if (type !== 'text/html' && charset !== 'utf-8') add('warn', 'D2', charset ? `charset is ${charset}, expected utf-8` : 'Content-Type has no charset, add charset=utf-8');
try {
text = new TextDecoder('utf-8', { fatal: true, ignoreBOM: true }).decode(response.body);
} catch {
add('warn', 'D4', 'body is not valid UTF-8');
text = new TextDecoder('utf-8', { ignoreBOM: true }).decode(response.body);
}
const bytes = response.size;
const large = bytes > INDEX_WARN_BYTES && type !== 'text/html';
add(large ? 'warn' : 'info', 'D5', `${number(bytes)} bytes, about ${number(Math.round(bytes / 4))} tokens${large ? ' (editorial: over 100,000 bytes is large for an index)' : ''}`);
const shown = ['cache-control', 'content-encoding', 'last-modified', 'etag', 'x-robots-tag'].filter((h) => response.headers.get(h)).map((h) => `${h}: ${response.headers.get(h)}`);
add('info', 'D7', `${type || 'no content type'}${charset ? `; charset=${charset}` : ''}${shown.length ? ` | ${shown.join(' | ')}` : ''}`);
await checkRobots(fileUrl);
}
} else {
text = await readFile(target, 'utf8').catch(() => null);
if (text === null) {
console.error(`cannot read ${target}`);
process.exit(2);
}
}
// RFC 9309: the most specific matching rule wins, and Allow wins a tie.
function robotsVerdict(robots, agent, path) {
const groups = [];
let current = null;
let lastWasAgent = false;
for (const raw of robots.split(/\r?\n/)) {
const match = /^\s*(user-agent|allow|disallow)\s*:\s*(.*?)\s*(?:#.*)?$/i.exec(raw);
if (!match) continue;
const key = match[1].toLowerCase();
const value = match[2];
if (key === 'user-agent') {
if (!lastWasAgent) groups.push((current = { agents: [], rules: [] }));
current.agents.push(value.toLowerCase());
lastWasAgent = true;
} else if (current) {
current.rules.push({ allow: key === 'allow', pattern: value });
lastWasAgent = false;
}
}
const mine = groups.filter((g) => g.agents.includes(agent.toLowerCase()));
const rules = (mine.length ? mine : groups.filter((g) => g.agents.includes('*'))).flatMap((g) => g.rules);
let best = null;
for (const rule of rules) {
if (rule.pattern === '') continue;
const source = rule.pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*').replace(/\\\$$/, '$');
if (!new RegExp(`^${source}`).test(path)) continue;
if (!best || rule.pattern.length > best.pattern.length || (rule.pattern.length === best.pattern.length && rule.allow)) best = rule;
}
return { blocked: Boolean(best && !best.allow), named: mine.length > 0 };
}
async function checkRobots(url) {
const robots = await tryRequest(new URL('/robots.txt', url).href);
if (robots.failed || robots.status !== 200) return add('info', 'D6', `no robots.txt on ${url.host} (${robots.failed ?? `HTTP ${robots.status}`})`);
const body = new TextDecoder().decode(robots.body);
if (looksLikeHtml(body)) return add('info', 'D6', 'robots.txt returns an HTML page');
sitemapUrl = /^\s*sitemap\s*:\s*(\S+)/im.exec(body)?.[1] ?? null;
if (robotsVerdict(body, '*', url.pathname).blocked) add('warn', 'D6', `robots.txt disallows ${url.pathname} for every crawler`);
const blocked = AI_TOKENS.filter((token) => { const v = robotsVerdict(body, token, '/'); return v.named && v.blocked; });
add('info', 'D6', blocked.length ? `robots.txt disallows the whole site for: ${blocked.join(', ')}` : 'robots.txt allows the file and blocks none of the AI crawler tokens this script knows');
}
// ---- Structure (both modes): D3, D4, S1 to S9 ----
const sections = [];
const links = [];
if (text !== undefined) {
const BOM = String.fromCharCode(0xfeff);
if (text.startsWith(BOM)) add('info', 'D4', 'file starts with a byte order mark, which the proposal allows', 1);
if (looksLikeHtml(text)) add('error', 'D3', 'body is HTML, not Markdown', 1);
const firstSeen = new Map();
const h1 = [];
let first = null;
let quote = null;
let section = null;
let fenced = false;
(text.startsWith(BOM) ? text.slice(1) : text).split(/\r?\n/).forEach((raw, index) => {
const n = index + 1;
const line = raw.trimEnd();
if (/^\s*(```|~~~)/.test(line)) { fenced = !fenced; return; }
if (fenced || line.trim() === '') return;
first ??= { n, line };
const heading = /^(#{1,6})\s+(.+)$/.exec(line);
if (heading) {
const depth = heading[1].length;
if (depth === 1) h1.push(n);
else if (depth === 2) sections.push((section = { name: heading[2].trim(), line: n, items: 0 }));
else add('warn', 'S3', 'heading deeper than H2', n);
return;
}
if (quote === null && /^>\s?\S/.test(line)) quote = n;
const item = /^\s*[-*+]\s+(.*)$/.exec(line);
if (!item) return;
if (section) section.items += 1;
const link = /^\[([^\]]*)\]\(([^)\s]+)\)(.*)$/.exec(item[1]);
if (!link) {
if (section) add('warn', 'S4', 'list item in an H2 section has no [name](url) link', n);
return;
}
const [, label, url, rest] = link;
const hasNotes = /^:\s*\S/.test(rest);
links.push({ url, hasNotes, line: n });
if (rest.trim() !== '' && !hasNotes) add('warn', 'S4', 'text after the link is not in the ": notes" form', n);
if (!section) add('warn', 'S5', 'link is outside any H2 section', n);
if (!/^https:\/\//i.test(url)) add('warn', 'S6', 'URL is not an absolute https URL', n);
if (firstSeen.has(url)) add('warn', 'S7', 'duplicate URL', n); else firstSeen.set(url, n);
const name = label.trim();
if (name === '' || name === url || /^\/\S*$/.test(name) || /^https?:\/\//i.test(name)) add('warn', 'S8', 'link text is a path or URL, not a name (editorial)', n);
});
if (!first || !/^#\s+\S/.test(first.line)) add('error', 'S1', 'first non-blank line is not an H1', first ? first.n : 1);
if (h1.length > 1) add('error', 'S1', 'more than one H1', h1[1]);
if (quote === null || (sections.length > 0 && quote > sections[0].line)) add('warn', 'S2', 'no blockquote summary between the H1 and the first H2', h1[0] ?? 1);
for (const s of sections) if (s.items === 0) add('warn', 'S4', 'H2 section has no list', s.line);
const optional = sections.filter((s) => s.name.toLowerCase() === 'optional');
if (optional.length > 1) add('warn', 'S9', 'more than one Optional section', optional[1].line);
if (optional.length === 1 && sections.at(-1) !== optional[0]) add('info', 'S9', 'Optional is not the last section', optional[0].line);
}
// ---- Links and neighbours (URL mode only): L1 to L4, X1 to X3 ----
async function pool(items, worker) {
const queue = [...items];
await Promise.all(Array.from({ length: CONCURRENCY }, async () => { while (queue.length) await worker(queue.shift()); }));
}
const notAFile = findings.some((f) => f.level === 'error' && (f.id === 'D2' || f.id === 'D3'));
if (fileUrl && text !== undefined && !notAFile) {
const unique = [...new Map(links.map((l) => [new URL(l.url, fileUrl).href, l.line])).entries()];
const sameHost = unique.filter(([href]) => new URL(href).host === fileUrl.host);
add('info', 'L3', `${number(unique.length - sameHost.length)} of ${number(unique.length)} links point to other hosts`);
if (!flag('no-links') && unique.length) {
const checked = unique.slice(0, maxLinks);
let markdown = 0;
await pool(checked, async ([href, line]) => {
let response = await tryRequest(href, { method: 'HEAD' });
if (response.failed || response.status !== 200 || !response.headers.get('content-type')) response = await tryRequest(href);
if (response.failed) return add('error', 'L1', `link failed (${response.failed}): ${href}`, line);
if (response.status !== 200) return add('error', 'L1', `link returns HTTP ${response.status}: ${href}`, line);
const type = mediaType(response.headers);
const isText = type === 'text/markdown' || type === 'text/plain';
if (isText) markdown += 1;
if (/\.(md|mdx|txt)$/i.test(new URL(href).pathname) && !isText) add('warn', 'L2', `link ends in .md or .txt but is served as ${type || 'an unknown type'}: ${href}`, line);
});
add('info', 'L4', `${number(markdown)} of ${number(checked.length)} checked links return Markdown or plain text${unique.length > checked.length ? ` (stopped after ${number(maxLinks)} links)` : ''}`);
}
const full = await tryRequest(new URL('llms-full.txt', fileUrl).href, { maxBytes: 4096, timeout: 60_000 });
if (!full.failed && full.status === 200 && !looksLikeHtml(new TextDecoder().decode(full.body))) add('info', 'X1', `llms-full.txt exists beside the index: ${mediaType(full.headers)}, ${number(full.size)} bytes, about ${number(Math.round(full.size / 4))} tokens`);
else add('info', 'X1', 'no llms-full.txt beside the index');
const big = { maxBytes: 60_000_000, timeout: 30_000 };
const sitemap = await tryRequest(sitemapUrl ?? new URL('/sitemap.xml', fileUrl).href, big);
if (!sitemap.failed && sitemap.status === 200) {
const locs = (xml) => [...xml.matchAll(/<loc>\s*([^<\s]+)\s*<\/loc>/g)].map((m) => m[1]);
const xml = new TextDecoder().decode(sitemap.body);
let urls = locs(xml).length;
let note = '';
if (/<sitemapindex/i.test(xml)) {
const children = locs(xml);
urls = 0;
await pool(children.slice(0, 20), async (child) => {
const part = await tryRequest(child, big);
if (!part.failed && part.status === 200) urls += locs(new TextDecoder().decode(part.body)).length;
});
note = ` in ${number(Math.min(children.length, 20))} of ${number(children.length)} child sitemap(s)`;
}
add('info', 'X2', `the sitemap lists ${number(urls)} URLs${note}; the file lists ${number(unique.length)} links`);
}
const home = await tryRequest(new URL('.', fileUrl).href);
if (!home.failed && home.status === 200) {
const html = new TextDecoder().decode(home.body);
const tags = html.match(/<link\b[^>]*>/gi) ?? [];
const header = home.headers.get('link') ?? '';
const describedBy = /rel="?describedby"?/i.test(header) || tags.some((t) => /rel=["']?describedby/i.test(t) && /llms\.txt/i.test(t));
const alternate = /type="?text\/markdown/i.test(header) || tags.some((t) => /rel=["']?alternate/i.test(t) && /text\/markdown/i.test(t));
add('info', 'X3', `${new URL('.', fileUrl).pathname} ${describedBy ? 'advertises' : 'does not advertise'} the file with rel="describedby" and ${alternate ? 'links' : 'does not link'} a Markdown version of itself with rel="alternate"`);
}
}
// ---- Report ----
const count = (level) => findings.filter((f) => f.level === level).length;
const summary = { sections: sections.length, links: links.length, linksWithNotes: links.filter((l) => l.hasNotes).length, errors: count('error'), warnings: count('warn') };
const failed = summary.errors > 0 || (flag('strict') && summary.warnings > 0);
const out = [];
if (flag('json')) {
out.push(JSON.stringify({ target, summary, findings }, null, 2));
} else {
const groups = new Map();
for (const f of findings) {
const key = `${f.level}\t${f.id}\t${/^link (failed|returns|ends)/.test(f.message) ? f.message.replace(/: \S+$/, '') : f.message}`;
groups.set(key, [...(groups.get(key) ?? []), f]);
}
const order = { error: 0, warn: 1, info: 2 };
const family = { D: 0, S: 1, L: 2, X: 3 };
const rank = (key) => { const [level, id] = key.split('\t'); return order[level] * 1000 + family[id[0]] * 100 + Number(id.slice(1)); };
for (const [key, group] of [...groups].sort((a, b) => rank(a[0]) - rank(b[0]))) {
const [level, id, message] = key.split('\t');
const lines = group.map((f) => f.line).filter((n) => n !== undefined).sort((a, b) => a - b);
const where = lines.length ? ` (${lines.length === 1 ? 'line' : 'lines'} ${lines.slice(0, 3).join(', ')}${lines.length > 3 ? `, and ${number(lines.length - 3)} more` : ''})` : '';
out.push(`${level.toUpperCase().padEnd(5)} ${id.padEnd(3)} ${message}${where}`);
if (id.startsWith('L') && level !== 'info') for (const f of group.slice(0, 5)) out.push(` ${f.message.split(': ').at(-1)}`);
}
out.push(`Sections: ${summary.sections}. Links: ${number(summary.links)} (${number(summary.linksWithNotes)} with notes). Errors: ${summary.errors}. Warnings: ${number(summary.warnings)}.`);
out.push(failed ? 'FAIL' : summary.warnings ? 'PASS with warnings' : 'PASS');
}
// Exit only after the report is flushed, so piped output is never cut short.
process.stdout.write(`${out.join('\n')}\n`, () => process.exit(failed ? 1 : 0));
Chrome 里有 llms.txt 验证器吗?
Chrome 的 Lighthouse 有一项实验性的 llms.txt 审核,它只检查一件事:服务器对该文件是否返回错误。 根据它的文档,当获取该文件导致服务器错误时,Lighthouse 会标记该页面;当文件不存在时,它会把审核标为 Not Applicable,因为“目前提供该文件是可选的”。它不检查结构或链接。该审核属于 Agentic Browsing 类别,需要 Chrome 150 或更高版本。
如何在每次部署时保持 llms.txt 有效?
在构建流水线中运行检查,这样缺失的页面、失效的链接或错误的内容类型就会阻止部署。 脚本的退出状态让这只需一行。使用 --strict 时,警告也会让运行失败:
node check-llms-txt.mjs https://staging.example.com/llms.txt --strict
第 4 步:AI 助手和爬虫会读取 llms.txt 吗?
在我们 2026 年 11 月 24 日的测试中,助手只有在我们明确要求时才会读取该文件,而且只有具备打开 URL 工具的助手才能做到。 另外,在 2026 年 10 月 13 日至 11 月 23 日之间,有 13 个问题通过只存在于我们 llms 文件中的一行到达了我们的支持智能体,其中三个来自自称 Claude 的请求。
哪些请求点击了只存在于我们 llms 文件中的链接?
在 2026 年 11 月 23 日结束的一次试点期间,quickchat.ai/llms.txt 和 quickchat.ai/docs/llms.txt 各有一条 Ask 行:一个指向页面的链接,我们自己的支持智能体会在该页面回答问题。 这一行写的是“Ask Quickchat AI a question:”,后面是一个以 ?q=your+question 结尾的地址。该地址带有一个标签,说明它来自哪个文件,而没有任何 HTML 页面使用这个标签。所以,带这个标签的请求,要么读过我们的某个 llms 文件,要么是被读过它的程序递来了这个链接。
2026 年 10 月 13 日至 11 月 23 日,通过这些行回答了 13 个问题:8 个来自文档索引,5 个来自营销站点的文件。
- 3 个自称 Claude。 它们的用户代理包含
Claude-User/1.0; +claude-user@anthropic.com,这是 Anthropic 在文档中说明的、用于用户触发请求的名称。第一个在 10 月 26 日通过营销站点的那一行到达,问题是“What is Quickchat AI?”。另外两个在 11 月 7 日通过文档索引到达,两次 Claude 都把your+question占位符换成了它自己的词:“webhook when conversation ends transcript”和“pre-chat screen required fields email phone”。 - 4 个来自
curl,6 个来自我们自己带标签的测试工具。 - 另有 8 个请求打开了链接但没有带问题,因此没有生成回答。其中四个来自爬虫和工具(OraBot、CrawlCheck、AgentDrivesAgent,以及一个声明为 GoogleOther 的),四个声明为通用桌面浏览器。
- 没有任何一个声明为 ChatGPT-User、Perplexity-User、GPTBot、ClaudeBot 或 Googlebot。

11 月 7 日的这两个问题读起来像是助手写的搜索查询,而不像是人输入的内容。我们看不到 Claude 一侧的对话,而且身份是由请求自己声明的,没有经过验证。三个问题说明这条路径行得通。它们并不能证明助手普遍会读取 llms.txt。

11 月 23 日,这些行随试点地址一起停用。自 11 月 28 日起,两个文件再次带有指向我们支持智能体的 Ask 行,详见下文。
这些数字只涵盖点击了某一个链接的请求,不含对文件本身的请求,后者由 CDN 提供。下面的日志命令可在您自己的网站上进行这项测量。
如何检查自己的日志?
在您自己的访问日志中,按声明的用户代理统计对该文件的请求,并与同一批用户代理对普通页面的请求对照。 对于组合格式的 nginx 或 Apache 日志,下面这一行命令会列出谁请求了 llms 文件:
awk -F'"' '$2 ~ /^GET \/(docs\/)?llms(-full|-small)?\.txt([? ]|$)/ {print $6}' access.log | sort | uniq -c | sort -rn | head -30
工具包中的 who-requests-llms.sh 会按用户代理输出一张表,把 llms 文件、Markdown 版本、普通页面和 robots.txt 并排列出。先在示例日志上试一试:
sh who-requests-llms.sh sample-access.log
declared agent llms markdown pages robots
other 6 0 15 0
GPTBot 2 0 5 2
bingbot 1 0 3 0
ChatGPT-User 1 1 2 0
PerplexityBot 1 2 2 0
Claude-User 1 0 1 0
Googlebot 0 0 5 4
OAI-SearchBot 0 0 4 1
ClaudeBot 0 0 2 2
Perplexity-User 0 0 1 0
示例日志是编造的,所以这些数字没有意义。请在您自己的日志上运行脚本,并从结果中看三件事:哪些用户代理会请求这个文件,同样的用户代理是否也请求它所链接的 Markdown 版本,以及两者与它们对普通页面的请求相比如何。
请记住四点限制。用户代理只是一种声明,所以在相信某个名称之前,请把客户端的地址与各厂商公布的地址范围对比。从 CDN 缓存提供的响应不会到达源站的日志。请求不能证明答案用到了该文件。厂商先前存储的内容不会产生新的请求,下面 Perplexity 测试中的旧副本就是这样。
当您要求助手使用该文件时,它们会怎么做?
在我们 2026 年 11 月 24 日的测试中,ChatGPT(API 和搜索界面)以及 Gemini 的界面在被给出地址后读取了该文件。没有任何助手在未被要求时使用它。 我们向 ChatGPT、Claude、Gemini 和 Perplexity 发送了三个提示:
Prompt 1: Using the live website quickchat.ai, summarize the plans on its pricing page.
Prompt 2: Fetch https://quickchat.ai/llms.txt and list the first five links in it.
Prompt 3: Check whether quickchat.ai publishes an llms.txt file. If it does, use it to find the pricing page and summarize that page.
请先看提示 1 的结果。当提示没有提到该文件时,没有任何助手使用它。

- 没有被要求时,没有助手使用该文件。 对于第一个提示,每个作出回答的助手都去了 HTML 定价页面或搜索结果。有一次 Perplexity 的运行还在来源中列出了我们某个文档页面的 Markdown 版本。
- 给出地址后,有获取工具的助手会读取它。 在三次运行中,ChatGPT 每次都返回了实时文件的前五个链接,Gemini 的界面也是如此。我们使用的 Claude 配置只有搜索工具,没有打开 URL 的工具,所以做不到。通过 API 使用搜索增强的 Gemini 两次回答该地址不存在 llms.txt。这是错误的。该文件不在它的搜索结果中。
- 有一个答案来自旧副本。 一次 Perplexity 运行列出了五个链接,
about-us.md排在第二位。我们在七天前的 11 月 17 日就删除了这个页面,所以这份列表来自文件的存储副本,而不是回答时发出的请求。 - 有一个助手走完了提议所描述的路径。 被要求找到并使用该文件时,ChatGPT 的搜索界面打开了 llms.txt,找到
/pricing.md的条目,并总结了该 Markdown 页面。一次 Perplexity 运行引用了文件中的/pricing.md条目,但总结的是 HTML 页面。其他助手使用了搜索,或无法打开该文件。
这是同一天收集的 30 个答案,通过 DataForSEO 获得。API 行使用了开启联网搜索的 gpt-6.1-terra、claude-sonnet-5-5、gemini-3.8-flash 和 sonar。界面行是未登录的消费级产品。API 的答案不等于消费级产品,两者的工具权限也不同,Claude 一行就说明了这一点。
带有获取工具的智能体如何使用 llms.txt?
2026 年 11 月 28 日,一个使用标准获取工具(Claude Code 所用的客户端)的 Claude 智能体,从我们的文档索引找到一个列出的文件,再找到包含答案的页面:23 秒内共 3 次获取。 它只需要知道一个事实:如何让网站小组件在页面加载时自动打开。我们让它从 https://quickchat.ai/docs/llms.txt 开始,并且不得使用它没有在已获取的文件中找到的地址。当时索引中没有 Ask 行。
| 获取 | 读取的内容 | 原因 |
|---|---|---|
| 1 | /docs/llms.txt,即索引 | 起点。智能体一次读完 |
| 2 | 索引中列出的 Channels 文件 | 它的说明“Deploy the AI Agent across API, website widget, messaging apps, and helpdesk integrations”使它成为显而易见的下一个文件 |
| 3 | /docs/channels/website,由该文件链接 | 答案就在其中:在 Channels → Your Website → Appearance → Other Settings 下开启 Auto-open Widget |
一次运行只是说明,不是测量。它支持本指南已经给出的两条建议。给每个链接加一句话说明,因为智能体是根据说明选择下一个文件的。并且优先链接单个页面,而不是一个非常大的合并文件,这样下一次获取到的就是能回答问题的页面。当被问到直接提问的那一行是否会有帮助时,智能体回答“Probably yes”。
AI 厂商在文档中如何谈到 llms.txt?
我们查阅的爬虫文档中,没有一份说爬虫或助手会请求 llms.txt。 我们在 2026 年 11 月 24 日阅读了各厂商的页面。
| 厂商 | 用户代理标识 | 文档中的作用 | 该文档对 llms.txt 的说法 |
|---|---|---|---|
| OpenAI | GPTBot, OAI-SearchBot, ChatGPT-User, OAI-AdsBot | 训练抓取、搜索索引、用户触发的获取、广告落地页检查 | 没有提到。它的开发者文档发布了 llms.txt |
| Anthropic | ClaudeBot, Claude-User, Claude-SearchBot | 训练抓取、用户触发的获取、搜索索引 | 没有提到。它的开发者文档发布了 llms.txt |
| Perplexity | PerplexityBot, Perplexity-User | 搜索索引、用户触发的获取 | 没有提到。它的文档发布了 llms.txt,并引导智能体使用它 |
Googlebot, GoogleOther, Google-Agent, Google-GeminiNotebook | 搜索抓取、通用抓取、代表用户操作的智能体、用户添加到笔记本的来源 | Google 搜索会忽略该文件,详见下一节 | |
| Apple | Applebot | 搜索抓取,其数据也可能用于训练 | 没有提到 |
许多 robots.txt 文件中出现的 Google-Extended 和 Applebot-Extended,是发布者为了选择退出 AI 训练而禁止的名称,两者都没有自己的用户代理。您的日志中不会出现它们。
Google 对 llms.txt 是怎么说的?
Google 搜索说它会忽略 llms.txt,而 Chrome 的 Lighthouse 会对它进行审核。 Google 的生成式 AI 优化指南把该文件列在 Google 搜索可以忽略的事项中:创建它“既不会损害也不会提升您的网站在 Google 搜索中的可见度或排名,因为 Google 搜索会忽略它们”。同一段还说,为其他使用它的服务维护该文件也是可以的。

这两种说法针对的是不同的产品。一个涉及 Google 搜索中的排名。另一个涉及代表某人浏览网站的智能体,这正是提议所描述的用途。
规模最大的公开研究怎么说?
Ahrefs 的一项研究涵盖 137,000 个网站,发布于 2026 年 6 月 15 日,发现其中 28% 有 llms.txt 文件,而这些文件中有 97% 在 2026 年 5 月没有收到任何请求。 在确实到达文件的请求中,96% 来自机器人,19.5% 来自指明身份的 AI 工具,12% 来自研究 llms.txt 的工具,例如检查器。
您应该为网站添加 llms.txt 吗?
如果可以用已发布的页面生成 llms.txt,就添加它,并根据自己的请求日志决定是否继续投入。
| 情形 | 建议的做法 | 依据 |
|---|---|---|
| 使用支持 llms.txt 的框架或平台的文档网站 | 打开该功能,让构建过程生成这些文件 | 在我们的调查中,10 个 AI 开发者文档网站里有 9 个发布了它 |
| 有构建步骤的营销网站 | 在构建中生成 Markdown 版本和索引,并增加检查 | quickchat.ai 的做法 |
| 手动编辑或使用没有构建流程的 CMS 的网站 | 只有在有人负责维护时才发布简短的索引 | 过时的链接无法通过清单 |
robots.txt 屏蔽 AI 爬虫的网站 | 先确定访问策略 | 被 robots.txt 屏蔽的客户端不会读取该文件 |
| 任何网站 | 一个月后查看日志,然后决定保留、简化或移除该文件 | 第 4 步 |
Google 说该文件对 Google 搜索没有影响,上面提到的厂商文档也没有一份承诺会带来引用。AI 回答中的可见度是一个更大的话题,我们关于生成式搜索优化的文章对此有所介绍。我们的指南如何被 ChatGPT 引用介绍了如何检查您的帮助页面是否回答了买家提出的问题。
网站还能为 AI 助手提供什么?
除了 llms.txt 这样的静态文件,网站还可以提供一个页面,让助手向其 AI 智能体提问,并提供一个在浏览器中注册的工具。 Quickchat AI 把这两者都内置为 AI assistant access:在 AI assistants 卡片上(Channels → Your Website → Install,位于 What’s ChatGPT telling your customers? 下方),选择 Visitors + AI assistants 或 AI assistants only。无需写代码,您的智能体就会有一个公开的回答页面,小组件还会添加两个隐藏链接并注册一个 WebMCP 工具。该卡片还会给您可放进 llms.txt 的那一行。

llms.txt 中的 Ask 行是什么?
Ask 行是 llms.txt 中的一个列表项,它链接到一个页面,您的 AI 智能体会在该页面回答问题,问题所在的位置是一个占位符。 读取索引的智能体就可以直接提一个问题,而不必再读取更多文件。对 Quickchat AI 智能体来说,这一行如下所示:
- [Ask Northwind Bikes](https://app.quickchat.ai/ask/AGENT_ID/?q=YOUR_QUESTION&source=llms): Ask our AI agent about our products, services and policies. Replace YOUR_QUESTION with your URL-encoded question. Answers come with source links.
在 AI assistants 卡片上,打开 Help AI assistants find you,复制 Line for your llms.txt。把它放在 H2 章节内,例如第 1 步示例中的 ## Help pages 下。这时脚本会输出 Sections: 3. Links: 7 (7 with notes). Errors: 0. Warnings: 0. 和 PASS。
自 2026 年 11 月 28 日起,我们的两个 llms 文件都带有这样一行,指向我们的支持智能体:quickchat.ai/docs/llms.txt 中既有描述下面的一句话,也有 ## Optional 下的一个链接,quickchat.ai/llms.txt 中则是紧跟在文档索引链接之后的一个链接。
可以提问的页面是如何工作的?
回答页面每次请求根据智能体的 Knowledge Base 回答一个问题。 q 参数中的问题会得到一个 HTML、Markdown 或 JSON 格式的答案及其来源,通常在 5 到 15 秒内返回,并成为您 Inbox 中的一个对话,标记为 AI assistant;如果请求声明了助手的名称,例如 Claude,则标记为该名称。自带 HTTP 客户端的智能体,例如有网络访问权限的 Claude Code 或 Codex,会直接向它提问。11 月 7 日,自称 Claude 的请求点击了我们文档中的 Ask 行。ChatGPT 的搜索会引用您的公开页面,当它被指向回答页面时,会给用户一个向您的智能体提问的链接,11 月 28 日的 4 次运行中有 3 次如此。聊天产品只有在地址是公开且已知时才会自行获取,这是 OpenAI 公布的一条安全规则,所以它们的搜索不会发送问题。AI 助手访问指南有设置步骤,回答 API 参考有请求格式。

隐藏链接是 llms.txt 文件吗?网站可以三者并用吗?
不是。它们是关系类型为 service-doc 和 service-desc 的两个 <link> 元素,与 llms.txt 相互独立,网站可以三者并用而不冲突。 RFC 8631 定义了这两种关系:service-doc 指向服务的文档,service-desc 指向供软件使用的描述。下面第一个链接指向回答页面,第二个指向描述如何发送问题的 JSON:
<link rel="service-doc" href="https://app.quickchat.ai/ask/qj6hw2tua6/" type="text/html">
<link rel="service-desc" href="https://app.quickchat.ai/ask/qj6hw2tua6/schema/" type="application/json">
WebMCP 与 llms.txt 有什么不同?
WebMCP 是一项尚在提议中的浏览器 API,页面通过它为浏览器中的 AI 智能体注册工具,而 llms.txt 是客户端获取的文件。 Quickchat AI 小组件在支持 WebMCP 的浏览器中注册的 WebMCP 工具,会向回答页面发送问题。我们的指南介绍了如何为您的网站添加 WebMCP,并展示了 Chrome DevTools 中的这个工具。
无论助手走哪条路径,它收到的都是第三方写的文本,而遵循该文本中指令的助手可能被操纵。我们关于智能体浏览器中的提示注入的文章解释了这一风险。
对于用户事先设置好的助手,还有第四条路径:每个 Quickchat AI 智能体也可以作为 MCP 服务器访问,我们的指南介绍了如何把 AI 智能体变成 MCP 服务器。要在该连接器、WebMCP 工具和回答页之间做选择,请参阅我们的将 AI 智能体连接到 ChatGPT 和 Claude指南。关于静态文件与可调用工具之间的一般区别,请参阅面向 AI 智能体的 API;关于什么是 MCP 服务器,请参阅我们的 MCP 解读文章。
常见问题
什么是 llms.txt?
llms.txt 是一项尚在提议中的约定:在网站根目录放一个 Markdown 文件 /llms.txt,为 AI 智能体提供网站的简短摘要,以及值得阅读的页面链接列表。Jeremy Howard 于 2024 年 9 月在 llmstxt.org 发布了该提议,并在 2026 年 8 月修订。是否请求这个文件,由各家 AI 厂商和工具自行决定。
llms.txt 和 robots.txt 一样吗?
不一样。robots.txt 告诉爬虫可以请求哪些 URL。llms.txt 既不授予访问权限,也不拒绝访问。它是一份用 Markdown 写成的阅读清单。想控制 AI 爬虫的网站应在 robots.txt 中设置,两个文件可以同时发布。
ChatGPT、Claude、Gemini 或 Perplexity 会读取 llms.txt 吗?
被要求时,有些会读。在我们 2026 年 11 月 24 日的测试中,只要给出地址,ChatGPT 每次都会读取该文件,其搜索界面还顺着文件打开了一个 Markdown 页面。没有任何助手在未被要求时主动使用该文件。另外,在 2026 年 10 月 13 日至 11 月 23 日之间,有 13 个问题通过只存在于我们 llms 文件中的一行到达了我们的支持智能体,其中 3 个来自自称 Claude 的请求。请求只说明客户端获取了内容,并不说明答案用到了它,所以请查看您自己的日志。
llms.txt 能提高 Google 排名或 AI 回答中的引用吗?
Google 的指南指出,创建 llms.txt 既不会损害也不会提升网站在 Google 搜索中的可见度或排名,因为 Google 搜索会忽略该文件。我们查阅了 OpenAI、Anthropic、Perplexity、Google 和 Apple 的爬虫文档,没有一份承诺发布该文件就会带来引用。请把它看作为愿意获取它的客户端提供的一项便利。
如何验证 llms.txt 文件?
检查四件事。该 URL 返回 HTTP 200,内容类型为文本,正文不是 HTML。文件以一个 H1 开头,并遵循提议中的章节结构。列出的每个链接都返回 200。列表与您打算公开的页面一致。本指南中的脚本可以对 URL 或本地文件执行前三项检查,发现错误时以非零状态退出。
有没有 llms.txt 验证器或生成器?
本指南提供一个验证脚本和一份清单,由您自己运行。我们不提供在线验证器或生成器。Chrome 的 Lighthouse 有一项实验性审核,只检查服务器对该文件是否返回错误。至于生成,Mintlify 等文档平台,以及 Starlight、VitePress 和 Docusaurus 的插件,都可以根据您的页面生成该文件。
llms.txt 和 llms-full.txt 有什么区别?
llms.txt 是带有摘要和链接的索引。llms-full.txt 是文档工具的一种约定,用一个文件容纳各页面的全部文本,它不属于该提议。在我们的调查中,有三个全文文件超过一百万个 token,所以在让智能体读取之前,请先了解文件大小。
llms.txt 应该放在哪里,使用什么内容类型?
把它放在所描述主机的 /llms.txt,内容类型为 text/plain 或 text/markdown,并带 charset=utf-8。提议也允许把文件放在子路径中,例如 /docs/llms.txt,它覆盖该路径下的页面。请确认非浏览器客户端得到的是 HTTP 200 和 Markdown,因为机器人规则或单页应用的回退机制可能在同一 URL 返回 HTML 页面。
有多少网站有 llms.txt 文件?
在我们 2026 年 11 月 24 日对 60 个知名网站的调查中,有 33 个在 /llms.txt 返回了文本文件:10 个 AI 开发者文档网站中有 9 个,而 10 个 AI 公司主站中只有 2 个,10 个消费、电商和媒体网站中只有 1 个。Ahrefs 在 2026 年 6 月发布的一项涵盖 137,000 个网站的研究发现,其中 28% 有这个文件。
如果 AI 助手可以向我的 Quickchat AI 智能体提问,我还需要 llms.txt 吗?
它们的作用不同,二者可以配合使用。llms.txt 列出的是供客户端阅读的静态页面。开启 AI 助手访问后,您的智能体会有一个公开的回答页面、两个关系类型分别为 service-doc 和 service-desc 的隐藏链接,以及在支持 WebMCP 的浏览器中的一个 WebMCP 工具。该页面每次请求回答一个问题,答案来自智能体的 Knowledge Base,并记录在 Inbox 中。AI assistants 卡片还会给您一行可放进 llms.txt 的内容,这样读取该文件的智能体就能向您的智能体提问。
llms.txt、MCP 和 WebMCP 有什么区别?
llms.txt 是客户端可以获取的静态文件。MCP 服务器把后端的工具开放给用户已连接的 AI 应用。WebMCP 是一项尚在提议中的浏览器 API,页面通过它为浏览器中运行的 AI 智能体注册工具。前者发布文本,后两者开放可调用的功能。