The short answer
Reranking is a second sorting pass over search results. paqad-ai 1.91.1 contains the code for it, but it is off by default and there is no supported setting or command to switch it on. Retrieval works without it. This page explains what the component does so you know what to expect if a later release exposes it.
What reranking means
When retrieval (RAG, short for retrieval-augmented generation, see the RAG overview) searches your project, the first ranking compares numeric summaries of the query and of each passage. That is quick but approximate. A reranker takes the top of that list and reads the query and each passage together, as a pair, to judge how well they match. Models that work this way are called cross-encoders. They are slower but usually better at ordering close candidates.
How the component behaves
- It runs after the combined meaning-and-keyword ranking and before the confidence floor.
- It looks at a limited pool of candidates, 50 by default (
candidate_pool_size), so the extra time stays bounded. - It only changes the order of results. The original similarity scores are kept, so the confidence floor and the size caps work exactly as they do without reranking.
- If the reranker fails for any reason, Paqad keeps the original order, records a
rag-rerank-fallbackentry in its audit log, and carries on. Retrieval never stops because of it.
The three backends in the code
| Backend | What it does | Where the text goes |
|---|---|---|
passthrough | Keeps the existing order. Used whenever reranking is off. | Nowhere. |
local | Runs the cross-encoder Xenova/ms-marco-MiniLM-L-6-v2 on your machine. The model is downloaded on first use. | Stays on your machine after the download. |
cohere | Calls Cohere's rerank service with the model rerank-english-v3.0 unless another is set. | The query and the full text of up to 50 passages are sent to api.cohere.com. |
The Cohere backend reads its key from a reranking.api_key field in the configuration object, not from an environment variable.
Why it cannot be switched on in 1.91.1
In 1.91.1, Paqad's framework settings are read from .paqad/.config, shared team files under .paqad/configs/, and environment variables. That layer offers retrieval settings such as rag_enabled and rag_top_n, but no reranking setting. When Paqad reads .paqad/project-profile.yaml, it replaces the profile's intelligence section with values from the configuration layer, so a reranking block written into the profile is ignored. The result is that reranking always resolves to its default, off.
Paqad's internal notes also say reranking is not proven to help on code and should pass the built-in retrieval evaluation (paqad-ai rag eval) before a team relies on it.
If you see older instructions mentioning COHERE_API_KEY, rerank_top_k or a reranker: cohere setting, they do not apply to paqad-ai 1.91.1.
What to use instead
To improve what retrieval returns today, adjust what gets indexed and the confidence thresholds. See Narrowing what retrieval can return and Adaptive retrieval depth, and use paqad-ai rag probe "your query" to see the scores retrieval is working with.