文章标题:Introducing Search for Agents
正文:

AI Search 是我们的服务,它会对你的内容建立索引,让你能够为任何应用或 agent 添加搜索能力,而无需构建一整套检索基础设施。该服务支持将你的网站添加为数据源已有一段时间,它会自动抓取、转换并索引网站页面。
不过,为你的网站设置一个 AI Search 实例,最初仍需要手动创建和配置,然后还要完成所有集成工作,才能让搜索端点从你的域名可用,并确保各个 agent 知道在哪里找到索引以及如何使用它。
今天我们推出 Search for Agents,把这一整套设置简化为 Cloudflare 仪表盘中的一个开关。为你的 zone 打开它,我们的服务就会创建你的 AI Search 实例、开始索引你的内容,并让搜索可以从你自己的域名被发现和使用。
工作原理
这个想法自然延续自 Markdown for Agents:Cloudflare 的网络会使用内容协商标头,为已启用的 zone 实时将任意 HTML 页面转换为 Markdown。类似地,Search for Agents 借助 AI Search 的能力,自动为你的 zone 创建索引,并暴露任何 AI agent 都能发现并用来搜索你网站的 API,且位于你的域名之下,全部在网络层面完成。
你可以使用 API 启用 Search for Agents,也可以在 zone 页面仪表盘的 Quick Actions 下启用:

Search for Agents 面向所有客户提供,包括 Free 套餐(有限制)。一旦启用,Cloudflare 将自动创建一个 AI Search 实例,开始抓取并索引你 zone 中的内容。请参阅我们的开发者文档,了解抓取过程是如何工作的。
你可以直接从此页面访问你的实例,也可以直接前往你账户的 AI > AI Search instances 视图:

