Skip to content

Commit ef10ff9

Browse files
aninibreadToriLindsaykodster28
authored
Apply suggestions from code review
Co-authored-by: ToriLindsay <[email protected]> Co-authored-by: Kody Jackson <[email protected]>
1 parent 7b77385 commit ef10ff9

File tree

14 files changed

+59
-58
lines changed

14 files changed

+59
-58
lines changed

src/content/docs/autorag/configuration/cache.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,26 @@ sidebar:
55
order: 6
66
---
77

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.
99

1010
## How It Works
1111

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:
1313

1414
1. AutoRAG checks if a _similar_ prompt (based on your chosen threshold) has been answered before.
1515
2. If a match is found, it returns the cached response instantly.
1616
3. If no match is found, it generates a new response and caches it.
1717

1818
To see if a response came from the cache, check the `cf-aig-cache-status` header: `HIT` for cached and `MISS` for new.
1919

20-
## Cache behavior
20+
## What to consider when using similarity cache
2121

22+
Consider these behaviors when using similarity caching:
2223
- **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`.
2324
- **30-Day Cache**: Cached responses last 30 days, then expire automatically. No custom durations for now.
2425
- **Data Dependency**: Cached responses are tied to specific document chunks. If those chunks change or get deleted, the cache clears to keep answers fresh.
2526

26-
## How Similarity Matching Works
27+
## How similarity matching works
2728

2829
Similarity caching in AutoRAG uses **MinHash with Locality-Sensitive Hashing (LSH)** to detect prompts that are lexically similar.
2930

@@ -34,9 +35,9 @@ When a new prompt is received:
3435
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.
3536
4. If a prompt in the same bucket meets the configured similarity threshold, its cached response is reused.
3637

37-
## Choosing a Threshold
38+
## Choosing a threshold
3839

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:
4041

4142
| Threshold | Description | Example Match |
4243
| ---------------- | --------------------------- | ------------------------------------------------------------------------------- |

src/content/docs/autorag/configuration/chunking.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ AutoRAG exposes two parameters to help you control chunking behavior:
1818
- Minimum: `0%`
1919
- Maximum: `30%`
2020

21-
These settings apply during the indexing step, before your data are embedded and stored in Vectorize.
21+
These settings apply during the indexing step, before your data is embedded and stored in Vectorize.
2222

2323
## Example
2424

@@ -36,7 +36,7 @@ Chunking affects both how your content is retrieved and how much context is pass
3636

3737
For chunk size, consider how:
3838

39-
- **Smaller chunks** create more percise vector matches, but may split relevant ideas across multiple chunks.
39+
- **Smaller chunks** create more precise vector matches, but may split relevant ideas across multiple chunks.
4040
- **Larger chunks** retain more context, but may dilute relevance and reduce retrieval precision.
4141

4242
For chunk overlap, consider how:

src/content/docs/autorag/configuration/data-source.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ AutoRAG currently supports Cloudflare R2 as the data source for storing your kno
1111

1212
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.
1313

14-
## File Limit
14+
## File limits
1515

1616
AutoRAG has different file size limits depending on the file type:
1717

1818
- Up to **4 MB** for files that are already in plain text or Markdown.
1919
- Up to **1 MB** for files that need to be converted into Markdown (like PDFs or other rich formats).
2020

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.
2222

23-
## File Type
23+
## File types
2424

2525
AutoRAG is powered by and accepts the same file types as [Markdown Conversion](/workers-ai/markdown-conversion/). The following table lists the supported formats:
2626

src/content/docs/autorag/configuration/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The table below lists all available configuration options:
1313

1414
| Configuration | Editable after creation | Description |
1515
| ---------------------------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------ |
16-
| [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) |
1717
| [Chunk size](/autorag/configuration/chunking/) | yes | Number of tokens per chunk |
1818
| [Chunk overlap](/autorag/configuration/chunking/) | yes | Number of overlapping tokens between chunks |
1919
| [Embedding model](/autorag/configuration/models/) | no | Model used to generate vector embeddings |
@@ -31,5 +31,5 @@ The table below lists all available configuration options:
3131
| Service API token | yes | API token granted to AutoRAG to give it permission to configure resources on your account. |
3232

3333
:::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.
3535
:::

src/content/docs/autorag/configuration/indexing.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ AutoRAG automatically monitors your data source for updates and reindexes your c
1313

1414
## Controls
1515

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:
1717

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.
1919
- **Pause Indexing**: Temporarily stop all scheduled indexing checks and reprocessing. Useful for debugging or freezing your knowledge base.
2020

2121
## Performance
@@ -25,10 +25,10 @@ AutoRAG processes files in parallel for efficient indexing. The total time to in
2525
Factors that affect performance include:
2626

2727
- 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)
2929
- Latency of Workers AI models used for embedding and image processing
3030

31-
## Best Practices
31+
## Best practices
3232

3333
To ensure smooth and reliable indexing:
3434

src/content/docs/autorag/configuration/models.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ AutoRAG leverages Workers AI models in the following stages:
1818

1919
## Model providers
2020

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.
2222

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.
2424

2525
## Choosing a model
2626

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.
2828

2929
### Smart default
3030

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**.
3232

3333
### Per-request generation model override
3434

src/content/docs/autorag/configuration/query-rewriting.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The wording of a user’s question may not match how your documents are written.
1818
- Removing filler words or irrelevant details
1919
- Incorporating domain-specific terminology
2020

21-
This leads to more relevant vector matches, which in turn improves the accuracy of the final generated response.
21+
This leads to more relevant vector matches which improves the accuracy of the final generated response.
2222

2323
## Example
2424

src/content/docs/autorag/configuration/retrieval-configuration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ AutoRAG uses the [`query()`](/vectorize/best-practices/query-vectors/) method fr
1414

1515
## Match threshold
1616

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`.
1818

1919
- A higher threshold means stricter filtering, returning only highly similar matches.
2020
- 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.
3939

4040
## Configuration
4141

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/).
4343

4444
Use the parameters `match_threshold` and `max_num_results` to customize retrieval behavior per request.

src/content/docs/autorag/configuration/system-prompt.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
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:
99

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.
1111
- **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.
1212

1313
## What is a system prompt?
@@ -23,12 +23,12 @@ System prompts are particularly useful for:
2323

2424
## Default system prompt
2525

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.
2727

2828
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.
2929

3030
:::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.
3232
:::
3333

3434
## Query rewriting system prompt
@@ -98,6 +98,6 @@ If the available documents don't contain enough information to fully answer the
9898
Important:
9999
- Cite which document(s) you're drawing information from
100100
- 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
102+
- Do not repeat the instructions
103103
```

src/content/docs/autorag/get-started.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@ sidebar:
66
head:
77
- tag: title
88
content: Get started with AutoRAG
9-
Description: XX
9+
Description: Get started creating fully-managed, retrieval-augmented generation pipelines with Cloudflare AutoRAG.
1010
---
1111

1212
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.
1313

1414
## 1. Upload data or use existing data in R2
1515

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.
1717

1818
:::note
1919
Before you create your first bucket, you must purchase R2 from the Cloudflare dashboard.
2020
:::
2121

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:
2323

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**.
2525
2. Select Create bucket, name the bucket, and select **Create bucket**.
2626
3. Choose to either drag and drop your file into the upload area or **select from computer**.
2727

2828
## 2. Create an AutoRAG
2929

3030
To create a new AutoRAG:
3131

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**.
3333
2. Select **Create AutoRAG**, configure the AutoRAG, and complete the setup process.
3434
3. Select **Create**.
3535

0 commit comments

Comments
 (0)