Skip to main content

Rerank Configs

Objective: put the most relevant results at the top.

Done when: a search with your rerank config selected returns results in a better order.

What a Rerank Config Does​

Yew's normal search ranks results by how well the words (and, with an embedding config, the meaning) match. A reranker is a separate model, called a cross-encoder, that reads your query and each result together and scores how relevant the result is. It's slower than normal search but better at judging relevance.

With a rerank config selected, Yew takes the top results (the Candidate Window, 200 by default), has the reranker score each one, and reorders them. The final order weighs the reranker's score and the normal search score equally. Results beyond the window keep their order.

If the reranker fails or takes longer than 15 seconds, Yew shows the results in their normal order, so a broken reranker never breaks search.

Top N sets how many of the reranked results are sent to your summary config. The summary uses at most 20, so values above 20 act as 20. Left blank, the summary gets 10. It doesn't shorten the results list.

Before You Start​

You need one of these:

  • A self-hosted Infinity server running a reranker model, such as BAAI/bge-reranker-v2-m3. Infinity isn't part of the Yew install, so run it yourself.
  • An API key for Cohere, Jina or Voyage AI.

1. Create the Config​

  1. Open Rerank Configs in the sidebar and click New Config.
  2. Fill in the form:
FieldWhat to enter
Name (optional)A label for the dropdowns
Providerinfinity, cohere, jina or voyage
ModelThe model name, such as BAAI/bge-reranker-v2-m3
Base URL (optional)Required for Infinity: the server's address, such as http://192.168.1.50:7997. Leave blank for the hosted providers.
API KeyRequired for Cohere, Jina and Voyage. Not needed for Infinity.
Top N (optional)How many reranked results go to the summary. The form accepts 1 to 1000, but the summary uses at most 20. Leave blank for 10.
Candidate WindowHow many top results the reranker scores, from 1 to 1000. Default 200. Higher is more thorough but slower. Must be at least Top N.
  1. Click Create.

Yew sends the reranker one test request when you save, so a wrong key, model or address shows an error now.

The Base URL is reached from the backend container, so use your machine's LAN address, not localhost.

2. Search With It​

On the Search page, open Show Advanced Options and pick your config under Reranker. Choose No Rerank to turn it off. Changing it after a search runs the search again. To use it on every search, click Set as Default on its card, or pick it in Settings.

Editing and Deleting​

Click the edit icon to change a config. Leave API Key blank to keep the saved key. Every save sends a new test request, even when you only changed the name. A Base URL can't be removed by clearing the field: a blank Base URL keeps the saved one. To stop using a Base URL, create a new config without one and delete the old one.

Deleting a config also deletes its saved key. This can't be undone. If it was your default, the default is cleared.