# Re-ranking

A second model re-orders the top 20 results by relevance, then you keep the best few.

AI developers · Part 05: Embeddings + RAG · Card 13 of 14 · Last updated 2026-10-13

## Analogy

A quick first-round screen, then a proper interview for the shortlist.

## In an agent

Better precision for a small extra cost, so the agent reads fewer useless chunks.

## Practice

### Flashcards

- **What is re-ranking?** A second pass that re-orders retrieved results by relevance.

### Interview questions

**Your RAG gives wrong answers. How do you debug it?**

- Check the trace: were the right chunks retrieved?
- If not, fix retrieval: chunking, hybrid search, re-ranking, metadata filters.
- If they were, fix the prompt or the model.
- Then add the failing case to the eval set so it stays fixed.

## Questions people ask

### What is re-ranking in RAG?

Re-ranking is a second pass over search results. You retrieve a wider set, for example the top 20 chunks, and a re-ranking model scores each one against the question more carefully. You keep only the best few. It improves precision for a small extra cost per query.

### Is re-ranking worth the extra cost?

Often, yes, when answers suffer from irrelevant chunks. The first vector search is fast but rough; the re-ranker reads each candidate against the question. Sending fewer, better chunks to the model can save more tokens than the re-ranker costs. Measure it with retrieval evals before and after.

## Related concepts

- [Querying (every question)](https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/rag-query)
- [Top K](https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/top-k)
- [Tracing](https://studyvisually.com/learn/tech/ai-developers/production/tracing)
- [Evals](https://studyvisually.com/learn/tech/ai-developers/production/evals)

Web page: https://studyvisually.com/learn/tech/ai-developers/embeddings-rag/re-ranking
Study this card in the app: https://studyvisually.com/app/learn?category=ai-developers&card=re-ranking
