Skip to main content
Version: 2.0

Chain Reranker

When refining query results where relevance and diversity are critical to getting the best answers, relying on a single ranking strategy may not be enough for business-critical search scenarios. The Chain Reranker addresses this challenge by enabling you to apply two ranking strategies sequentially.

This is particularly useful in complex search scenarios that require multiple dimensions of relevance. For example, enhancing diversity with the Maximal Marginal Relevance (MMR) reranker while also boosting documents with specific metadata.

Enable the chain reranker

To enable the chain reranker, set the type to chain and then specify the two rerankers that you want to combine.

{
"reranker": {
"type": "chain",
"rerankers": [
{
"type": "customer_specific",
"reranker_id": "rnk_272725719"
},
{
"type": "userfn",
"user_function": "get('$.metadata.popularity') * get('$.metadata.score')"
}
]
}
}

In this example, the Vectara Multilingual Reranker refines the results across over 100 languages, while the User Defined Function reranker boosts relevance based on metadata for popularity.