---
title: Metadata filtering and multitenancy support in AutoRAG
description: Add metadata filters to AutoRAG queries to enable multitenancy and control the scope of retrieved results.
image: https://developers.cloudflare.com/changelog-preview.png
---

[Skip to content](#%5Ftop) 

# Changelog

New updates and improvements at Cloudflare.

[ Subscribe to RSS ](https://developers.cloudflare.com/changelog/rss/index.xml) [ View RSS feeds ](https://developers.cloudflare.com/fundamentals/new-features/available-rss-feeds/) 

![hero image](https://developers.cloudflare.com/_astro/hero.CVYJHPAd_26AMqX.svg) 

[ ← Back to all posts ](https://developers.cloudflare.com/changelog/) 

## Metadata filtering and multitenancy support in AutoRAG

Apr 23, 2025 

[ AI Search ](https://developers.cloudflare.com/ai-search/) 

You can now filter [AutoRAG](https://developers.cloudflare.com/ai-search/) search results by `folder` and `timestamp` using [metadata filtering](https://developers.cloudflare.com/ai-search/configuration/indexing/metadata/) to narrow down the scope of your query.

This makes it easy to build [multitenant experiences](https://developers.cloudflare.com/ai-search/how-to/per-tenant-search/) 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.

**Example folder structure:**

Terminal window

```

customer-a/logs/

customer-a/contracts/

customer-b/contracts/


```

**Example query:**

JavaScript

```

const response = await env.AI.autorag("my-autorag").search({

  query: "When did I sign my agreement contract?",

  filters: {

    type: "eq",

    key: "folder",

    value: "customer-a/contracts/",

  },

});


```

You can use metadata filtering by creating a new AutoRAG or reindexing existing data. To reindex all content in an existing AutoRAG, update any chunking setting and select **Sync index**. Metadata filtering is available for all data indexed on or after **April 21, 2025**.

If you are new to AutoRAG, get started with the [Get started AutoRAG guide](https://developers.cloudflare.com/ai-search/get-started/).