---
title: "Cloudflare AI Search - Automatic RAG infrastructure and querying"
description: "Connect your data and deliver natural language search in your applications. AI Search supports spins up a RAG architecture from a bucket or website. Supports open standards like NLWeb and customization inclduing metadata filtering."
url: "https://www.cloudflare.com/products/ai-search"
---

# AI Search

> Connect your data and deliver natural language search in your applications.

## Key Features

- Automatic RAG pipeline
- Continuous re-indexing
- NLWeb support
- Metadata filtering
- Edge-based inference
- Multi-tenant support
- Query rewriting

## Benefits

### Deploy RAG architecture in minutes

AI Search gives you a production-ready RAG pipeline out of the box — just connect your data and go.

### Always Up-to-Date

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

### Built to Run at the Edge

AI Search is built on top of the Workers Developer Platform, serving requests from the edge.

## Use Cases

### NLWeb and AI Search

AI Search is ideal for creating a powerful search engine for your company's internal and external knowledge and documentation. With support for NLWeb, it can generate deep links to content, helping users navigate large data sources.

### Product Chatbot

You can use AI Search to build a chatbot that answers customer questions using your own product content. This ensures that the chatbot provides accurate and customized responses based on your official documentation and knowledge base. Since AI Search is built to run at the edge, it delivers fast, local AI responses, which improves the user experience by reducing latency.

### Multi-Tenant or Personalized AI Assistants

Use AI Search's metadata filtering to create secure, personalized AI assistants for many different users or teams from a single instance. This feature ensures that each user's queries are answered using only their specific, authorized data, guaranteeing a private and tailored experience for every group.

## Code Examples

### Search from your Worker

Easily make search calls to your AI Search directly in your Workers apps using standard JavaScript or TypeScript.

```typescript
export default {
  async fetch(request, env) {
    const { searchParams } = new URL(request.url);
    const query = searchParams.get('q');
    
    if (!query) {
      return new Response('Please provide a query parameter', { status: 400 });
    }

    // Search your AI Search instance
    const answer = await env.AI.autorag("my-rag").aiSearch({
      query: query,
    });

    return new Response(JSON.stringify(answer), {
      headers: { 'Content-Type': 'application/json' }
    });
  }
};
```

### Metadata Filtering for Multi-Tenant Search

Use metadata filters to build user-specific search contexts, enabling secure multi-user experiences with a single AI Search instance.

```typescript
const answer = await env.AI.autorag("my-autorag").search({
  query: "How do I train a llama to deliver coffee?",
  filters: {
    type: "and",
    filters: [
      {
        type: "eq",
        key: "folder",
        value: "llama/logistics/",
      },
      {
        type: "gte",
        key: "timestamp",
        value: "1735689600000", // unix timestamp for 2025-01-01
      },
    ],
  },
});
```

### AI Search with NLWeb Support

Create a powerful search engine for your company's internal and external knowledge with deep linking support.

```typescript

  // Use ask — NLWeb's standard conversational endpoint
  if (url.pathname === "/ask") {
    return handleAsk(request, env, env.RAG_ID, ctx);
  }

  // Use mcp — NLWeb's MCP server endpoint for trusted AI agents
  if (url.pathname === "/mcp") {
    return NLWebMcp.serve("/mcp").fetch(request, env, {
      ...ctx,
      props: {
        ragId: env.RAG_ID,
      },
    });
  }
```

## Resources

- [Full Documentation](https://developers.cloudflare.com/ai-search): Complete technical documentation
- [Get Started](https://dash.cloudflare.com/sign-up): Sign up and start building
- [Pricing](/plans.md): See pricing details

## Related Products

- [Agents](/products/agents.md): Build stateful AI agents
- [AI Gateway](/products/ai-gateway.md): AI observability
- [Vectorize](/products/vectorize.md): Vector database
- [Web3](/products/web3.md): Web3 Infrastructure

---

*This is a markdown version of [https://www.cloudflare.com/products/ai-search](https://www.cloudflare.com/products/ai-search) for AI/LLM consumption.*
