# Rag reranker

> Rag reranker is an open-source agent skill for knowledge and memory. Reranks retrieved RAG passages by whether they answer a question and checks citations. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/mrmps/classifier-dev/tree/main/skills/rag-reranker
- **Repository:** https://github.com/mrmps/classifier-dev
- **GitHub stars:** 440
- **License:** MIT
- **Skill name:** rag-reranker
- **Collection:** https://github.com/mrmps/classifier-dev
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-12-04

## About

This skill helps an agent filter a batch of retrieved passages before they go into a prompt. Each passage is judged against a question as answering it, relating to it without answering, or being unrelated, and the agent keeps only the ones that answer. It also covers a second pass that checks each claim in a generated answer against the passage it cites, flagging claims that are unsupported or contradicted by their source.

The workflow sends all candidates in one batched call to an external classification API at classifier.dev, using the returned scores and calibrated confidences to rank and cut passages. The skill includes a Python example using the standard library, and it advises rank-by-score and gate-by-confidence with thresholds for when to trust a result, when to have a model review it, and when to treat it as unreliable.

It expects a vector search or retrieval step that has already produced candidate passages and a question, plus network access to the classifier.dev service and Python for the sample code. The skill does not generate text itself and does not perform first-stage retrieval.

## When your agent uses it

> Rerank retrieved passages by whether each one answers the question, drop the near-misses before they reach the prompt, and check every citation in the answer against the passage it points at. Use after a vector search returns twenty plausible chunks, or when an answer needs its citations verified. Triggers on "rerank these", "which chunks answer this", "check these citations", "my RAG cites the wrong chunk".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/mrmps/classifier-dev/tree/HEAD/skills/rag-reranker)
- [License: MIT](https://github.com/mrmps/classifier-dev/tree/HEAD/skills/rag-reranker)

## Features

- **Passage relevance ranking:** Scores each retrieved passage on whether it answers the question, so candidates can be sorted by that score.
- **Near-miss filtering:** Drops passages labelled as related but not answering, or unrelated, before they reach the prompt.
- **Citation verification:** Checks each generated claim against the passage it cites, labelling it as stated, merely about the topic, or contradicted.
- **Confidence-based gating:** Uses calibrated confidence thresholds to decide which results to trust, review or discard.
- **Batched API calls:** Classifies up to 1,000 passages in a single request to the classifier.dev endpoint.

## Good for

- Rerank twenty chunks from a vector search and keep only those that answer my question
- Check whether each citation in my RAG answer actually supports the claim it is attached to
- Trim retrieved context down to the passages that contain the answer before prompting a model
- Find which of my RAG chunks is citing the wrong source

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/rag-reranker` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.claude/skills/rag-reranker &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/rag-reranker` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/rag-reranker` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.agents/skills/rag-reranker &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/rag-reranker` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/rag-reranker` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.cursor/skills/rag-reranker &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/rag-reranker` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/mrmps/classifier-dev.git --path skills/rag-reranker
```

Or copy the folder to `~/.gemini/skills/rag-reranker` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/rag-reranker`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/mrmps/classifier-dev.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/rag-reranker &&
cp -R "$tmp/skills/rag-reranker" ~/.copilot/skills/rag-reranker &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/rag-reranker` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/mrmps/classifier-dev.git
```

Then copy `classifier-dev/skills/rag-reranker` into your agent's skills folder as `rag-reranker`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It calls the classifier.dev classify endpoint over the network and includes a Python example using the standard library. A User-Agent header must be set, since the default Python one is refused with a 403.

### Does Rag reranker write or change the answer?

No. It only picks among the labels you supply. Writing the answer, summaries or citation rewrites remain the agent's job.

### When should Rag reranker not be used?

Not for first-stage retrieval, not when only a few passages are already in context, and not when every candidate is relevant, since a uniformly good set will all be labelled as answering.

### How should the results be interpreted?

Rank passages by the score for the answering label and gate on confidence: 0.9 and above can be acted on, 0.5 to 0.9 should be checked by a model, and below 0.5 should not be the sole source of a claim.

### How do I install Rag reranker in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/rag-reranker to use it in all your projects, or to .claude/skills/rag-reranker in one project.

### Does Rag reranker run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Rag reranker?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Rag reranker?

The closest alternatives to Rag reranker are Rag and model tuning, Rag eval, Kb query, Haiku rag and Rag perf.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Rag and model tuning](https://ai-powered.com/skills/rag-and-model-tuning-ajyadav013): Rag and model tuning is an open-source agent skill for knowledge and memory.
- [Rag eval](https://ai-powered.com/skills/rag-eval): Rag eval is an open-source agent skill for knowledge and memory.
- [Kb query](https://ai-powered.com/skills/kb-query): Kb query is an open-source agent skill for knowledge and memory.
- [Haiku rag](https://ai-powered.com/skills/haiku-rag-ggozad): Haiku rag is an open-source agent skill for knowledge and memory.
- [Rag perf](https://ai-powered.com/skills/rag-perf): Rag perf is an open-source agent skill for knowledge and memory.
- [Knowledge base integration](https://ai-powered.com/skills/knowledge-base-integration): Knowledge base integration is an open-source agent skill for knowledge and memory.
- [Agent platform rag engine management](https://ai-powered.com/skills/agent-platform-rag-engine-management): Agent platform rag engine management is an open-source agent skill for knowledge and memory.
- [Qdrant search quality](https://ai-powered.com/skills/qdrant-search-quality-qdrant): Qdrant search quality is an open-source agent skill for knowledge and memory.

---
Source: https://ai-powered.com/skills/rag-reranker
