AI explained

Reranking in RAG: what it does and when to add it

Retrieval finds candidates and reranking puts them in the right order. See how the second pass works, when it is worth the extra step and how to measure the gain.

By the Askocto team · · 5 min read

Reranking is a second pass over search results. A first step pulls a shortlist of passages that might answer a question, and the reranker reads each one next to the question and puts them in a better order. The model then sees the strongest passages first. This article explains where reranking sits in a retrieval pipeline, when it pays off and how to test it without special tools.

In short: Retrieval is fast and rough. Reranking is slower and more careful, so it only looks at the shortlist. Add it when the right passage is usually retrieved but often buried below the top few.

Where reranking sits in the pipeline

A retrieval-augmented answer follows a fixed path. The customer asks a question, the system searches your content, and the best passages go to the model along with the question. If you want the background, how to build a RAG chatbot walks through the whole sequence.

With reranking, the search part splits in two:

  1. Candidate retrieval. The system searches all your content and returns a generous shortlist, for example the top 30 passages.
  2. Reranking. A second model scores each of those 30 against the question and sorts them.
  3. Selection. Only the top few after sorting, say three to five, go to the model that writes the answer.

The first step has to be quick because it searches everything. The second can be slower because it only handles a few dozen passages.

Why the first pass gets the order wrong

Most first-pass search relies on vector embeddings: each passage and the question become lists of numbers, and the closest passages win. That is good at finding passages about the right topic. It is weaker at telling apart passages that are close in topic but differ in the detail that matters.

Take a question like "Can I return a sale item after 30 days?" A help center might hold three nearby passages:

  • The general return policy.
  • The sale item exception.
  • The warranty terms for damaged goods.

All three sit close to the question in meaning. A first pass may rank the general policy first because it is the broadest match. The sale item exception is the one that answers the question, and it might land third or fifth. A reranker that reads the question and each passage together is better placed to notice that "sale item" is the deciding phrase.

How a reranker differs from retrieval

Candidate retrieval Reranking
Input The question and the whole index The question and one passage at a time
Job Find possibly relevant passages Order them by how well they answer
Speed Very fast across all content Slower, so used on a shortlist
Strength Coverage of the topic Precision on the exact question
Typical failure Right passage ranked too low Right passage never in the shortlist

The last row is the one to remember. A reranker cannot recover a passage the first step never returned. If the right answer is missing from the shortlist, the fix is in your content, your chunking or your search settings, not in reranking.

When reranking helps and when it does not

Reranking tends to pay off when:

  • Your content has many near-duplicate passages, such as one policy written for several regions or plans.
  • Questions are long and specific, with conditions like dates, plan names or product variants.
  • Answers sit in the middle of long documents, so chunks contain a lot of surrounding text.
  • You can only send a few passages to the model and the order decides what it sees.

It adds little when:

  • Your knowledge base is small and clean, and the right passage is already first.
  • Questions are short and each topic has one obvious page.
  • The real problem is missing or outdated content.

Reranking also adds a step, so it adds a little time to each answer and more work per question. Weigh that against the gain you measure, and read the provider's current documentation for any reranking component you plan to use.

Test it on your own questions

You can measure the effect with a plain spreadsheet before you commit.

  1. Collect 40 real customer questions from past conversations.
  2. For each one, note which source passage should answer it. If none does, mark it as a content gap and set it aside.
  3. Run retrieval alone and record the rank of the correct passage.
  4. Run retrieval with reranking and record the rank again.
  5. Count how often the correct passage is in the top one and in the top three for each setup.
Question Correct passage rank without reranking With reranking
Sale item return after 30 days 4 1
Change delivery address after ordering 2 1
Cancel annual plan mid-term 1 1

The numbers above are an invented example of how to record results, not a measurement. Look at the cases where the rank got worse as well as better, because that is where a reranker misleads. Then look at the answers themselves, since a better rank only matters if the final reply improves.

Reranking and the rest of answer quality

Ordering is one lever among several. Clean content, sensible chunk sizes and good document parsing usually matter more, and document parsing covers how messy files hurt retrieval before any ranking happens. Once the right passage reaches the model, grounding rules and refusal behavior decide whether it uses the passage well, as stopping an AI chatbot from making things up explains.

If you use a platform instead of assembling the pipeline yourself, retrieval choices are made for you and you tune the inputs: sources, structure and procedures. In Askocto you add content under Build > Sources, then open Test > Playground to see which source each answer used. If the wrong passage keeps appearing, split the source, remove the near-duplicate or add a Q&A pair that states the exact answer. The Sources guide lists the source types, and the product overview shows how Askocto fits sources, procedures and testing together.

Frequently asked questions

What is reranking in simple terms?

Reranking is a second look at search results. A fast first step finds candidates, then a more careful step sorts them by how well each one answers the question.

Is reranking the same as retrieval?

No. Retrieval finds possibly relevant passages across all your content. Reranking only reorders the shortlist that retrieval returns, so it cannot add passages that were missed.

Do I need reranking for a support chatbot?

Not always. Start with clean sources and test your top questions. If the right passage is often retrieved but ranked low, reranking is worth trying.

How do I know if reranking improved my answers?

Compare the rank of the correct passage and the quality of the final answer on the same set of real questions, with and without it. Keep the set fixed so the comparison is fair.

Train an agent on your own help center

Askocto answers the repeat questions across chat, email and voice and hands the hard ones to your team.

Keep reading

All articles
AI explainedvector embedding
Sep 1, 20245 min read

Vector embedding explained: how text becomes searchable

An embedding turns a sentence into a list of numbers so search can match meaning, not just words. Learn how it works, what it misses and how to check it on your own content.

Read article