--- title: "Agent:你听懂我说的话了吗?" date: "2026-03-25" description: "一份实用清单,让你的网站能被 AI 代理和答案引擎发现、读取和引用——附带一个可以直接复制粘贴的提示词。" language: zh url: "https://pablooliva.de/the-closing-window/zh/ai-agent-discoverability/" markdownUrl: "https://pablooliva.de/the-closing-window/zh/ai-agent-discoverability.md" translations: - language: en url: "https://pablooliva.de/the-closing-window/ai-agent-discoverability/" - language: ar url: "https://pablooliva.de/the-closing-window/ar/ai-agent-discoverability/" - language: de url: "https://pablooliva.de/the-closing-window/de/ai-agent-discoverability/" - language: es url: "https://pablooliva.de/the-closing-window/es/ai-agent-discoverability/" ---
## TL;DR 你的网站对 Perplexity 这样的 AI 答案引擎(Answer Engine)来说可能是隐形的。只需添加几个静态文件(llms.txt、每篇文章的 Markdown 文件、JSON Feed)和一些 HTML 标签(Schema.org JSON-LD、hreflang 链接、Sitemap 发现),你就能让内容轻松被 AI Agent 发现、解析和引用。这一切都不需要框架或第三方服务——只需要写好模板,运行一次就能覆盖未来所有文章。
几周前,当我开始更多地撰写关于 AI 的文章时,我想到我发布到网上的内容应该能够轻松地被我所写的技术本身访问到。于是我让 Claude Code 审查了我的网站结构,并给出如何让它对 AI Agent 更友好的建议。 我还在发布流程中加入了自动翻译成另外三种语言的功能。除了让更多人能够访问这些内容之外,它还有一个额外的好处——能够在这些语言的 AI Agent 搜索中被检索到。 今天早上我看到了 [Julia Solorzano 关于答案引擎优化(Answer Engine Optimization)的文章](https://juliasolorzano.com/blog/2026/03/16/answer-engine-optimization/),这给了我一些新的想法。她的文章从一个略有不同的角度来探讨这个问题,这让我意识到这些信息可能对其他人也有用。 以下是我学到的:AI Agent 和答案引擎(比如 Perplexity)正越来越成为人们获取信息的方式。如果你的网站没有为它们做好准备,你可能会错失额外的访客。以下是你需要做的事情,按影响力排序。如果你使用 AI 编程助手(AI Coding Agent),文末有一个现成的提示词(Prompt),可以帮你实现所有这些功能。 ## 1. 添加 llms.txt 和 llms-full.txt 按照 [llms.txt 标准](https://llmstxt.org/),在你的域名根目录下提供两个纯文本文件。 - **`/llms.txt`** — 网站描述,后跟每个页面的列表,包含标题、URL、描述和关键词。足够轻量,任何 Agent 都能在一次请求中获取。 - **`/llms-full.txt`** — 相同的结构,但内联包含完整的页面内容。设置一个大小上限(100KB 比较合理),超出后剩余页面回退为仅标题+描述。 这让 AI Agent 无需爬取就能快速获得你整个网站的结构化概览。 ## 2. 为每篇文章提供原始 Markdown 为每个已发布的页面生成一个独立的 `.md` 文件,放在可预测的 URL 路径下(例如 `/blog/{slug}.md`)。包含 YAML Front Matter,含标题、日期、描述、语言、关键词、规范 URL 以及翻译链接,后面跟着原始 Markdown 正文。 配置服务器将 `.md` 文件以 `text/plain` 格式提供,这样它们在浏览器中可以直接显示,机器也能轻松解析。 然后在每篇文章的 HTML `` 中添加一个发现标签: ```html ``` 这样,任何读取你 HTML 的 Agent 都能发现机器可读版本,而无需知道你的 URL 约定。 ## 3. 添加 Schema.org JSON-LD ### 每篇文章页面添加 BlogPosting 在 `` 中嵌入 `BlogPosting` Schema,包含标题(headline)、发布日期(datePublished)、URL、描述、图片和关键词。作者应是一个 `Person`,包含 `name`、`url` 和指向你社交资料的 `sameAs` 链接(LinkedIn、GitHub、Bluesky 等)。发布者应是一个 `Organization`,使用你的网站名称。 这有助于答案引擎将内容归属于你,并建立知识图谱(Knowledge Graph)连接。 ### 首页添加 Person 在根页面添加一个独立的 `Person` Schema,包含姓名、URL、职位和指向你所有网络资产的 `sameAs` 链接。这为答案引擎提供了一个规范的身份节点(Identity Node),使其能在整个网络中锚定你的身份。 *Julia Solorzano 的文章还推荐在作品集页面添加带有 `CreativeWork` 项的 `CollectionPage` Schema——如果你展示项目的话,值得考虑。* ## 4. 提供结构化 Feed ### JSON Feed 提供一个 [JSON Feed v1.1](https://www.jsonfeed.org/version/1.1/) 端点,包含 HTML(`content_html`)和纯文本(`content_text`)格式的完整内容,以及摘要、图片、标签和链接到每篇文章 `.md` 文件的附件。 在 `` 中添加自动发现: ```html ``` ### 文章索引 提供一个 `posts.json` 文件,包含所有文章及其元数据:slug、标题、日期、描述、分类、图片、关键词、Markdown URL 和翻译链接。这让 Agent 无需解析 Feed 就能获得所有内容的结构化目录。 ### Atom/RSS Feed 一个包含完整 HTML 内容的标准 Atom 或 RSS Feed。许多 Agent 仍然会优先查找它。 ## 5. 在 robots.txt 中欢迎 AI 爬虫 按 User-Agent 明确允许主要的 AI 爬虫: ``` User-agent: GPTBot Allow: / User-agent: ClaudeBot Allow: / User-agent: PerplexityBot Allow: / User-agent: GoogleOther Allow: / User-agent: Amazonbot Allow: / User-agent: Applebot-Extended Allow: / User-agent: Meta-ExternalAgent Allow: / User-agent: Bytespider Allow: / User-agent: cohere-ai Allow: / ``` 在底部包含你的 Sitemap URL。以上列表涵盖了截至 2026 年初的主要爬虫——请定期检查是否有新的爬虫出现。 ## 6. 通过两种方式让 Sitemap 可被发现 不要仅依赖 robots.txt。在每个页面的 `` 中添加一个 link 标签: ```html ``` 这样,那些读取页面 HTML(而非仅读取 robots.txt)的爬虫也能找到你的 Sitemap。 ## 7. 撰写真正的 Meta 描述 每个页面都需要在 `` 中有一个唯一的 ``。这是答案引擎用来判断你的页面是否值得引用的那句话。不要留空,也不要在多个页面使用相同的通用描述。 如果你的文章有关键词,也添加 ``,并在 Schema.org JSON-LD、Feed、llms.txt 和 `.md` Front Matter 中呈现这些关键词。所有这些渠道的一致性会强化你的主题信号。描述控制在 160 个字符以内,内容要具体。 ## 8. 翻译你的内容并添加 Hreflang 链接 答案引擎更倾向于引用已经以查询语言存在的内容,而不是临时翻译英文。如果你能翻译你的文章——即使是通过 AI 翻译加人工审校——那就去做。每增加一种语言,都会在该语言的查询中成倍扩大你的曝光面。 确保你的翻译页面得到与英文页面同等的待遇:在可预测的 URL(例如 `/{lang}/{slug}.md`)下有各自的 `.md` 文件,包含在你的 Feed 和 llms.txt 中。翻译不应该是二等公民——它应该和原文一样容易被发现和机器读取。 然后在 `` 中为每个翻译添加 `` 标签,这样 AI Agent 就能从任何一个页面发现所有语言版本。 ## Quick Reference | Feature | What to Add | Why | |---------|------------|-----| | llms.txt | Plain-text site overview at domain root | Fast agent discovery without crawling | | Per-post .md files | Raw markdown at predictable URLs | Machine-readable content | | Markdown link tag | `` | HTML discovery of .md files | | BlogPosting JSON-LD | Schema in `` on post pages | Structured authorship + content metadata | | Person JSON-LD | Schema on homepage | Canonical identity node | | JSON Feed | Feed endpoint with full content | Structured feed for agents | | Post index | `posts.json` with all post metadata | Full catalog without feed parsing | | Atom/RSS feed | Standard XML feed | Legacy agent compatibility | | robots.txt | Explicit `Allow` for AI crawlers | Clear permission signal | | Sitemap link | `` in `` | Dual-path sitemap discovery | | Meta descriptions | Unique per page, under 160 chars | Citation decision input | | Meta keywords | In HTML, JSON-LD, feeds, llms.txt, .md | Consistent topic signals | | Translations + hreflang | Full posts in target languages + `` | Surface area in non-English queries | --- 就是这些。不需要框架,不需要第三方服务。其中大部分是静态文件和 HTML 标签,任何静态网站生成器都能生成。最难的部分是初始设置——一旦模板化完成,每篇新文章都会自动获得所有这些功能。 ## 给你的 AI Agent 的提示词 如果你使用 AI 编程助手(AI Coding Agent),可以粘贴以下提示词,让它审查你的网站并为你实现这些功能。 ``` Audit my website for AI agent discoverability and implement the following features. Analyze my existing setup first and skip anything already in place. 1. **llms.txt + llms-full.txt** — Generate two plain-text files at the domain root following the llms.txt standard (https://llmstxt.org/). llms.txt: site description + list of pages with title, URL, description, keywords. llms-full.txt: same but with full page content inline, with a 100KB size cap (fall back to title + description when exceeded). Both should auto-generate from existing content. 2. **Per-post markdown files** — For every published page, generate a .md file at a predictable URL (e.g., /blog/{slug}.md). Include YAML front matter (title, date, description, language, keywords, canonical URL, markdown URL, translation links) followed by the raw markdown body. Configure the server to serve .md as text/plain. Add `` in on every post page. 3. **Schema.org JSON-LD** — Add BlogPosting schema in on every post with: headline, datePublished, url, description, image, keywords. Author as Person with name, url, sameAs (social profile URLs). Publisher as Organization. Add a standalone Person schema on the homepage with name, url, jobTitle, sameAs links to all web properties. 4. **Structured feeds** — JSON Feed v1.1 endpoint with content_html, content_text, summary, image, tags, and attachments linking to .md files. Add feed auto-discovery in . A posts.json index with all posts and metadata (slug, title, date, description, category, image, keywords, markdown URL, translation links). Atom or RSS feed with full HTML content. 5. **robots.txt** — Explicitly Allow / for these user-agents: GPTBot, ClaudeBot, PerplexityBot, GoogleOther, Amazonbot, Applebot-Extended, Meta-ExternalAgent, Bytespider, cohere-ai. Include Sitemap URL. 6. **Sitemap discovery** — Add `` in on every page (in addition to robots.txt Sitemap directive). 7. **Meta descriptions + keywords** — Ensure every page has a unique (under 160 chars). Add where keywords exist. Surface keywords consistently in JSON-LD, feeds, llms.txt, and .md front matter. 8. **Translations + hreflang** — If the site has translations, ensure they get equal treatment: their own .md files, hreflang cross-references, inclusion in feeds and llms.txt. Add `` tags in for each translation. Present a plan showing what already exists vs. what needs to be added before making changes. ```