Skip to content
47% off: the complete course for $79 (reg. $149)Order now →
Agent Builder

AI agent glossary

Reranking

A second retrieval stage that rescores an initial set of search results with a more accurate model, so the best matches end up at the top.

First-stage search, whether keyword or embedding based, is built for speed across a large collection, which means its ordering is approximate. Reranking takes the top results, often a few dozen, and scores each one against the query more carefully.

Rerankers are usually cross-encoder models that read the query and a candidate passage together, which captures relevance better than comparing two separately computed embeddings. A language model can also act as a reranker for small result sets.

The payoff is that you can pass fewer, better passages to the model, which improves answers and saves context. The cost is extra latency and another component to run, so measure whether it improves your retrieval evals before adding it.

Example

A support agent's search returns 30 help-article chunks for 'charged twice'. A reranker moves the duplicate-charge article to the top, and only the top 5 chunks go into the prompt.

Learn more in the course

Related terms

Go from definitions to doing

Learn to use and build AI agents in 65 practical lessons.