Manage Settings for $rerank Stage
For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt
Manage Settings for $rerank Stage
You can perform the following tasks in the Atlas UI:
-
Enable or disable Native Reranking [for all projects in your organization](https://www.mongodb.com/docs/vector-search/query/native-reranking/managing.md#std-label-rerank-enable-disable or [per project.](https://www.mongodb.com/docs/vector-search/query/native-reranking/managing.md#std-label-rerank-resource-policy
-
[Monitor Token Usage.](https://www.mongodb.com/docs/vector-search/query/native-reranking/managing.md#std-label-rerank-monitor-usage
-
[View](https://www.mongodb.com/docs/vector-search/query/native-reranking/managing.md#std-label-rerank-view-rate-limits rate limits.
-
[View metrics.](https://www.mongodb.com/docs/vector-search/query/native-reranking/managing.md#std-label-rerank-metrics
Permissions Required
To enable or disable Native Reranking, you must have [Project Owner](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Owner access to the project. If you have [Organization Owner](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Organization-Owner access, you must add yourself as a Project Owner to the project for enabling or disabling Native Reranking.
To view rate limits and usage metrics, you must have [Project Read Only](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Read-Only or [Project Search Index Editor](https://www.mongodb.com/docs/atlas/reference/user-roles.md#mongodb-authrole-Project-Search-Index-Editor access or above to the project.
Enable or Disable Native Reranking for a Project
Before you can use the $rerank stage, you must enable Native Reranking for your project.
Enable or Disable Native Reranking
To enable or disable reranking, complete the following steps:
- In Atlas, go to the Project Settings page.
If it's not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
If it's not already displayed, select your desired project from the Projects menu in the navigation bar.
In the sidebar, click the icon next to Project Overview.
The Project Settings page displays.
- Enable or disable reranking.
To enable reranking, do the following:
In the Project Settings tab, set the Native Reranking: $rerank in the Aggregation Pipeline toggle to On.
In the Confirm Rerank Model Usage window, select the checkbox to confirm that you understand the costs associated with using the $rerank stage and click Confirm.
To disable reranking, complete the following steps:
In the Project Settings tab, set the Native Reranking: $rerank in the Aggregation Pipeline toggle to Off.
In the Disable Native Reranking confirmation window, type Disable and click Disable.
Disabling reranking might cause running queries that use the $rerank stage to fail.
Restrict Native Reranking Using a Resource Policy
You can configure a resource policy at the organization level to block $rerank entirely or with exceptions. To do this, add a forbid rule written in Cedar that targets the $rerank action. If you configure this policy, new projects can't enable $rerank. However, the policy does not disable projects that already have $rerank enabled. You must disable $rerank individually for each project that already has it enabled. To disable $rerank for a project, see [Enable or Disable Native Reranking.](https://www.mongodb.com/docs/vector-search/query/native-reranking/managing.md#std-label-rerank-enable-disable
You can disable $rerank with exceptions by using the unless clause in the forbid rule.
forbid (principal, action == ResourcePolicy::Action::"$rerank", resource) unless { <exception> };
To learn more about setting the resource policy, see [Atlas Resource Policies Overview.](https://www.mongodb.com/docs/atlas/atlas-resource-policies.md#std-label-atlas-resource-policies-overview
Monitor Token Usage
Monitor your token usage on the Usage page in the Atlas UI. To view usage:
- In Atlas, go to the Search & Vector Search page for your cluster.
You can go the MongoDB Search page from the Search & Vector Search option, or the Data Explorer.
###### Search & Vector Search
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Search & Vector Search under the Database heading.
If your project has multiple clusters, select the cluster you want to use from the Select cluster dropdown, then click Go to Atlas Search.
The Search & Vector Search page displays.
###### Data Explorer
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Data Explorer under the Database heading.
Expand the database and select the collection.
Click the Indexes tab for the collection.
Click the Search and Vector Search link in the banner.
The Search & Vector Search page displays.
- Click Usage under Native Reranking in the navigation bar.
The Usage page provides several views to monitor and analyze your token usage. To learn more, see [Token Usage.](https://www.mongodb.com/docs/vector-search/query/native-reranking/billing.md#std-label-rerank-usage-page
Manage Rate Limits
The Rate Limits page in the Atlas UI provides the rate limits for your project and guidance on how to increase them.
Usage Tiers and Rate Limits
Atlas enforces rate limits on the number of requests that you can make within a specific time frame, measured in tokens per minute (TPM) or requests per minute (RPM). Rate limits follow a tiered system, with higher tiers offering increased limits.
| Model | Requests Per Minute (RPM) | Tokens Per Minute (TPM) |
|---|---|---|
rerank-3 |
4,000 | 4,000,000 |
rerank-3-lite |
4,000 | 8,000,000 |
rerank-2.5 |
4,000 | 4,000,000 |
rerank-2.5-lite |
4,000 | 8,000,000 |
rerank-2 |
4,000 | 4,000,000 |
rerank-2-lite |
4,000 | 8,000,000 |
View Rate Limits
- In Atlas, go to the Search & Vector Search page for your cluster.
You can go the MongoDB Search page from the Search & Vector Search option, or the Data Explorer.
###### Search & Vector Search
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Search & Vector Search under the Database heading.
If your project has multiple clusters, select the cluster you want to use from the Select cluster dropdown, then click Go to Atlas Search.
The Search & Vector Search page displays.
###### Data Explorer
If it's not already displayed, select the organization that contains your project from the Organizations menu in the navigation bar.
If it's not already displayed, select your project from the Projects menu in the navigation bar.
In the sidebar, click Data Explorer under the Database heading.
Expand the database and select the collection.
Click the Indexes tab for the collection.
Click the Search and Vector Search link in the banner.
The Search & Vector Search page displays.
- Click Rate Limits under Native Reranking in the navigation bar.
Increase Rate Limits
MongoDB automatically increases rate limits as your usage increases. If you still need a higher rate limit, contact MongoDB Support.
Monitor Metrics for Native Reranking
You can monitor $rerank usage through the following metrics in the Atlas UI:
| Metric | Description |
|---|---|
| $rerank Query Status Rate | The percentage of $rerank queries that complete successfully. Use this metric to identify failures in $rerank queries, such as rate limit errors or connectivity issues with Voyage AI. |
| $rerank Token Usage Rate | The total number of tokens that $rerank queries consume. Use this metric to monitor token consumption and correlate usage with billing. |
To view metrics for $rerank usage:
- Navigate to the Metrics tab for your cluster.
Select the organization that contains your project from the Organizations menu in the navigation bar.
Select your project from the Projects menu in the navigation bar.
In the sidebar, click Clusters under the Database heading.
Click the name of the cluster to open the Cluster sidebar.
Click Metrics in the Cluster sidebar.
- Select the Native Reranking Metrics to view.
You can view the $rerank Query Status Rate and $rerank Token Usage Rate metrics by clicking the appropriate metric.
