AI Search

Search primitive for your agents

Connect your data and deliver natural language search in your applications without worrying about infrastructure.

Atomic search unit for platforms

Create isolated AI Search instances at runtime, and spin them up or down for multi-tenant use cases.

Always up to date

AI Search continuously re-indexes your data so responses always reflect the latest information.

Any source, format, and language

Index multimodal content from sources like R2 and websites, with Workers AI models enabling search across 100+ languages.

Background Pattern
AI Search

Everything you need for RAG

You can use AI Search to:

Add search

Agent file search

Give agents retrieval over your files and knowledge. Use it in popular agent libraries like Cloudflare's Agents SDK and more.

Multimodal search

Search across text, images, PDFs and more from a single query, so users find the right answer no matter how it's stored.

Per-tenant or per-agent file search

Provision an isolated AI Search instance per tenant, project, or agent at runtime, each with its own content and retrieval.

Website and code search

Index your websites and codebases so teams and agents get cited answers across your content and code.

Call AI Search from anywhere

Query from a Worker binding, call it from your backend with an SDK, embed a ready-made UI, or connect an MCP client.

Background Pattern
export interface Env {  AI_SEARCH: AiSearchNamespace;}
export default {  async fetch(request, env): Promise<Response> {    // Create a dedicated AI Search instance for the tenant at runtime.    const instance = await env.AI_SEARCH.create({      id: 'tenant-a',    });
    // Upload a file and wait for it to finish indexing.    await instance.items.uploadAndPoll('handbook.pdf', file);
    // Search only that tenant's AI Search instance.    const results = await instance.search({      query: 'What does the handbook say about travel approvals?',    });
    return Response.json(results);  },} satisfies ExportedHandler<Env>;
from cloudflare import Cloudflare
client = Cloudflare()
# Upload and index content into an existing instance.item = client.aisearch.namespaces.instances.items.upload(    id="my-instance",    account_id=account_id,    name="default",    file=file,)
# Search the instance with a natural language query.results = client.aisearch.namespaces.instances.search(    id="my-instance",    account_id=account_id,    name="default",    query="How does AI Search handle uploaded content?",)
import '@cloudflare/ai-search-snippet';
export default function App() {  // Prebuilt search bar web component, wired to your AI Search endpoint  return (    <search-bar-snippet      apiUrl="https://<PUBLIC_ID>.search.ai.cloudflare.com/"      placeholder="Search..."      maxResults={50}      maxRenderResults={10}      show-url="true"      show-date="true"    />  );}
// Add AI Search to your MCP client config{  "mcpServers": {    "ai-search": {      "url": "https://<PUBLIC_ID>.search.ai.cloudflare.com/mcp",    },  },}

Sentry

"

AI Search has been a cheat code for building AI at Sentry. It is so remarkably simple that even our non-technical teams are building and deploying production-ready features. "

David Cramer
David Cramer Co-founder

Powerful primitives, seamlessly integrated

Built on systems powering 20% of the Internet, AI Search runs on the same infrastructure Cloudflare uses to build Cloudflare. Enterprise-grade reliability, security, and performance are standard.

Build without boundaries

Join thousands of developers who've eliminated infrastructure complexity and deployed globally with Cloudflare. Start building for free — no credit card required.