Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Reranking

Topic: Retrieval and RAGAlso called reranker

Definition

Re-scoring an initial set of retrieved results with a slower, more accurate model before passing only the best few on to the LLM.

In more detail

A typical setup retrieves 50 candidates cheaply and uses a cross-encoder reranker to pick the top 5. It often improves answer quality more than changing the embedding model.

Rerankers read the query and each candidate together, which is slower than comparing pre-computed embeddings but much better at judging relevance. Hosted reranking APIs and open models are both available. Measure the effect with context precision on a golden set, tune how many candidates you rerank and how many you keep, and watch latency, since reranking adds a model call to every query.

  • Hybrid search

    Combining keyword search, such as BM25, with vector search and merging the results into one ranking, often with reciprocal rank fusion.

  • Retrieval-augmented generation (RAG)

    Retrieving relevant documents and adding them to the prompt before the model generates an answer from them.

  • Context precision and recall

    RAG retrieval metrics: precision is the share of retrieved chunks that are relevant, recall the share of needed facts found.

  • Contextual retrieval

    Adding a short, model-written note on where each chunk sits in its source document before embedding and indexing the chunk.

  • Lost in the middle

    The finding that language models use information at the start and end of a long context better than information buried in the middle.

  • Reciprocal rank fusion (RRF)

    A way to merge ranked result lists into one by scoring each document on its positions in the lists, not their raw scores.

  • Retrieval-augmented generation

    Fetching relevant documents and adding them to a prompt to ground answers.

    SkillIntermediate

  • Context precision and recall

    RAG retrieval metrics: precision is the share of retrieved chunks that are relevant, recall the share of needed facts found.

    Glossary

  • RAG fundamentals: retrieval before generation

    What RAG is and how retrieval-augmented generation works, when it beats long context or fine-tuning, and a minimal working pipeline in about 80 lines of Python.

    TutorialBeginner30 min