你 zone 的 AI Search 实例会以默认设置创建,但你可以随时启用 reranking 或更改配置选项,例如缓存设置。请参阅我们的文档了解完整的选项列表。
一旦 AI Search 索引了你的内容,你或互联网上的任何 agent 就可以开始使用 Search for Agents,但须遵守你的域名设置(例如你的 bot management 设置、AI Crawl Control 和 web application firewall (WAF) 配置)。
可发现性
如果 agent 不知道搜索的存在,它就没什么用。为了便于发现,Search for Agents 会自动在你网站的每一个页面上公布搜索端点。
例如,对于 HTML 响应,我们会向页面的 <head> 添加元数据:
<meta name="agent:instructions" content="Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown.">
<meta name="agent:endpoint" content="https://developers.cloudflare.com/.well-known/search?q={query}">
<meta name="agent:method" content="GET">
<meta name="agent:documentation" content="https://developers.cloudflare.com/ai-search/how-to/search-for-agents/">
如果你还启用了 Markdown for Agents,那么以 Accept: text/markdown 请求页面的 agent 会在 YAML front matter 中收到相同的信息:
文章标题:Introducing Search for Agents
正文:
---
agent:
instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
endpoint: "https://developers.cloudflare.com/.well-known/search?q={query}"
method: "GET"
documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---
智能体会轻松读取这些指令,并知道接下来该怎么做来搜索你的站点。
搜索内容
一旦智能体知道你的站点有搜索端点,它就可以开始使用它了:
$ curl "https://developers.cloudflare.com/.well-known/search?q=cloudflare+artifacts"
# Search results for: "cloudflare artifacts"
## docs/artifacts/api/workers-binding/index.md (score: 1.000)
# Workers binding · Artifacts · Cloudflare Artifacts docs
Call Artifacts from a Worker binding.
---
## docs/artifacts/index.md (score: 0.951)
# Artifacts · Cloudflare Artifacts docs
Store, version, and share filesystem artifacts across Workers, APIs, and Git-compatible tools.
...
根据你的 AI Search 配置,智能体还可以使用自然语言,向搜索端点提问:
$ curl --get "https://developers.cloudflare.com/.well-known/search" --data-urlencode "q=What is the maximum push size for Cloudflare Artifacts?"
# Search results for: "What is the maximum push size for Cloudflare Artifacts?"
## docs/artifacts/platform/limits/index.limits-cloudflare-artifacts-docs.md (score: 1.000)
# Limits · Cloudflare Artifacts docs
Section: Limits · Cloudflare Artifacts docs
title: Limits
description: Review Artifacts platform limits.
pcx_content_type: reference
products:
- artifacts
Limits that apply to creating, importing, cloning, and pushing Artifacts are detailed below.
These limits cover naming rules, storage, request rates for control-plane and Git operations, and the size of each push.
FeatureLimitControl-plane request rate2,000 requests per 10 seconds per Artifacts namespaceGit request rate, per artifact2,000 requests per 10 seconds per artifactMaximum storage per repository1 GB for repos created on or after 2026-09-29. Repos created earlier have a 10 GB limit. See size limit change.Maximum storage per account1 TB (can be raised on request)Maximum number of repositoriesUnlimitedMaximum number of namespacesUnlimitedNamespace name length2–63 charactersNamespace and repo namesStart with a letter or digit. Remaining characters may include letters, digits, ., _, and -.Maximum push size64 MiB per push. Includes all data sent in the push. Split larger work into several smaller pushes.Maximum objects per push50,000 objects, such as file versions, folders, and commits.Maximum file size32 MiB per file. Already-compressed files, like images, video, or zip archives, may be rejected slightly below 32 MiB.Maximum ref updates per push1 MiB of branch and tag updates per push.Maximum entries per folder100,000 files and subfolders in a single folder.
...
注意,此搜索端点返回的是以 Markdown 形式呈现的检索内容,而不是生成的答案。智能体本身已经拥有 AI 模型并与用户进行着对话;它所需要的只是你站点中的相关信息,而不是另一个 AI 模型替它作答的尝试。
支持新的 HTTP 方法:QUERY
新的 HTTP QUERY 方法是一项 IETF 拟议标准,由我们自己的 James Snell 参与合著,于 2026 年 6 月作为 RFC 10008 发布。QUERY 允许客户端在请求体中安全且幂等地发送搜索条件,而不会修改服务器状态。这使它非常适合 AI 搜索。
QUERY 的采用正在进行中,主要浏览器厂商正在讨论该 RFC,多个框架和客户端要么已经采用(例如 curl 和 undici),要么正在讨论采用。
Search for Agents 原生支持 QUERY,可以使用纯文本或 JSON 请求体:
# Plain text
curl -X QUERY 'https://developers.cloudflare.com/.well-known/search' \
--data 'What is the maximum payload size per ingestion request in Basin Pipelines?'
# JSON
curl -X QUERY 'https://developers.cloudflare.com/.well-known/search' \
--header 'Content-Type: application/json' \
--data '{"q":"How many bulk import requests per minute does Email Service allow?"}'
实际演示
让我们看看它在一次智能体会话中是如何实际运作的。Search for Agents 已为我们的开发者文档启用。当我们打开一个 OpenCode 会话并询问“What is the maximum push size for Cloudflare Artifacts?”时,在日志中可以看到智能体在首页发现了搜索端点,然后带着这个问题请求 /.well-known/search 以获取搜索结果。

几秒后答案返回,而且正确无误。

一旦智能体发现了搜索 API,它很可能在同一会话内多次复用该 API,只要它需要搜索同一站点中的内容。
在此公告发布之前,我们已为开发者文档启用了 Search for Agents,我们发现智能体在发现搜索 API 并在任务中加以使用方面表现良好。

它仍然是一个 AI Search 实例
由于 Search for Agents 由你账户中的 AI Search 实例驱动,你同样可以获得所有标准配置选项和功能。例如,你可以启用公开的 REST API 或 MCP 端点,或者从 Workers 中使用它,甚至可以将 AI Search 嵌入你的网站供人类访客使用。

开始使用 Search for Agents
从今天起,Search for Agents 面向所有客户开放。其用量遵循 AI Search 的定价;这包括摄取内容、存储索引内容以及提供查询服务,并受账户在 Workers Free 和 Paid 计划下所包含的用量与限制的约束。
我们还建议你查看我们的 Agent Readiness 页面(见公告),了解如何让你的站点针对智能体进行优化,从指导智能体如何进行身份验证,到控制智能体可以看到哪些内容、它们以何种格式接收内容,以及它们如何为此付费。

查看 Search for Agents 开发者文档以了解更多信息。在 X 上关注我们,或者来 Cloudflare Developer Discord 与我们交流。我们很希望听到那些让自己的内容可被智能体搜索的站点所有者的声音。