AI Search: A Search Primitive for Agents
Key point
AI Search provides vector-keyword hybrid search and per-instance search.
Details
AI Search (formerly AutoRAG) is a ready-to-use search primitive for agents. It reduces the complexity of separately combining vector indexes, document parsing/chunking, and index maintenance, letting you dynamically create and search instances from Worker, Agents SDK, and Wrangler CLI.
The biggest change is hybrid search. It runs vector search and BM25 keyword search in parallel and merges the results, applying reranking when needed. By using vector search, which captures meaning well, together with keyword search, which finds exact strings, it doesn't miss specific errors like "ERR_CONNECTION_REFUSED".
As an example of agent use, a customer support scenario is presented. You keep a separate instance for shared product documentation and a separate instance for per-customer history, and use cross-instance search to query both together at search time. This lets the agent reference past solutions to avoid repeating the same failures, and once a resolution is complete, it saves a summary so it can be searched right away in the next conversation.
New instances come with built-in storage and a vector index together, making this simpler than the previous approach of directly wiring up an external R2 bucket and a separate Vectorize index. You can create an instance with create() and immediately check indexing status with uploadAndPoll(), then use it for search right after uploading documents.
Search quality can be tuned with several options.
- Tokenizer:
portersuits natural language documents, whiletrigramsuits cases like code where partial matches matter. - Keyword match mode:
ANDrequires all search terms, whileORincludes candidates even if only some match. - Fusion:
rrfmerges based on rank, whilemaxpicks the higher score. - Reranking: a cross-encoder re-evaluates the query and document together to improve final precision.
You can also boost document metadata at search time, making it easy to surface newer or more important documents at the top. In the end, AI Search comes together as infrastructure that combines search and storage to help agents find the information they need when they need it.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.