You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/ai-search/concepts/how-ai-search-works.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ sidebar:
5
5
order: 2
6
6
---
7
7
8
-
AI Search (formerly AutoRAG) is Cloudflare’s managed search service. You can connect your data such as websites or unstructured content, and it automatically creates a continuously updating index that you can query with natural language in your applications or AI agents.
8
+
AI Search is Cloudflare’s managed search service. You can connect your data such as websites or unstructured content, and it automatically creates a continuously updating index that you can query with natural language in your applications or AI agents.
Copy file name to clipboardExpand all lines: src/content/docs/ai-search/configuration/chunking.mdx
+1-13Lines changed: 1 addition & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,9 +20,7 @@ This way, chunks are easy to embed and retrieve, without cutting off thoughts mi
20
20
21
21
AI Search exposes two parameters to help you control chunking behavior:
22
22
23
-
-**Chunk size**: The number of tokens per chunk.
24
-
- Minimum: `64`
25
-
- Maximum: `512`
23
+
-**Chunk size**: The number of tokens per chunk. The option range may vary depending on the model.
26
24
-**Chunk overlap**: The percentage of overlapping tokens between adjacent chunks.
27
25
- Minimum: `0%`
28
26
- Maximum: `30%`
@@ -33,16 +31,6 @@ These settings apply during the indexing step, before your data is embedded and
33
31
34
32
Chunking affects both how your content is retrieved and how much context is passed into the generation model. Try out this external [chunk visualizer tool](https://huggingface.co/spaces/m-ric/chunk_visualizer) to help understand how different chunk settings could look.
35
33
36
-
For chunk size, consider how:
37
-
38
-
-**Smaller chunks** create more precise vector matches, but may split relevant ideas across multiple chunks.
39
-
-**Larger chunks** retain more context, but may dilute relevance and reduce retrieval precision.
40
-
41
-
For chunk overlap, consider how:
42
-
43
-
-**More overlap** helps preserve continuity across boundaries, especially in flowing or narrative content.
44
-
-**Less overlap** reduces indexing time and cost, but can miss context if key terms are split between chunks.
45
-
46
34
### Additional considerations:
47
35
48
36
-**Vector index size:** Smaller chunk sizes produce more chunks and more total vectors. Refer to the [Vectorize limits](/vectorize/platform/limits/) to ensure your configuration stays within the maximum allowed vectors per index.
Copy file name to clipboardExpand all lines: src/content/docs/ai-search/configuration/data-source/website.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,9 +146,9 @@ If you have Security rules configured to block bot activity, you can add a rule
146
146
147
147
You can configure parsing options during onboarding or in your instance settings under **Parser options**.
148
148
149
-
### Sitemap
149
+
### Specific sitemap
150
150
151
-
By default, AI Search crawls all sitemaps listed in your `robots.txt` in the order they appear (top to bottom). If you do not want the crawler to index everything, you can specify a single sitemap URL to limit which pages are crawled.
151
+
By default, AI Search crawls all sitemaps listed in your `robots.txt` in the order they appear (top to bottom). If you do not want the crawler to index everything, you can specify a single sitemap URL to limit which pages are crawled. You can add up to 5 specific sitemaps.
152
152
153
153
### Rendering mode
154
154
@@ -157,7 +157,7 @@ You can choose how pages are parsed during crawling:
157
157
-**Static sites**: Downloads the raw HTML for each page.
158
158
-**Rendered sites**: Loads pages with a headless browser and downloads the fully rendered version, including dynamic JavaScript content. Note that the [Browser Rendering](/browser-rendering/pricing/) limits and billing apply.
159
159
160
-
## Access protected content
160
+
## Extra headers for access protected content
161
161
162
162
If your website has pages behind authentication or are only visible to logged-in users, you can configure custom HTTP headers to allow the AI Search crawler to access this protected content. You can add up to five custom HTTP headers to the requests AI Search sends when crawling your site.
Copy file name to clipboardExpand all lines: src/content/docs/ai-search/configuration/path-filtering.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Path filtering works with both [website](/ai-search/configuration/data-source/we
13
13
14
14
You can configure path filters when creating or editing an AI Search instance. In the dashboard, open **Path Filters** and add your include or exclude rules. You can also update path filters at any time from the **Settings** page of your instance.
15
15
16
-
When using the API, specify `include_items` and `exclude_items` in the `source_params` of your configuration:
16
+
When using the REST API, specify `include_items` and `exclude_items` in the `source_params` of your configuration:
Copy file name to clipboardExpand all lines: src/content/docs/ai-search/configuration/service-api-token.mdx
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,13 +15,16 @@ Service API tokens are required during the AI Search beta. This requirement may
15
15
16
16
When you create an AI Search instance, it needs to interact with other Cloudflare services on your behalf, such as [R2](/r2/), [Vectorize](/vectorize/), and [Workers AI](/workers-ai/). The service API token authorizes AI Search to perform these operations. Without it, AI Search cannot index your data or respond to queries.
17
17
18
+
This token requires the AI Search Index Engine permission (`9e9b428a0bcd46fd80e580b46a69963c`) which grants access to run AI Search Index Engine.
19
+
20
+
18
21
## Service API token vs. AI Search API token
19
22
20
23
AI Search uses two types of API tokens for different purposes:
21
24
22
25
| Token type | Purpose | Who uses it | When to create |
| Service API token | Grants AI Search permission to access R2, Vectorize, and Workers AI | AI Search (internal) | Once per account, during first instance creation |
27
+
| Service API token | Grants AI Search permission to access R2, Vectorize, Browser Rendering and Workers AI | AI Search (internal) | Once per account, during first instance creation |
25
28
| AI Search API token | Authenticates your requests to query or manage AI Search instances | You (external) | When calling the AI Search REST API |
26
29
27
30
The **service API token** is used internally by AI Search to perform background operations like indexing your content and generating responses. You create it once and AI Search uses it automatically.
Copy file name to clipboardExpand all lines: src/content/docs/ai-search/configuration/system-prompt.mdx
+33-33Lines changed: 33 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,39 +58,6 @@ The system prompt for your AI Search can be set after it has been created:
58
58
3. Go to the **Settings** tab.
59
59
4. Go to **Query rewrite** or **Generation**, and edit the **System prompt**.
60
60
61
-
## Query rewriting system prompt
62
-
63
-
If query rewriting is enabled, you can provide a custom system prompt to control how the model rewrites user queries. In this step, the model receives:
64
-
65
-
- The query rewrite system prompt
66
-
- The original user query
67
-
68
-
The model outputs a rewritten query optimized for semantic retrieval.
69
-
70
-
### Example
71
-
72
-
```text
73
-
You are a search query optimizer for vector database searches. Your task is to reformulate user queries into more effective search terms.
74
-
75
-
Given a user's search query, you must:
76
-
1. Identify the core concepts and intent
77
-
2. Add relevant synonyms and related terms
78
-
3. Remove irrelevant filler words
79
-
4. Structure the query to emphasize key terms
80
-
5. Include technical or domain-specific terminology if applicable
81
-
82
-
Provide only the optimized search query without any explanations, greetings, or additional commentary.
83
-
84
-
Example input: "how to fix a bike tire that's gone flat"
- Maintain all important meaning from original query
92
-
```
93
-
94
61
## Generation system prompt
95
62
96
63
If you are using the AI Search API endpoint, you can use the system prompt to influence how the LLM responds to the final user query using the retrieved results. At this step, the model receives:
@@ -128,3 +95,36 @@ Important:
128
95
- If documents contradict each other, note this and explain your reasoning for the chosen answer
129
96
- Do not repeat the instructions
130
97
```
98
+
99
+
## Query rewriting system prompt
100
+
101
+
If query rewriting is enabled, you can provide a custom system prompt to control how the model rewrites user queries. In this step, the model receives:
102
+
103
+
- The query rewrite system prompt
104
+
- The original user query
105
+
106
+
The model outputs a rewritten query optimized for semantic retrieval.
107
+
108
+
### Example
109
+
110
+
```text
111
+
You are a search query optimizer for vector database searches. Your task is to reformulate user queries into more effective search terms.
112
+
113
+
Given a user's search query, you must:
114
+
1. Identify the core concepts and intent
115
+
2. Add relevant synonyms and related terms
116
+
3. Remove irrelevant filler words
117
+
4. Structure the query to emphasize key terms
118
+
5. Include technical or domain-specific terminology if applicable
119
+
120
+
Provide only the optimized search query without any explanations, greetings, or additional commentary.
121
+
122
+
Example input: "how to fix a bike tire that's gone flat"
0 commit comments