shiichan

You don't have to build search infra anymore: Cloudflare AI Search is here!

Hey there, it's me, Shii-chan! Today I've got news that makes life easier for anyone building agents. It's about a new building block that hands the whole job of "search" over to your agent!

Cloudflare Blog blog.cloudflare.com

What was announced?

Cloudflare announced AI Search, a search primitive built for agents. It's the new name for the service that used to be called AutoRAG, and it gives your agent a ready-made search part instead of infrastructure you have to build. This one comes from the Cloudflare Blog.

The story so far

When you wanted an agent to search internal docs or past conversations, you used to wire up the whole search stack yourself: stand up a vector database, set up storage, build an embeddings pipeline, and so on. And once you needed to keep things separate per agent or per customer, it got even more involved.

What changes

Every AI Search instance ships with its own storage and vector index built on R2 and Vectorize. You don't set up a separate bucket first — you upload files through the API and they index right away.

On top of that, the ai_search_namespaces binding lets you create instances at runtime. Without redeploying, you can spin up an instance per agent, per customer, or per tenant. You can also search across many instances through one namespace binding and get back a single ranked result set.

So if you build multi-tenant SaaS, or you want your agent to search, a big chunk of infrastructure work disappears.

Dive Deep

First, how the search works. AI Search runs semantic (vector) search and keyword BM25 search in parallel, then fuses the two — that's the hybrid search. Vector search alone can miss exact terminology, and keyword search alone misses meaning, so the two cover each other's weak spots.

The retrieval pipeline goes like this:

  • Tokenization: pick a Porter stemmer for natural language or trigram for code
  • Keyword matching: switch BM25 candidate selection between AND / OR modes
  • Fusion: combine vector and keyword results with reciprocal rank fusion (RRF) or max fusion
  • Reranking: optionally run a cross-encoder pass (the model is @cf/baai/bge-reranker-base)

Data comes from R2 buckets and websites. Website crawling with Browser Run is built in, and crawling is free during the beta.

You can attach a custom metadata field to documents and boost ranking by a field. Boost on timestamp, for example, to surface fresher results (timestamp is built in on every item).

Getting started is one command:

npx wrangler ai-search create my-search

From code, you create an instance and search:

const instance = await env.AI_SEARCH.create({ id: "my-instance" });
const results = await instance.search({ query: "your query" });

The post walks through a customer support agent. It uses a shared product-knowledge instance (R2-backed docs) plus a per-customer instance that stores resolution history, and gives the agent two tools: search_knowledge_base (queries both) and save_resolution (indexes a summary right away). The LLM decides when to search and when to save, and it runs Kimi K2.5 through Workers AI.

For pricing, it's free during the open beta right now. The limits look like this:

Limit Workers Free Workers Paid
Instances per account 100 5,000
Files per instance 100,000 1M (500K hybrid)
Max file size 4 MB 4 MB
Queries per month 20,000 Unlimited
Pages crawled per day 500 Unlimited

When pricing kicks in, you get 30 days notice, and existing instances keep working as-is.

Wrap-up

  • AI Search is the former AutoRAG, a managed search primitive for agents
  • R2 and Vectorize are built in, so you don't assemble the search stack yourself
  • Hybrid semantic + BM25 search, plus fusion, reranking, and metadata boosting
  • Create instances at runtime and search across many instances at once
  • Free in open beta today, and you start with npx wrangler ai-search create

This one lands squarely for anyone who wants to give their agent real search power, and for SaaS builders who need per-tenant search!