# Reranker Model

## What is a **Reranker**?

A **Reranker** is a model or system used for **ranking tasks**, commonly employed in information retrieval, recommendation systems, or Natural Language Processing (NLP). Its main purpose is to reorder a set of candidate results to return the most relevant or suitable options.

## How Reranker Works

Typically, when a search engine or recommendation system returns a series of candidates (such as search results, recommended products, or articles), they are already ranked according to certain preliminary ranking criteria. These initial rankings may be based on simple matching or basic relevancy indicators. However, such rankings may not fully consider all details or deeper semantic relationships, potentially leading to results that don't completely meet user needs.

For example, if you search online for "best pizza restaurants," the search engine will return many results based on basic criteria like restaurant names, ratings, and addresses. These results might already be ranked based on keywords or simple matching, but they may not fully align with your needs.

This is where the Reranker helps with "**optimizing the ranking**" by examining these results based on more details, potentially considering your past search habits, other people's reviews of the restaurant, or the restaurant's current status, thereby reordering the results to highlight the most relevant restaurants, helping you find the best option more quickly. Using this example, here's how the Reranker works:

{% stepper %}
{% step %}
**Initial Ranking: Use simple ranking models (such as keyword matching, TF-IDF, or other features) to perform preliminary ranking**

Search: "best pizza restaurants," the search engine returns a list of restaurants
{% endstep %}

{% step %}
**Candidate Result Filtering: Refine ranking based on more features (such as context understanding, semantic relationships, user behavior, etc.) to re-score candidates**

Take a closer look at these restaurants, considering if any are in areas you frequently visit, if they have high ratings from other users, or what promotions they offer
{% endstep %}

{% step %}
**Final Ranking: Return the most relevant or suitable results based on their scores**

The Reranker will place the restaurants that best match your needs at the top, making it easier to find the most suitable option
{% endstep %}
{% endstepper %}

## Reranker Model Provided by MaiAgent

### Features of Cohere Rerank v3.5

**Cohere Rerank v3.5** is a **reranking** model provided by Cohere, specifically designed to optimize search results or candidate answer rankings. It can perform fine-grained ranking among candidate results, selecting the most relevant results based on deeper semantic understanding and context, thereby improving the final quality.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.maiagent.ai/tech/maiagent-tech-en/quickstart/reranker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
