Skip to content
Skills Library
AI & agents · Building & coding

retrieval-reranking

/retrieval-reranking

Improve RAG answer quality by reranking retrieved candidates so the most relevant chunks reach the model. Use when a retrieval system returns roughly-right documents but the best ones are not on top, or answers miss available evidence.

Repository
AI-SKILLS ↗
Licence
MIT
Last repository change
05.09.2026

Assessment and security

90/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content25 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 05.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Improve RAG answer quality by reranking retrieved candidates so the most relevant chunks reach the model. Use when a retrieval system returns roughly-right documents but the best ones are not on top, or answers miss available evidence.

Original author description

Improve RAG answer quality by reranking retrieved candidates so the most relevant chunks reach the model. Use when a retrieval system returns roughly-right documents but the best ones are not on top, or answers miss available evidence.

How it works

  1. Method
  2. Boundaries
Original SKILL.md headings · 53 lines, 416 words
SKILL.md preview
---
name: retrieval-reranking
description: Improve RAG answer quality by reranking retrieved candidates so the most relevant chunks reach the model. Use when a retrieval system returns roughly-right documents but the best ones are not on top, or answers miss available evidence.
---

# Retrieval reranking

Vector search is fast but coarse: it returns candidates in roughly the
right neighborhood, not perfectly ordered by relevance. Reranking adds a
second, more precise pass over the top candidates so the chunks that
actually answer the query land at the top, where the model uses them.

## Method

1. **Diagnose that reranking is the fix.** Reranking helps when the right
   chunk is retrieved but ranked low (the model never sees it within the
   top-k budget), or when top results are near-duplicates crowding out
   diverse evidence. If the right chunk is not retrieved at all, that is a
   retrieval or chunking problem, not a ranking one (see rag-pipeline,
   embeddings-selection).
2. **Retrieve wide, then rerank narrow.** Pull more candidates than you
   need from the first-stage retriever (e.g. top 30-50), then rerank and
   keep the best few for the context (see context-engineering's top-k
   budget). The first stage optimizes recall; the reranker optimizes
   precision on that shortlist.
3. **Use a cross-encoder or LLM reranker for the precise pass.** Bi-encoder
   vector similarity scores query and document separately; a cross-encoder
   scores them together and judges relevance far better, at higher cost
   per pair (affordable on a shortlist, not the whole corpus). An LLM
   reranker (score each candidate's relevance to the query) is a flexible
   alternative where a dedicated model is unavailable.
4. **Combine signals where they help.** Hybrid retrieval (dense vectors
   plus keyword/BM25) catches what pure semantic search misses (exact
   terms, IDs, rare words); fuse the rankings before or during reranking.
   Add recency or authority as ranking features when the domain rewards
   them.
5. **Deduplicate and diversify the final set.** Drop near-identical chunks
   so the context carries distinct evidence, not five copies of one
   paragraph; where a query has multiple facets, ensure the top set covers
   them rather than piling onto one.
6. **Measure end to end.** Evaluate retrieval quality (did the right chunk
   make the final top-k?) and answer quality with and without reranking on
   a real query set (see llm-eval-design, agent-eval-design); reranking
   adds latency and cost, so confirm it earns them.

## Boundaries

- Reranking cannot surface what first-stage retrieval never returned; fix
  recall (chunking, embeddings, hybrid search) before adding a reranker
  (see rag-pipeline).
- The extra pass adds latency and cost per query; on a shortlist it is
  modest, but budget it (see llm-cost-latency) and skip it where
  first-stage results are already clean.
- Better ranking does not fix a model that ignores provided context;
  pair it with grounding and good context assembly (see
  context-engineering).

Versions

The database has no other skills named retrieval-reranking.

Database snapshot: 13.11.2026 · package version 72958f5edb9e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 98rag-expert
    Expert Retrieval-Augmented Generation: chunking, embeddings, vector/hybrid search, reranking, and grounded answers. Trigger keywords: RAG, retrieval, embeddings, vector database, chunking, reranking, hybrid search, BM25, grounding, citations, hallucination, context window,…
  • 100retrieval-rag
    Build and fix retrieval that actually returns the right passage — structure-aware chunking, one pinned embedding model, lexical plus vector search fused, reranking, and a recall measurement that is run separately from the generator. Use when a RAG system answers wrong or…
  • 100rag-systems
    Designs, builds and debugs retrieval-augmented generation (RAG) - ingestion and parsing, chunking, embeddings, hybrid search with reranking, access control at retrieval time, grounded answers with citations, and retrieval and answer evaluation. Use when building search or Q&A…
  • 100rag
    Use when building retrieval-augmented generation. Covers chunking, embedding and hybrid search, reranking, grounding and citation, and diagnosing whether a bad answer is a retrieval failure or a generation failure. Trigger on "our rag keeps hallucinating", "chat with our docs",…
  • 100retriever-optimizer
    Optimize RAG retrieval quality: tune top-k, reranking, query preprocessing, and filtering to maximize recall and precision. Use when working on RAG pipelines, chunking, embeddings, retrieval, or hybrid search.
  • 90agentic-rag
    Use when building self-correcting retrieval systems for AI agents. Keywords: RAG, retrieval, Corrective RAG, Self-RAG, query decomposition, reranking, hallucination, grounding.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.