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/autorag/configuration/cache.mdx
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,26 @@ sidebar:
5
5
order: 6
6
6
---
7
7
8
-
Similarity-based caching in AutoRAG lets you serve responses from Cloudflare’s cache for queries that are _similar enough_to previous requests, not just exact matches. This speeds up response times and cuts costs by reusing answers for questions that are close in meaning.
8
+
Similarity-based caching in AutoRAG lets you serve responses from Cloudflare’s cache for queries that are similar to previous requests, rather than creating new, unique responses for every request. This speeds up response times and cuts costs by reusing answers for questions that are close in meaning.
9
9
10
10
## How It Works
11
11
12
-
Unlike basic caching, which only works for identical requests to compare prompts based on their content. When a request comes in:
12
+
Unlike with basic caching, which creates a new response with every request, this is what happens when a request is received using similarity-based caching:
13
13
14
14
1. AutoRAG checks if a _similar_ prompt (based on your chosen threshold) has been answered before.
15
15
2. If a match is found, it returns the cached response instantly.
16
16
3. If no match is found, it generates a new response and caches it.
17
17
18
18
To see if a response came from the cache, check the `cf-aig-cache-status` header: `HIT` for cached and `MISS` for new.
19
19
20
-
## Cache behavior
20
+
## What to consider when using similarity cache
21
21
22
+
Consider these behaviors when using similarity caching:
22
23
-**Volatile Cache**: If two similar requests hit at the same time, the first might not cache in time for the second to use it, resulting in a `MISS`.
23
24
-**30-Day Cache**: Cached responses last 30 days, then expire automatically. No custom durations for now.
24
25
-**Data Dependency**: Cached responses are tied to specific document chunks. If those chunks change or get deleted, the cache clears to keep answers fresh.
25
26
26
-
## How Similarity Matching Works
27
+
## How similarity matching works
27
28
28
29
Similarity caching in AutoRAG uses **MinHash with Locality-Sensitive Hashing (LSH)** to detect prompts that are lexically similar.
29
30
@@ -34,9 +35,9 @@ When a new prompt is received:
34
35
3. Fingerprints are grouped into LSH buckets, which allow AutoRAG to quickly find past prompts that are likely to be similar without scanning every cached prompt.
35
36
4. If a prompt in the same bucket meets the configured similarity threshold, its cached response is reused.
36
37
37
-
## Choosing a Threshold
38
+
## Choosing a threshold
38
39
39
-
The similarity threshold decides how close two prompts need to be to reuse a cached response. Here’s what you can pick from:
40
+
The similarity threshold decides how close two prompts need to be to reuse a cached response. Here are the available thresholds:
Copy file name to clipboardExpand all lines: src/content/docs/autorag/configuration/data-source.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
@@ -11,16 +11,16 @@ AutoRAG currently supports Cloudflare R2 as the data source for storing your kno
11
11
12
12
AutoRAG will automatically scan and process supported files stored in that bucket. Files that are unsupported or exceed the size limit will be skipped during indexing and logged as errors.
13
13
14
-
## File Limit
14
+
## File limits
15
15
16
16
AutoRAG has different file size limits depending on the file type:
17
17
18
18
- Up to **4 MB** for files that are already in plain text or Markdown.
19
19
- Up to **1 MB** for files that need to be converted into Markdown (like PDFs or other rich formats).
20
20
21
-
Files that exceed these limits won’t be indexed and will show up in the error logs.
21
+
Files that exceed these limits will not be indexed and will show up in the error logs.
22
22
23
-
## File Type
23
+
## File types
24
24
25
25
AutoRAG is powered by and accepts the same file types as [Markdown Conversion](/workers-ai/markdown-conversion/). The following table lists the supported formats:
|[Data source](/autorag/configuration/data-source/)| no | The source where your knowledge base is stored (e.g. R2 bucket) |
16
+
|[Data source](/autorag/configuration/data-source/)| no | The source where your knowledge base is stored (for example, R2 bucket) |
17
17
|[Chunk size](/autorag/configuration/chunking/)| yes | Number of tokens per chunk |
18
18
|[Chunk overlap](/autorag/configuration/chunking/)| yes | Number of overlapping tokens between chunks |
19
19
|[Embedding model](/autorag/configuration/models/)| no | Model used to generate vector embeddings |
@@ -31,5 +31,5 @@ The table below lists all available configuration options:
31
31
| Service API token | yes | API token granted to AutoRAG to give it permission to configure resources on your account. |
32
32
33
33
:::note[API token]
34
-
Note that the Service API token is different from the AutoRAG API token that you can make to interact with your AutoRAG. The Service API token is only used by AutoRAG to get permissions to configure resources on your account.
34
+
The Service API token is different from the AutoRAG API token that you can make to interact with your AutoRAG. The Service API token is only used by AutoRAG to get permissions to configure resources on your account.
Copy file name to clipboardExpand all lines: src/content/docs/autorag/configuration/indexing.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,9 @@ AutoRAG automatically monitors your data source for updates and reindexes your c
13
13
14
14
## Controls
15
15
16
-
You can control indexing behavior through the following actions on the Dashboard:
16
+
You can control indexing behavior through the following actions on the dashboard:
17
17
18
-
-**Sync Index**: This forces AutoRAG to scan your data source for new or modified files and initiates an indexing job to update the associated Vectorize index. A new indexing job can be initiated **every 5 minutes**.
18
+
-**Sync Index**: Force AutoRAG to scan your data source for new or modified files and initiate an indexing job to update the associated Vectorize index. A new indexing job can be initiated every 5 minutes.
19
19
-**Pause Indexing**: Temporarily stop all scheduled indexing checks and reprocessing. Useful for debugging or freezing your knowledge base.
20
20
21
21
## Performance
@@ -25,10 +25,10 @@ AutoRAG processes files in parallel for efficient indexing. The total time to in
25
25
Factors that affect performance include:
26
26
27
27
- Total number of files and their sizes
28
-
- File formats (e.g. images take longer than plain text)
28
+
- File formats (for example, images take longer than plain text)
29
29
- Latency of Workers AI models used for embedding and image processing
Copy file name to clipboardExpand all lines: src/content/docs/autorag/configuration/models.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,17 +18,17 @@ AutoRAG leverages Workers AI models in the following stages:
18
18
19
19
## Model providers
20
20
21
-
AutoRAG currently only supports **Workers AI** as the model provider. Usage of models through AutoRAG contributes to your Workers AI usage and is billed as part of your account.
21
+
AutoRAG currently only supports [Workers AI](/workers-ai/) as the model provider. Usage of models through AutoRAG contributes to your Workers AI usage and is billed as part of your account.
22
22
23
-
If you've connected your project to [AI Gateway](/ai-gateway), all model calls triggered by AutoRAG can be tracked in AI Gateway. This gives you full visibility into inputs, outputs, latency, and usage patterns.
23
+
If you have connected your project to [AI Gateway](/ai-gateway), all model calls triggered by AutoRAG can be tracked in AI Gateway. This gives you full visibility into inputs, outputs, latency, and usage patterns.
24
24
25
25
## Choosing a model
26
26
27
-
When configuring your AutoRAG instance, you can specify the exact model to use for each step of embedding, rewriting, and generation. You can find available model that can be used with AutoRAG in the **Settings** of your AutoRAG.
27
+
When configuring your AutoRAG instance, you can specify the exact model to use for each step of embedding, rewriting, and generation. You can find available models that can be used with AutoRAG in the **Settings** of your AutoRAG.
28
28
29
29
### Smart default
30
30
31
-
If you choose Smart Default in your model selection then AutoRAG will select a Cloudflare recommended model. These defaults may change over time as Cloudflare evaluates and updates model choices. You can switch to explicit model configuration at any time by visiting the Settings.
31
+
If you choose **Smart Default** in your model selection, then AutoRAG will select a Cloudflare recommended model. These defaults may change over time as Cloudflare evaluates and updates model choices. You can switch to explicit model configuration at any time by visiting **Settings**.
Copy file name to clipboardExpand all lines: src/content/docs/autorag/configuration/retrieval-configuration.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ AutoRAG uses the [`query()`](/vectorize/best-practices/query-vectors/) method fr
14
14
15
15
## Match threshold
16
16
17
-
The `match_threshold` sets the minimum similarity score (e.g., cosine similarity) that a document chunk must meet to be included in the results. Threshold values range from `0` to `1`.
17
+
The `match_threshold` sets the minimum similarity score (for example, cosine similarity) that a document chunk must meet to be included in the results. Threshold values range from `0` to `1`.
18
18
19
19
- A higher threshold means stricter filtering, returning only highly similar matches.
20
20
- A lower threshold allows broader matches, increasing recall but possibly reducing precision.
@@ -39,6 +39,6 @@ If no results meet the threshold, AutoRAG will not generate a response.
39
39
40
40
## Configuration
41
41
42
-
These values can be configured at the AutoRAG instance level or overridden on a per-request basis using the [REST API](/autorag/usage/rest-api/) or the [Workers binding](/autorag/usage/workers-binding/).
42
+
These values can be configured at the AutoRAG instance level or overridden on a per-request basis using the [REST API](/autorag/usage/rest-api/) or the [Workers Binding](/autorag/usage/workers-binding/).
43
43
44
44
Use the parameters `match_threshold` and `max_num_results` to customize retrieval behavior per request.
Copy file name to clipboardExpand all lines: src/content/docs/autorag/configuration/system-prompt.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ sidebar:
7
7
8
8
System prompts allow you to guide the behavior of the text-generation models used by AutoRAG at query time. AutoRAG supports system prompt configuration in two steps:
9
9
10
-
-**Query Rewriting**: Reformulates the original user query to improve semantic retrieval. A system prompt can guide how the model interprets and rewrites the query.
10
+
-**Query rewriting**: Reformulates the original user query to improve semantic retrieval. A system prompt can guide how the model interprets and rewrites the query.
11
11
-**Generation**: Generates the final response from retrieved context. A system prompt can help define how the model should format, filter, or prioritize information when constructing the answer.
12
12
13
13
## What is a system prompt?
@@ -23,12 +23,12 @@ System prompts are particularly useful for:
23
23
24
24
## Default system prompt
25
25
26
-
When configuring your AutoRAG instance, you can provide your own system prompts. If you don’t provide a system prompt, AutoRAG will use the **default system prompt** provided by Cloudflare.
26
+
When configuring your AutoRAG instance, you can provide your own system prompts. If you do not provide a system prompt, AutoRAG will use the **default system prompt** provided by Cloudflare.
27
27
28
28
You can view the effective system prompt used for any AutoRAG's model call through AI Gateway logs, where model inputs and outputs are recorded.
29
29
30
30
:::note
31
-
The default system prompt can change and evolve over time to improve performance, and quality.
31
+
The default system prompt can change and evolve over time to improve performance and quality.
32
32
:::
33
33
34
34
## Query rewriting system prompt
@@ -98,6 +98,6 @@ If the available documents don't contain enough information to fully answer the
98
98
Important:
99
99
- Cite which document(s) you're drawing information from
100
100
- Present information in order of relevance
101
-
- If documents contradict each other, note this and explain your reasoning for the chosen answer`
102
-
- Do not repeat the instructions;
101
+
- If documents contradict each other, note this and explain your reasoning for the chosen answer
Copy file name to clipboardExpand all lines: src/content/docs/autorag/get-started.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,30 +6,30 @@ sidebar:
6
6
head:
7
7
- tag: title
8
8
content: Get started with AutoRAG
9
-
Description: XX
9
+
Description: Get started creating fully-managed, retrieval-augmented generation pipelines with Cloudflare AutoRAG.
10
10
---
11
11
12
12
AutoRAG allows developers to create fully managed retrieval-augmented generation (RAG) pipelines to power AI applications with accurate and up-to-date information without needing to manage infrastructure.
13
13
14
14
## 1. Upload data or use existing data in R2
15
15
16
-
AutoRAG integrates with R2 for data import. Create an R2 bucket if you don’t have one and upload your data.
16
+
AutoRAG integrates with R2 for data import. Create an R2 bucket if you do not have one and upload your data.
17
17
18
18
:::note
19
19
Before you create your first bucket, you must purchase R2 from the Cloudflare dashboard.
20
20
:::
21
21
22
-
To create and upload objects to your bucket from the Cloudflare Dashboard:
22
+
To create and upload objects to your bucket from the Cloudflare dashboard:
23
23
24
-
1. Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com/?to=/:account/r2) and select **R2**.
24
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/r2) and select **R2**.
25
25
2. Select Create bucket, name the bucket, and select **Create bucket**.
26
26
3. Choose to either drag and drop your file into the upload area or **select from computer**.
27
27
28
28
## 2. Create an AutoRAG
29
29
30
30
To create a new AutoRAG:
31
31
32
-
1. Log in to the [Cloudflare Dashboard](https://dash.cloudflare.com/?to=/:account/ai/autorag) and select **AI** > **AutoRAG**.
32
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/ai/autorag) and select **AI** > **AutoRAG**.
33
33
2. Select **Create AutoRAG**, configure the AutoRAG, and complete the setup process.
0 commit comments