From ab1818765081c6872de3f8329510506716537174 Mon Sep 17 00:00:00 2001 From: Anni Wang Date: Thu, 24 Apr 2025 23:00:22 -0400 Subject: [PATCH] fix from modified date to timestamp --- .../autorag/2025-04-23-autorag-metadata-filtering.mdx | 2 +- .../docs/autorag/configuration/metadata-filtering.mdx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/changelog/autorag/2025-04-23-autorag-metadata-filtering.mdx b/src/content/changelog/autorag/2025-04-23-autorag-metadata-filtering.mdx index d9f10a7c3341fc6..dacc8c203b3aa21 100644 --- a/src/content/changelog/autorag/2025-04-23-autorag-metadata-filtering.mdx +++ b/src/content/changelog/autorag/2025-04-23-autorag-metadata-filtering.mdx @@ -6,7 +6,7 @@ products: date: 2025-04-23T6:00:00Z --- -You can now filter [AutoRAG](/autorag) search results by `folder` and `modified_date` using [metadata filtering](/autorag/configuration/metadata-filtering/) to narrow down the scope of your query. +You can now filter [AutoRAG](/autorag) search results by `folder` and `timestamp` using [metadata filtering](/autorag/configuration/metadata-filtering/) to narrow down the scope of your query. This makes it easy to build [multitenant experiences](/autorag/how-to/multitenancy/) where each user can only access their own data. By organizing your content into per-tenant folders and applying a `folder` filter at query time, you ensure that each tenant retrieves only their own documents. diff --git a/src/content/docs/autorag/configuration/metadata-filtering.mdx b/src/content/docs/autorag/configuration/metadata-filtering.mdx index 81b9db5bad5fe60..339197e99b83f4f 100644 --- a/src/content/docs/autorag/configuration/metadata-filtering.mdx +++ b/src/content/docs/autorag/configuration/metadata-filtering.mdx @@ -22,7 +22,7 @@ const answer = await env.AI.autorag("my-autorag").search({ }, { type: "gte", - key: "modified_date", + key: "timestamp", value: "1735689600000", // unix timestamp for 2025-01-01 }, ], @@ -32,7 +32,7 @@ const answer = await env.AI.autorag("my-autorag").search({ ## Metadata attributes -You can currently filter by the `folder` and `modified_date` of an R2 object. Currently, custom metadata attributes are not supported. +You can currently filter by the `folder` and `timestamp` of an R2 object. Currently, custom metadata attributes are not supported. ### `folder` @@ -40,7 +40,7 @@ The directory to the object. For example, the `folder` of the object at `llama/l 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`. -### `modified_date` +### `timestamp` 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`. @@ -50,7 +50,7 @@ You can create simple comparison filters or an array of comparison filters using ### Comparison filter -You can compare a metadata attribute (for example, `folder` or `modified_date`) with a target value using a comparison filter. +You can compare a metadata attribute (for example, `folder` or `timestamp`) with a target value using a comparison filter. ```js filters: { @@ -102,7 +102,7 @@ You can see the metadata attributes of your retrieved data in the response under "filename": "llama/logistics/llama-logistics.md", "score": 0.45, "attributes": { - "modified_date": 1735689600000, // unix timestamp for 2025-01-01 + "timestamp": 1735689600000, // unix timestamp for 2025-01-01 "folder": "llama/logistics/", }, "content": [