Important
Native Reranking is available as a Preview feature. The feature and the corresponding documentation might change at any time during the Preview period. Therefore, we don't recommend using this feature in production environments. We do not use any customer data from this feature to train our models at this time. To learn more, see Preview Features.
You can perform the following tasks in the Atlas UI:
Enable or disable Native Reranking for all projects in your organization or per project.
View rate limits.
Permissions Required
To enable or disable Native Reranking, you must have Project Owner access to the project. If you have 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 or 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
$rerankstage 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
Disableand click Disable.Disabling reranking might cause running queries that use the
$rerankstage 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.
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.
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.
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.
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.
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) |
|---|---|---|
| 4,000 | 4,000,000 |
| 4,000 | 8,000,000 |
| 4,000 | 4,000,000 |
| 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.
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.
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.
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 Token Usage Rate | The total number of tokens that |
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.