Mixedbread

Reranking

Learn how to use reranking to improve search result quality and relevance in your Store searches.

Reranking is an advanced feature that improves the quality and relevance of search results by using specialized models to re-evaluate and reorder the initial results. This second-pass approach significantly enhances result accuracy at the cost of slightly increased latency.

Basic Configuration

The simplest way to enable reranking is to set rerank=True in your search request:

Enable Reranking
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

results = mxbai.stores.search(
  query="API authentication methods",
  store_identifiers=["docs"],
  top_k=10,
  search_options={
      "rerank": True
  }
)

This uses our default reranking model (mixedbread-ai/mxbai-rerank-v3.1-listwise) with standard settings to improve your search results.

Advanced Configuration

Rerank with Configuration
from mixedbread import Mixedbread

mxbai = Mixedbread(api_key="YOUR_API_KEY")

results = mxbai.stores.search(
  query="database optimization techniques",
  store_identifiers=["docs"],
  search_options={
      "rerank": {
          "model": "mixedbread-ai/mxbai-rerank-v3.1-listwise",
          "top_k": 15,
          "with_metadata": ["category", "difficulty"]
      }
}
)

Configuration Options:

  • Reranking Models: Use any supported reranking model. Defaults to "mixedbread-ai/mxbai-rerank-v3.1-listwise" when not specified. See Available Models below.
  • Top-k Constraint: The top_k value must be smaller than or equal to the first-stage retrieval count (your main top_k parameter). Defaults to null, which returns all results from the first stage (respects your main top_k parameter).
  • Metadata Inclusion: Defaults to false. Set to true to include all metadata, or provide a list of specific metadata keys to include.

Available Models

ModelTypeNotes
mixedbread-ai/mxbai-rerank-v3.1-listwiseListwiseDefault. Reads the candidate set as a whole and follows natural-language instructions. See the announcement.
mixedbread-ai/mxbai-rerank-v3-listwiseListwiseNo longer supported. Requests using this name are served by mixedbread-ai/mxbai-rerank-v3.1-listwise; use that model instead.
mixedbread-ai/mxbai-rerank-large-v2Pointwise1.5B-parameter model tuned for accuracy across 100+ languages.