> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/tech/en/quickstart/reranker.md).

# Reranker Model

## What Is a **Reranker**?

A **Reranker** is a model or system used for **ranking tasks**, typically in information retrieval, recommendation systems, or natural language processing (NLP). Its primary purpose is to reorder a set of candidate results so that the most relevant or suitable options are returned.

## How a Reranker Works

When a search engine or recommendation system returns a set of candidates—such as search results, recommended products, or articles—they have typically already been ordered according to preliminary ranking criteria. This initial ranking may be based on simple matching or basic relevance metrics. However, it may not fully account for every detail or deeper semantic relationships, which can produce results that do not completely meet the user's needs.

For example, suppose you search online for “the best pizza restaurants.” The search engine returns many results based on basic criteria such as restaurant names, ratings, and addresses. These results may already be ranked by keyword or simple matching, but they may not fully meet your needs.

At this point, a Reranker further helps you “**optimize the ranking**.” It examines the results using additional details, potentially considering your previous search habits, other customers' reviews, or the restaurants' latest status. It then reranks the results and selects the most relevant restaurants, helping you find the best option more quickly. In this example, the Reranker workflow is as follows:\\

{% stepper %}
{% step %}
**Initial ranking: Use a simple ranking model (such as keyword matching, TF-IDF, or other features) to rank the candidates initially**

Search for “the best pizza restaurants,” and the search engine returns a list of restaurants
{% endstep %}

{% step %}
**Candidate refinement: Refine the ranking and rescore the candidates using additional features, such as contextual understanding, semantic relationships, and user behavior**

Examine the restaurants more closely, considering whether they are in areas you visit frequently, whether other users have rated them highly, or whether they offer promotions
{% endstep %}

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

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

## Reranker Models Provided by MaiAgent

### Features of Cohere Rerank v3.5

**Cohere Rerank v3.5** is a **reranking** model provided by Cohere. It is designed specifically to optimize the ranking of search results or candidate answers. It precisely ranks candidates and uses deeper semantic and contextual understanding to select the most relevant results, thereby improving the final quality.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
