Skip to content

Commit d76ebdd

Browse files
committed
changelog + docs updated
1 parent 96ca208 commit d76ebdd

File tree

8 files changed

+139
-21
lines changed

8 files changed

+139
-21
lines changed

public/__redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214

215215
#autorag
216216
/autorag/usage/recipes/ /autorag/how-to/ 301
217+
/autorag/configuration/metadata-filtering/ /autorag/configuration/metadata/ 301
217218

218219
# bots
219220
/bots/about/plans/ /bots/plans/ 301
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: View custom metadata in responses and guide AI-search with context in AutoRAG
3+
description: You can now view custom metadata in AutoRAG search responses and use a context field to provide additional guidance to AI-generated answers.
4+
products:
5+
- autorag
6+
date: 2025-06-16T6:10:00Z
7+
---
8+
9+
In [AutoRAG](/autorag/), you can now view your object's custom metadata in the response from [`/search`](/autorag/usage/workers-binding/) and [`/ai-search`](/autorag/usage/workers-binding/), and optionally add a `context` field in the custom metadata of an object to provide additional guidance for AI-generated answers.
10+
11+
You can add [custom metadata](/r2/api/workers/workers-api-reference/#r2putoptions) to an object when uploading it to your R2 bucket.
12+
13+
# Object's custom metadata in search responses
14+
15+
When you run a search, AutoRAG now returns any custom metadata associated with the object. This metadata appears in the response under `file`, inside `attributes`, and can be used for downstream processing.
16+
17+
For example, the `attributes` section of your search response may look like:
18+
19+
```json
20+
{
21+
"attributes": {
22+
"timestamp": 1750001460000,
23+
"folder": "docs/",
24+
"filename": "product-launch-checklist.md",
25+
"file": {
26+
"url": "https://wiki.company.com/docs/product-launch-checklist",
27+
"context": "A checklist for internal launch readiness, including legal, engineering, and marketing steps."
28+
}
29+
}
30+
}
31+
```
32+
33+
# Add a `context` field to guide LLM answers
34+
35+
When you include a custom metadata field named `context`, AutoRAG attaches that value to each chunk of the file. When you run an `/ai-search` query, this `context` is passed to the LLM and can be used as additional input when generating an answer.
36+
37+
We recommend using the `context` field to describe supplemental information you want the LLM to consider, such as a summary of the document or a source URL.
38+
39+
For example:
40+
41+
```json
42+
context: "summary: 'Checklist for internal product launch readiness, including legal, engineering, and marketing steps.'; url: 'https://wiki.company.com/docs/product-launch-checklist'"
43+
```
44+
45+
This gives you more control over how your content is interpreted, without requiring you to modify the original contents of the file.
46+
47+
Learn more in AutoRAG's [metadata filtering documentation](/autorag/configuration/metadata-filtering/).
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: Filter your AutoRAG search by file name
3+
description: You can now filter AutoRAG search queries by file name, allowing you to control which files can be retrieved for a given query.
4+
products:
5+
- autorag
6+
date: 2025-06-16T6:00:00Z
7+
---
8+
9+
In [AutoRAG](/autorag/), you can now [filter](/autorag/configuration/metadata-filtering/) by an object's file name using the `filename` attribute, giving you more control over which files are searched for a given query.
10+
11+
This is useful when your application has already determined which files should be searched. For example, you might query a PostgreSQL database to get a list of files a user has access to based on their permissions, and then use that list to limit what AutoRAG retrieves.
12+
13+
For example, your search query may look like:
14+
15+
```json
16+
const response = await env.AI.autorag("my-autorag").search({
17+
query: "what is the project deadline?",
18+
filters: {
19+
type: "eq",
20+
key: "filename",
21+
value: "project-alpha-roadmap.md",
22+
},
23+
});
24+
```
25+
26+
This allows you to connect your application logic with AutoRAG's retrieval process, making it easy to control what gets searched without needing to reindex or modify your data.
27+
28+
Learn more in AutoRAG's [metadata filtering documentation](/autorag/configuration/metadata-filtering/).
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
pcx_content_type: navigation
3+
title: REST API
4+
external_link: /api/resources/autorag/
5+
sidebar:
6+
order: 9
7+
---

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ AutoRAG will automatically scan and process supported files stored in that bucke
1616
AutoRAG has different file size limits depending on the file type:
1717

1818
- **Plain text files:** Up to **4 MB**
19-
- **Rich format files:** Up to **1 MB**
19+
- **Rich format files:** Up to **4 MB**
2020

2121
Files that exceed these limits will not be indexed and will show up in the error logs.
2222

@@ -30,7 +30,7 @@ AutoRAG supports the following plain text file types:
3030

3131
| Format | File extensions | Mime Type |
3232
| ---------- | ------------------------------------------------------------------------------ | --------------------------------------------------------------------- |
33-
| Text | `.txt` | `text/plain` |
33+
| Text | `.txt`, `.rst` | `text/plain` |
3434
| Log | `.log` | `text/plain` |
3535
| Config | `.ini`, `.conf`, `.env`, `.properties`, `.gitignore`, `.editorconfig`, `.toml` | `text/plain`, `text/toml` |
3636
| Markdown | `.markdown`, `.md`, `.mdx` | `text/markdown` |

src/content/docs/autorag/configuration/metadata-filtering.mdx renamed to src/content/docs/autorag/configuration/metadata.mdx

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
22
pcx_content_type: concept
3-
title: Metadata filtering
3+
title: Metadata
44
sidebar:
55
order: 6
66
---
77

88
import { FileTree } from "~/components"
99

10+
## Metadata filtering
1011
Metadata filtering narrows down search results based on metadata, so only relevant content is retrieved. The filter narrows down results prior to retrieval, so that you only query the scope of documents that matter.
1112

1213
Here is an example of metadata filtering using [Workers Binding](/autorag/usage/workers-binding/) but it can be easily adapted to use the [REST API](/autorag/usage/rest-api/) instead.
@@ -32,25 +33,19 @@ const answer = await env.AI.autorag("my-autorag").search({
3233
});
3334
```
3435

35-
## Metadata attributes
36+
### Metadata attributes
3637

37-
You can currently filter by the `folder` and `timestamp` of an R2 object. Currently, custom metadata attributes are not supported.
38+
| Attribute | Description | Example |
39+
| --- | --- | --- |
40+
| `filename` | The name of the file. | `dog.png` or `animals/mammals/cat.png` |
41+
| `folder` | The prefix or directory to the object. | For the object `animals/mammals/cat.png`, the folder is `animals/mammals/` |
42+
| `timestamp` | The timestamp for when the object was last modified. Comparisons are supported using a 13-digit Unix timestamp (milliseconds), but values will be rounded to 10 digits (seconds). | The timestamp `2025-01-01 00:00:00.999 UTC` is `1735689600999` and it will be rounded to `1735689600000`, corresponding to `2025-01-01 00:00:00 UTC` |
3843

39-
### Folder
40-
41-
The directory to the object. For example, the `folder` of the object at `llama/logistics/llama-logistics.mdx` is `llama/logistics/`. Note that the `folder` does not include a leading `/`.
42-
43-
Note that `folder` filter only includes files exactly in that folder, so files in subdirectories are not included. For example, specifying `folder: "llama/"` will match files in `llama/` but does not match files in `llama/logistics`.
44-
45-
### Timestamp
46-
47-
The timestamp indicating when the object was last modified. Comparisons are supported using a 13-digit Unix timestamp (milliseconds), but values will be rounded to 10 digits (seconds). For example, `1735689600999` or `2025-01-01 00:00:00.999 UTC` will be rounded down to `1735689600000`, corresponding to `2025-01-01 00:00:00 UTC`.
48-
49-
## Filter schema
44+
### Filter schema
5045

5146
You can create simple comparison filters or an array of comparison filters using a compound filter.
5247

53-
### Comparison filter
48+
#### Comparison filter
5449

5550
You can compare a metadata attribute (for example, `folder` or `timestamp`) with a target value using a comparison filter.
5651

@@ -73,7 +68,7 @@ The available operators for the comparison are:
7368
| `lt` | Less than |
7469
| `lte` | Less than or equals to |
7570

76-
### Compound filter
71+
#### Compound filter
7772

7873
You can use a compound filter to combine multiple comparison filters with a logical operator.
7974

@@ -93,7 +88,7 @@ Note the following limitations with the compound operators:
9388
- Only the `eq` operator is allowed.
9489
- All conditions must filter on the **same key** (for example, all on `folder`)
9590

96-
### "Starts with" filter for folders
91+
#### "Starts with" filter for folders
9792

9893
You can use "starts with" filtering on the `folder` metadata attribute to search for all files and subfolders within a specific path.
9994

@@ -137,6 +132,25 @@ This filter identifies paths starting with `customer-a/` by using:
137132

138133
Together, these conditions effectively select paths that begin with the provided path value.
139134

135+
## Add a `context` field to guide AI Search
136+
You can optionally include a custom metadata field named `context` when uploading an object to your R2 bucket.
137+
138+
The `context` field is attached to each chunk and passed to the LLM during an `/ai-search` query. It does not affect retrieval but helps the LLM interpret and frame the answer.
139+
140+
The field can be used for providing document summaries, source links, or custom instructions without modifying the file content.
141+
142+
You can add [custom metadata](/r2/api/workers/workers-api-reference/#r2putoptions) to an object in the `/PUT` operation when uploading the object to your R2 bucket. For example if you are using the [Workers binding with R2](/r2/api/workers/workers-api-usage/):
143+
144+
```javascript
145+
await env.MY_BUCKET.put("cat.png", file, {
146+
customMetadata: {
147+
context: "This is a picture of Joe's cat. His name is Max."
148+
}
149+
});
150+
```
151+
152+
During `/ai-search`, this context appears in the response under `attributes.file.context`, and is included in the data passed to the LLM for generating a response.
153+
140154
## Response
141155

142156
You can see the metadata attributes of your retrieved data in the response under the property `attributes` for each retrieved chunk. For example:
@@ -150,6 +164,10 @@ You can see the metadata attributes of your retrieved data in the response under
150164
"attributes": {
151165
"timestamp": 1735689600000, // unix timestamp for 2025-01-01
152166
"folder": "llama/logistics/",
167+
"file": {
168+
"url": "www.llamasarethebest.com/logistics"
169+
"context": "This file contains information about how llamas can logistically deliver coffee."
170+
}
153171
},
154172
"content": [
155173
{

src/content/docs/autorag/platform/limits-pricing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ The following limits currently apply to AutoRAG during the open beta:
2626
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
2727
| Max AutoRAG instances per account | 10 |
2828
| Max files per AutoRAG | 100,000 |
29-
| Max file size | 4 MB ([Plain text](/autorag/configuration/data-source/#plain-text-file-types)) / 1 MB ([Rich format](/autorag/configuration/data-source/#rich-format-file-types)) |
29+
| Max file size | 4 MB |
3030

3131
These limits are subject to change as AutoRAG evolves beyond open beta.

src/content/release-notes/autorag.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,27 @@ productLink: "/autorag/"
55
productArea: Developer platform
66
productAreaLink: /workers/platform/changelog/platform/
77
entries:
8+
- publish_date: "2025-06-16"
9+
title: Rich format file size limit increased to 4 MB
10+
description: |-
11+
You can now index rich format files (e.g., PDF) up to 4 MB in size, up from the previous 1 MB limit.
12+
- publish_date: "2025-06-12"
13+
title: Index processing status
14+
description: |-
15+
The dashboard now includes a new “Processing” step for the indexing pipeline that displays the files currently being processed.
16+
- publish_date: "2025-06-12"
17+
title: Sync AutoRAG REST API published
18+
description: |-
19+
You can now trigger a sync job for an AutoRAG using the [Sync REST API](/api/resources/autorag/subresources/rags/methods/sync/). This scans your data source for changes and queues updated or previously errored files for indexing.
20+
- publish_date: "2025-06-10"
21+
title: Files modified in the data source will now be updated
22+
description: |-
23+
Files modified in your source R2 bucket will now be updated in the AutoRAG index during the next sync. For example, if you upload a new version of an existing file, the changes will be reflected in the index after the subsequent sync job.
24+
Please note that deleted files are not yet removed from the index. We are actively working on this functionality.
825
- publish_date: "2025-05-31"
926
title: Errored files will now be retried in next sync
1027
description: |-
11-
Files that fail to index will now be automatically retried in the next indexing job. For instance, if a file initially failed because it was oversized but was then corrected (e.g. replaced with a file of the same name/key within the size limit), it will be re-attempted during the next scheduled sync.
28+
Files that failed to index will now be automatically retried in the next indexing job. For instance, if a file initially failed because it was oversized but was then corrected (e.g. replaced with a file of the same name/key within the size limit), it will be re-attempted during the next scheduled sync.
1229
- publish_date: "2025-05-31"
1330
title: Fixed character cutoff in recursive chunking
1431
description: |-

0 commit comments

Comments
 (0)