# Reranking

> Canonical: https://skillalmanac.com/glossary/reranking | Verification status: pending | Index status: not offered to search engines

Reranking is a second search step that reorders a first set of retrieved candidates by relevance to the query, so the best few can be passed on, for example to a language model.

Also called: reranker, rerank, reranking models, cross-encoder reranking, rerank search results.

## In plain language

Searching a large pile of documents quickly means taking shortcuts, so the first list of results is rough. Reranking is a careful second look at that short list: a model reads the question together with each candidate and puts the best ones at the top. It is like a quick scan of a library shelf followed by a closer read of the few books you pulled out. It cannot recover a document the first step never found, and it adds time and, with hosted services, a charge for each call. It helps most when the right passage is in the first list but buried low down.

## Technical definition

A common retrieval pipeline first fetches a larger candidate set cheaply, using vector search, keyword search such as BM25, or both, and then a reranker scores each candidate against the query and sorts them. Cohere's documentation describes a rerank endpoint that takes a query and a list of documents and returns results ordered from most to least relevant, each with a relevance score. Anthropic's contextual retrieval post describes retrieving an initial set (it used the top 150) and reranking to keep the top 20, and notes a trade-off between reranking more chunks and lower latency and cost.

## How it shows up when you use agents

Reranking sits inside retrieval, between search and the prompt. If you build a question-answering system over documents, or use an [MCP server](/glossary/mcp-server) that searches a knowledge base, the first search often returns more candidates than the prompt can hold. A reranker orders them so the strongest few are kept.

What breaks when it is misunderstood: teams add a reranker to fix answers that fail because the right passage was never retrieved. Reranking cannot add a document the first step missed. Another failure is adding it without measuring, which costs latency and money for no gain.

Next action: log the top retrieved chunks for failing questions, as the [What is RAG](/learn/what-is-rag) guide suggests. If the right chunk is present but low, test a reranker. If it is absent, fix [chunking](/glossary/chunking) or the [embedding](/glossary/embedding) step first. Compare results on questions with known answers before and after.

## Common confusions

- **Reranking versus retrieval.** Retrieval finds candidates from a large store. Reranking reorders a short list of candidates.
- **Reranking versus embeddings.** An embedding turns text into numbers so similar text can be found. A reranker scores a query against each candidate, as Cohere's page describes for its endpoint.
- **Reranking versus filtering.** Reordering changes position. Keeping only the top few is a separate cut that usually follows it.
- **Myth.** A reranker fixes poor chunking. It can only reorder the chunks it is given.

## Worked examples in this catalogue

### [What Is RAG? Retrieval-Augmented Generation Explained](https://skillalmanac.com/learn/what-is-rag)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: The guide describes indexing and querying a document store, and advises logging the top retrieved chunks for each failing question to see whether the answer reached the prompt.

Why it exercises the concept: That log is how you tell whether a reranking step would help: if the right chunk is retrieved but ranked low, reordering is the fix. If it is missing, the fix is earlier in the pipeline.

### [rag-chunking-planner](https://skillalmanac.com/skills/skill-almanac/rag-chunking-planner)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Your documents chunked by three strategies, with defects and offline recall measured for each, so chunk settings are chosen with numbers.

Why it exercises the concept: Reranking only reorders what retrieval found. Measuring recall of the first step shows whether the right chunks are in the candidate set at all.

### [context-window-packer](https://skillalmanac.com/skills/skill-almanac/context-window-packer)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A choice of which files fit one prompt's token budget, with a record of what was kept, shrunk or dropped, and why.

Why it exercises the concept: Reranking exists to decide which few candidates go into a limited prompt. This skill shows the same keep-or-drop decision applied to files.

## Related terms

- [Retrieval-augmented generation (RAG)](https://skillalmanac.com/glossary/retrieval-augmented-generation.md)
- [Semantic search](https://skillalmanac.com/glossary/semantic-search.md)
- [Embedding](https://skillalmanac.com/glossary/embedding.md)
- [Chunking](https://skillalmanac.com/glossary/chunking.md)
- [Vector database](https://skillalmanac.com/glossary/vector-database.md)
- [Context window](https://skillalmanac.com/glossary/context-window.md)
- [Cross-encoder](https://skillalmanac.com/glossary/cross-encoder.md)

## Sources

- [An Overview of Cohere's Rerank Model](https://docs.cohere.com/docs/rerank-overview), Cohere (accessed 2026-11-24)
- [Introducing Contextual Retrieval](https://www.anthropic.com/news/contextual-retrieval), Anthropic (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above. Independent source and example-target verification is pending. [Glossary index](https://skillalmanac.com/glossary.md).
