/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */
#content_views .toc,
/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */
#content_views.markdown_views > p:empty:has(+ .toc),
#content_views.markdown_views > .toc + p:empty,
/* 富文本旧版目录标记 */
#content_views.htmledit_views #main-toc,
#content_views.htmledit_views #hr-toc,
#content_views.htmledit_views p[id*=\”-toc\”] {
display: none !important;
}
/* 目录去掉后,紧跟的首个标题不再多出一块上边距 */
#content_views.markdown_views > .toc + h1,
#content_views.markdown_views > .toc + h2,
#content_views.markdown_views > .toc + h3,
#content_views.markdown_views > .toc + h4,
#content_views.markdown_views > .toc + p:empty + h1,
#content_views.markdown_views > .toc + p:empty + h2,
#content_views.markdown_views > .toc + p:empty + h3,
#content_views.markdown_views > .toc + p:empty + h4 {
margin-top: 0 !important;
}
当搜索者从人类变成 AI Agent,内容策略必须重做。
一个真实的问题
前几天我在 Perplexity 搜一个技术方案,AI 引用了我们团队写的一篇文档。点进去一看——摘要全错,关键参数丢了,甚至连结论都反了。
不是 Perplexity 不行。是我们的内容,根本不是给 AI 读的。
我们花了大量精力做 SEO:关键词布局、内链策略、meta description 精雕细琢。但这些都是给 Google 爬虫和人类用户设计的。当"读者"变成一个 AI Agent,它不会看你精心排版的 hero banner,不会滑动你的轮播图,不会在弹窗里找"跳过"按钮。
它只会做一件事:读你的内容,然后试图理解它。
问题来了——它能读懂吗?
搜索引擎的权力交接
先看一个趋势:
#mermaid-svg-pqfyAdwSpBJtnu3F{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-pqfyAdwSpBJtnu3F .error-icon{fill:#552222;}#mermaid-svg-pqfyAdwSpBJtnu3F .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-pqfyAdwSpBJtnu3F .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-pqfyAdwSpBJtnu3F .marker{fill:#333333;stroke:#333333;}#mermaid-svg-pqfyAdwSpBJtnu3F .marker.cross{stroke:#333333;}#mermaid-svg-pqfyAdwSpBJtnu3F svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-pqfyAdwSpBJtnu3F p{margin:0;}#mermaid-svg-pqfyAdwSpBJtnu3F .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-pqfyAdwSpBJtnu3F .cluster-label text{fill:#333;}#mermaid-svg-pqfyAdwSpBJtnu3F .cluster-label span{color:#333;}#mermaid-svg-pqfyAdwSpBJtnu3F .cluster-label span p{background-color:transparent;}#mermaid-svg-pqfyAdwSpBJtnu3F .label text,#mermaid-svg-pqfyAdwSpBJtnu3F span{fill:#333;color:#333;}#mermaid-svg-pqfyAdwSpBJtnu3F .node rect,#mermaid-svg-pqfyAdwSpBJtnu3F .node circle,#mermaid-svg-pqfyAdwSpBJtnu3F .node ellipse,#mermaid-svg-pqfyAdwSpBJtnu3F .node polygon,#mermaid-svg-pqfyAdwSpBJtnu3F .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-pqfyAdwSpBJtnu3F .rough-node .label text,#mermaid-svg-pqfyAdwSpBJtnu3F .node .label text,#mermaid-svg-pqfyAdwSpBJtnu3F .image-shape .label,#mermaid-svg-pqfyAdwSpBJtnu3F .icon-shape .label{text-anchor:middle;}#mermaid-svg-pqfyAdwSpBJtnu3F .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-pqfyAdwSpBJtnu3F .rough-node .label,#mermaid-svg-pqfyAdwSpBJtnu3F .node .label,#mermaid-svg-pqfyAdwSpBJtnu3F .image-shape .label,#mermaid-svg-pqfyAdwSpBJtnu3F .icon-shape .label{text-align:center;}#mermaid-svg-pqfyAdwSpBJtnu3F .node.clickable{cursor:pointer;}#mermaid-svg-pqfyAdwSpBJtnu3F .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-pqfyAdwSpBJtnu3F .arrowheadPath{fill:#333333;}#mermaid-svg-pqfyAdwSpBJtnu3F .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-pqfyAdwSpBJtnu3F .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-pqfyAdwSpBJtnu3F .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pqfyAdwSpBJtnu3F .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-pqfyAdwSpBJtnu3F .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pqfyAdwSpBJtnu3F .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-pqfyAdwSpBJtnu3F .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-pqfyAdwSpBJtnu3F .cluster text{fill:#333;}#mermaid-svg-pqfyAdwSpBJtnu3F .cluster span{color:#333;}#mermaid-svg-pqfyAdwSpBJtnu3F div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-pqfyAdwSpBJtnu3F .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-pqfyAdwSpBJtnu3F rect.text{fill:none;stroke-width:0;}#mermaid-svg-pqfyAdwSpBJtnu3F .icon-shape,#mermaid-svg-pqfyAdwSpBJtnu3F .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-pqfyAdwSpBJtnu3F .icon-shape p,#mermaid-svg-pqfyAdwSpBJtnu3F .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-pqfyAdwSpBJtnu3F .icon-shape rect,#mermaid-svg-pqfyAdwSpBJtnu3F .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-pqfyAdwSpBJtnu3F .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-pqfyAdwSpBJtnu3F .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-pqfyAdwSpBJtnu3F :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
用户提问
2023 年
2026 年
Google 搜索
用户自己筛选 10 个蓝色链接
点击 → 阅读 → 提取信息
AI 搜索Perplexity / ChatGPT / Kimi
Agent 直接读取多个页面
总结 + 引用 → 直接给答案
这个流程变化意味着什么?
Google 时代,你的目标是排到第一页。用户来了,自己读、自己判断。你的内容写得"还行"就够用——标题吸引人、开头有悬念、内容凑够字数。
Agent 时代,AI 直接替用户读你的页面、替用户判断、替用户总结。你的内容必须能被机器准确理解和提取。如果 Agent 在你的页面上找不到关键信息,它不会犹豫——它会转向下一个来源。
你的竞争对手不再只是同行业的其他网站,还包括任何一个 Agent 能准确读取的页面。
Agent 怎么"读"你的内容?
要优化,先理解 Agent 的行为模式。经过大量观察和实践,Agent 读取内容有三个核心特征:
#mermaid-svg-IdDifN97go3f3Pgo{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-IdDifN97go3f3Pgo .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-IdDifN97go3f3Pgo .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-IdDifN97go3f3Pgo .error-icon{fill:#552222;}#mermaid-svg-IdDifN97go3f3Pgo .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-IdDifN97go3f3Pgo .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-IdDifN97go3f3Pgo .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-IdDifN97go3f3Pgo .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-IdDifN97go3f3Pgo .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-IdDifN97go3f3Pgo .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-IdDifN97go3f3Pgo .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-IdDifN97go3f3Pgo .marker{fill:#333333;stroke:#333333;}#mermaid-svg-IdDifN97go3f3Pgo .marker.cross{stroke:#333333;}#mermaid-svg-IdDifN97go3f3Pgo svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-IdDifN97go3f3Pgo p{margin:0;}#mermaid-svg-IdDifN97go3f3Pgo .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-IdDifN97go3f3Pgo .cluster-label text{fill:#333;}#mermaid-svg-IdDifN97go3f3Pgo .cluster-label span{color:#333;}#mermaid-svg-IdDifN97go3f3Pgo .cluster-label span p{background-color:transparent;}#mermaid-svg-IdDifN97go3f3Pgo .label text,#mermaid-svg-IdDifN97go3f3Pgo span{fill:#333;color:#333;}#mermaid-svg-IdDifN97go3f3Pgo .node rect,#mermaid-svg-IdDifN97go3f3Pgo .node circle,#mermaid-svg-IdDifN97go3f3Pgo .node ellipse,#mermaid-svg-IdDifN97go3f3Pgo .node polygon,#mermaid-svg-IdDifN97go3f3Pgo .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-IdDifN97go3f3Pgo .rough-node .label text,#mermaid-svg-IdDifN97go3f3Pgo .node .label text,#mermaid-svg-IdDifN97go3f3Pgo .image-shape .label,#mermaid-svg-IdDifN97go3f3Pgo .icon-shape .label{text-anchor:middle;}#mermaid-svg-IdDifN97go3f3Pgo .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-IdDifN97go3f3Pgo .rough-node .label,#mermaid-svg-IdDifN97go3f3Pgo .node .label,#mermaid-svg-IdDifN97go3f3Pgo .image-shape .label,#mermaid-svg-IdDifN97go3f3Pgo .icon-shape .label{text-align:center;}#mermaid-svg-IdDifN97go3f3Pgo .node.clickable{cursor:pointer;}#mermaid-svg-IdDifN97go3f3Pgo .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-IdDifN97go3f3Pgo .arrowheadPath{fill:#333333;}#mermaid-svg-IdDifN97go3f3Pgo .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-IdDifN97go3f3Pgo .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-IdDifN97go3f3Pgo .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-IdDifN97go3f3Pgo .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-IdDifN97go3f3Pgo .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-IdDifN97go3f3Pgo .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-IdDifN97go3f3Pgo .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-IdDifN97go3f3Pgo .cluster text{fill:#333;}#mermaid-svg-IdDifN97go3f3Pgo .cluster span{color:#333;}#mermaid-svg-IdDifN97go3f3Pgo div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-IdDifN97go3f3Pgo .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-IdDifN97go3f3Pgo rect.text{fill:none;stroke-width:0;}#mermaid-svg-IdDifN97go3f3Pgo .icon-shape,#mermaid-svg-IdDifN97go3f3Pgo .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-IdDifN97go3f3Pgo .icon-shape p,#mermaid-svg-IdDifN97go3f3Pgo .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-IdDifN97go3f3Pgo .icon-shape rect,#mermaid-svg-IdDifN97go3f3Pgo .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-IdDifN97go3f3Pgo .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-IdDifN97go3f3Pgo .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-IdDifN97go3f3Pgo :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
Agent行为特征
① 只读前 N 行
② 依赖链接层级导航
被告知 vs 自己发现
上下文窗口有限不会通读全文
前 500 字决定一切
没有视觉排版概念
靠链接树找信息
索引页 = 地图
被告知'文档在这里' → 直接访问
必须自己翻 → 可能错过
效率差距:10x
1. 只读前 N 行
这不是猜测,是 Agent 框架的实际行为。为了控制上下文窗口(context window),大多数 Agent 在读取文件时会设置截断:
- 只读前 100 行
- 只读前 8KB
- 只读前 2000 tokens
这意味着如果你的关键信息埋在文章第三段之后、或者在折叠的 <details> 标签里、再或者藏在 JavaScript 渲染的 Tab 切换后面——Agent 根本看不到。
2. 依赖链接层级导航
人类打开一个文档站,会看到侧边栏、面包屑、搜索框。Agent 看到的只有——链接。
它从首页开始,顺着链接一层一层往下找。如果你的页面结构混乱,链接层级不清晰,Agent 就像走迷宫。
对比一下:
| 看到漂亮的侧边栏导航 | 看到一堆 <a> 标签 |
| 搜索框输入关键词找内容 | 没有搜索功能,只能遍历链接 |
| 知道"快速开始"就是入门指南 | 不知道,除非链接文字说清楚 |
| 能从排版判断信息层级 | 只能从 HTML 结构判断 |
3. "被告知"和"自己发现"的差距
这是一个被严重低估的点。
当 Agent 被直接告知"认证配置在 /docs/auth"时,它会精准定位。当它需要自己翻找时,可能要在 5 个页面中搜索,消耗大量 token,还可能找错。
在 Agent 的世界里,发现成本直接等于可靠性。信息越容易被发现,被正确使用概率越高。
怎么优化?Sentry 的实战
Sentry 的 CTO David Cramer 最近详细分享了他们的实践。核心机制很简单——Content Negotiation(内容协商)。
原理
当 HTTP 请求头包含 Accept: text/markdown 时,你基本可以确定:来的是一个 AI Agent。
你的服务器AI Agent你的服务器AI Agent#mermaid-svg-KddBsCp2clGOkVB3{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-KddBsCp2clGOkVB3 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-KddBsCp2clGOkVB3 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-KddBsCp2clGOkVB3 .error-icon{fill:#552222;}#mermaid-svg-KddBsCp2clGOkVB3 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-KddBsCp2clGOkVB3 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-KddBsCp2clGOkVB3 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-KddBsCp2clGOkVB3 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-KddBsCp2clGOkVB3 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-KddBsCp2clGOkVB3 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-KddBsCp2clGOkVB3 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-KddBsCp2clGOkVB3 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-KddBsCp2clGOkVB3 .marker.cross{stroke:#333333;}#mermaid-svg-KddBsCp2clGOkVB3 svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-KddBsCp2clGOkVB3 p{margin:0;}#mermaid-svg-KddBsCp2clGOkVB3 .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-KddBsCp2clGOkVB3 text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-KddBsCp2clGOkVB3 .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-KddBsCp2clGOkVB3 .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-KddBsCp2clGOkVB3 .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-KddBsCp2clGOkVB3 .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-KddBsCp2clGOkVB3 #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-KddBsCp2clGOkVB3 .sequenceNumber{fill:white;}#mermaid-svg-KddBsCp2clGOkVB3 #sequencenumber{fill:#333;}#mermaid-svg-KddBsCp2clGOkVB3 #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-KddBsCp2clGOkVB3 .messageText{fill:#333;stroke:none;}#mermaid-svg-KddBsCp2clGOkVB3 .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-KddBsCp2clGOkVB3 .labelText,#mermaid-svg-KddBsCp2clGOkVB3 .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-KddBsCp2clGOkVB3 .loopText,#mermaid-svg-KddBsCp2clGOkVB3 .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-KddBsCp2clGOkVB3 .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-KddBsCp2clGOkVB3 .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-KddBsCp2clGOkVB3 .noteText,#mermaid-svg-KddBsCp2clGOkVB3 .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-KddBsCp2clGOkVB3 .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-KddBsCp2clGOkVB3 .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-KddBsCp2clGOkVB3 .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-KddBsCp2clGOkVB3 .actorPopupMenu{position:absolute;}#mermaid-svg-KddBsCp2clGOkVB3 .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-KddBsCp2clGOkVB3 .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-KddBsCp2clGOkVB3 .actor-man circle,#mermaid-svg-KddBsCp2clGOkVB3 line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-KddBsCp2clGOkVB3 :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}拿到纯内容准确理解 + 低 token 消耗人类用户正常浏览体验GET /docsAccept: text/markdown识别为 Agent返回精简 Markdown去掉导航/JS/装饰GET /(无 Accept: text/markdown)返回完整 HTML正常渲染
人类和 Agent,同一条 URL,不同的响应。两全其美。
Sentry 的三个具体案例
案例一:文档站
Agent 访问 Sentry 文档时,返回的不是带导航、搜索框、侧边栏的 HTML,而是纯 Markdown:
# Sentry Documentation
Sentry 是一个面向开发者的应用监控平台…
## 核心功能
– **错误监控**:捕获完整的堆栈信息
– **性能追踪**:跨服务追踪请求链路
– **会话回放**:查看真实用户操作路径
…
关键优化:
- ✅ 去掉导航、面包屑等浏览器专属元素
- ✅ 保留清晰的标题层级(#、##)
- ✅ 信息密度高,无废话
- ❌ 不需要 hero banner、CTA 按钮、用户评价模块
案例二:产品主页
Agent 访问 sentry.io 时,最蠢的做法是返回一个登录页面。Sentry 做了什么?返回了 Agent 真正需要的东西——程序化接入方式:
# Sentry
你访问了 Web UI,这是给人类用的。
作为 Agent,你可能需要以下接入方式:
## MCP Server(推荐)
```json
{
"mcpServers": {
"sentry": {
"url": "https://mcp.sentry.dev/mcp"
}
}
}
CLI
查询 issues、分析错误:https://cli.sentry.dev
API
REST API 文档:https://docs.sentry.io/api
这太聪明了。Agent 来了,直接给接口,不给 HTML。这才是"Agent-first"的思维方式。
**案例三:开源项目**
Sentry 的开源项目 Warden 做了更激进的优化:Agent 一次请求就能拿到完整的启动引导,包括功能说明、架构、快速开始命令。不需要翻 README、不需要看 CONTRIBUTING.md、不需要在多个页面间跳转。
**一次请求,完整上下文。**
## 实操:优化三原则
结合 Sentry 的经验和我们自己踩过的坑,总结出三条原则:
```mermaid
graph TB
subgraph Agent-First 内容优化
P1["原则一:顺序为王"]
P2["原则二:精简到极致"]
P3["原则三:链接即地图"]
end
P1 –> P1a["最重要的信息放最前面"]
P1 –> P1b["前 500 字 = 摘要"]
P1 –> P1c["结论先行,细节在后"]
P2 –> P2a["去掉装饰性内容"]
P2 –> P2b["去掉导航/JS/弹窗"]
P2 –> P2c["Markdown > HTML"]
P3 –> P3a["索引页 = 站点地图"]
P3 –> P3b["链接文字要语义化"]
P3 –> P3c["层级不超过 3 层"]
原则一:顺序为王
Agent 从上到下读。第一屏决定它对整个页面的理解。
- ❌ “欢迎来到我们的产品文档,我们是一家成立于 2019 年的公司…”
- ✅ “这是一个 XX 工具,用于解决 YY 问题。核心功能:A、B、C。快速开始:…”
把结论放前面,把细节放后面。老派的新闻写作原则,在 Agent 时代焕发新生。
原则二:精简到极致
Agent 不关心你的品牌故事。它关心事实。
Markdown > HTML。原因很简单:
| Token 消耗 | 高(标签、属性、样式) | 低(纯文本 + 简单标记) |
| 解析准确率 | 容易被导航/脚本干扰 | 结构清晰,几乎不会误读 |
| Agent 友好度 | ❌ | ✅ |
同样的内容,Markdown 格式可以节省 40-60% 的 token,同时提高解析准确率。
原则三:链接即地图
Agent 靠链接导航。你的索引页就是它的地图。
- 确保首页/索引页有清晰的、完整的内容目录
- 链接文字要语义化(用 /docs/auth 而不是 /page?id=42)
- 层级不要超过 3 层——Agent 的耐心和你的 token 预算一样有限
国内场景:这跟我们有什么关系?
你可能在想:Sentry 是面向全球开发者的,国内环境不一样。
不一样吗?
看看我们身边的 AI 搜索产品:
- Kimi(月之暗面)— 已经在大量抓取和引用中文技术内容
- 豆包(字节跳动)— 内置搜索能力,直接总结网页内容
- 秘塔搜索 — 专门做 AI 搜索的产品
- 通义千问 — 阿里的 AI 搜索集成
它们的工作方式和 Perplexity 如出一辙:读取你的页面 → 理解内容 → 总结给用户。
更重要的趋势是 MCP(Model Context Protocol) 的兴起。这个协议让 AI Agent 不再只是"读网页",而是可以直接调用你的 API、查询你的数据库、操作你的工具。
#mermaid-svg-mdEV5N3uH2OVorSq{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-mdEV5N3uH2OVorSq .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-mdEV5N3uH2OVorSq .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-mdEV5N3uH2OVorSq .error-icon{fill:#552222;}#mermaid-svg-mdEV5N3uH2OVorSq .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-mdEV5N3uH2OVorSq .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-mdEV5N3uH2OVorSq .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-mdEV5N3uH2OVorSq .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-mdEV5N3uH2OVorSq .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-mdEV5N3uH2OVorSq .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-mdEV5N3uH2OVorSq .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-mdEV5N3uH2OVorSq .marker{fill:#333333;stroke:#333333;}#mermaid-svg-mdEV5N3uH2OVorSq .marker.cross{stroke:#333333;}#mermaid-svg-mdEV5N3uH2OVorSq svg{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-mdEV5N3uH2OVorSq p{margin:0;}#mermaid-svg-mdEV5N3uH2OVorSq .label{font-family:\”trebuchet ms\”,verdana,arial,sans-serif;color:#333;}#mermaid-svg-mdEV5N3uH2OVorSq .cluster-label text{fill:#333;}#mermaid-svg-mdEV5N3uH2OVorSq .cluster-label span{color:#333;}#mermaid-svg-mdEV5N3uH2OVorSq .cluster-label span p{background-color:transparent;}#mermaid-svg-mdEV5N3uH2OVorSq .label text,#mermaid-svg-mdEV5N3uH2OVorSq span{fill:#333;color:#333;}#mermaid-svg-mdEV5N3uH2OVorSq .node rect,#mermaid-svg-mdEV5N3uH2OVorSq .node circle,#mermaid-svg-mdEV5N3uH2OVorSq .node ellipse,#mermaid-svg-mdEV5N3uH2OVorSq .node polygon,#mermaid-svg-mdEV5N3uH2OVorSq .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-mdEV5N3uH2OVorSq .rough-node .label text,#mermaid-svg-mdEV5N3uH2OVorSq .node .label text,#mermaid-svg-mdEV5N3uH2OVorSq .image-shape .label,#mermaid-svg-mdEV5N3uH2OVorSq .icon-shape .label{text-anchor:middle;}#mermaid-svg-mdEV5N3uH2OVorSq .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-mdEV5N3uH2OVorSq .rough-node .label,#mermaid-svg-mdEV5N3uH2OVorSq .node .label,#mermaid-svg-mdEV5N3uH2OVorSq .image-shape .label,#mermaid-svg-mdEV5N3uH2OVorSq .icon-shape .label{text-align:center;}#mermaid-svg-mdEV5N3uH2OVorSq .node.clickable{cursor:pointer;}#mermaid-svg-mdEV5N3uH2OVorSq .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-mdEV5N3uH2OVorSq .arrowheadPath{fill:#333333;}#mermaid-svg-mdEV5N3uH2OVorSq .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-mdEV5N3uH2OVorSq .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-mdEV5N3uH2OVorSq .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-mdEV5N3uH2OVorSq .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-mdEV5N3uH2OVorSq .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-mdEV5N3uH2OVorSq .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-mdEV5N3uH2OVorSq .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-mdEV5N3uH2OVorSq .cluster text{fill:#333;}#mermaid-svg-mdEV5N3uH2OVorSq .cluster span{color:#333;}#mermaid-svg-mdEV5N3uH2OVorSq div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\”trebuchet ms\”,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-mdEV5N3uH2OVorSq .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-mdEV5N3uH2OVorSq rect.text{fill:none;stroke-width:0;}#mermaid-svg-mdEV5N3uH2OVorSq .icon-shape,#mermaid-svg-mdEV5N3uH2OVorSq .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-mdEV5N3uH2OVorSq .icon-shape p,#mermaid-svg-mdEV5N3uH2OVorSq .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-mdEV5N3uH2OVorSq .icon-shape rect,#mermaid-svg-mdEV5N3uH2OVorSq .image-shape rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-mdEV5N3uH2OVorSq .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-mdEV5N3uH2OVorSq .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-mdEV5N3uH2OVorSq :root{–mermaid-font-family:\”trebuchet ms\”,verdana,arial,sans-serif;}
2025-2026 模式
MCP / API
结构化数据
Content Negotiation
纯 Markdown
Agent
你的服务
你的内容站
2024 模式
抓取 HTML
可能解析失败
Agent
你的网站
两条路并行:Agent 可以直接调 API 拿数据,也可以读你的内容站获取上下文。两条路都需要你做好准备。
谁会受益,谁会被淘汰
会受益的:
- 文档结构清晰的开源项目(Agent 最容易推荐这类内容)
- 提供结构化 API 的 SaaS 产品(MCP 接入 = Agent 直接可用)
- 技术博客内容扎实的个人/团队(深度内容 Agent 会优先引用)
- 早期就做 Content Negotiation 优化的网站
会被淘汰的:
- 靠关键词堆砌的 SEO 农场(Agent 不看关键词密度)
- 信息藏在折叠/弹窗/Tab 后面的页面(Agent 读不到)
- 结构混乱、链接死链多的文档站(Agent 导航失败 = 放弃)
- 只能渲染 HTML、没有数据层的网站(Agent 没有高效的数据获取方式)
立即行动:3 件你可以现在就做的事
1. 用 Agent 的视角看看你的网站
# 模拟 Agent 请求
curl -H "Accept: text/markdown" https://your-website.com
# 如果返回的还是 HTML,说明你还没做优化
# 如果返回的是一堆导航和脚本,说明优化不够
2. 检查关键页面的前 500 字
打开你最重要的 5 个页面,数一下前 500 字里有没有关键信息。如果开头是品牌故事和欢迎语——该改了。
3. 给项目加一个 Agent 友好的入口
最简单的起步方式:在网站根目录放一个 llms.txt,告诉 Agent 你的站点结构和核心内容。虽然这个方案被一些人质疑,但作为"被直接告知"的入口,它确实有效。
更进一步的方案是实现 Content Negotiation——根据请求头返回不同格式。Nginx 或 Next.js 都可以轻松实现。
结语
Agent-first 不是取代 SEO,而是在 SEO 之上增加了一个新的维度。
过去十年,我们学会了为 Google 写内容。接下来十年,我们要学会为 AI Agent 写内容。
好消息是,优化的方向其实很清晰:更好的结构、更少废话、更准确的信息表达。这些不仅是 Agent 喜欢的,也是人类读者一直喜欢的。
只是现在,如果你不做,Agent 就会去别的地方找答案。
如果这篇文章对你有帮助:
• 👍 点赞支持
• 🔖 收藏备用
• 📤 分享朋友
下期见!
关注公众号【架构之旅】,第一时间获取AI相关实战教程,错过不再补~




