agentsop-reranker-stage

agentsop-reranker-stage is a skill for Claude Code from agentsope/SkillAlchemy. It costs 100 tokens per session (5,438 once invoked), scanned A, original, MIT.

A guide for reranking in a retrieval-augmented generation pipeline, which finds documents for an AI answer and then narrows them to the most relevant ones. It covers the stage between broad document retrieval and the final answer.

In plain words
What is it for?
Use it to review, debug, or improve document ordering after retrieval in an AI search-and-answer system.
Why use it?
It addresses cases where the right document is found but buried below less useful results, or where too many documents consume the model's context space.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Good fit Use it to review, debug, or improve document ordering after retrieval in an AI search-and-answer system.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agentsope/skillalchemy/agentsop-reranker-stage
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add agentsope/SkillAlchemy --skill agentsop-reranker-stage
Clone the repo
git clone --depth 1 https://github.com/agentsope/SkillAlchemy

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agentsop-reranker-stage

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-reranker-stage.svg)](https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-reranker-stage)
Your own site
<a href="https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-reranker-stage"><img src="https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-reranker-stage.svg" alt="Measured on agentmods" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,438 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00100 $0.05438
Opus 5 $0.00050 $0.02719
Sonnet 5 $0.00020 $0.01088
Haiku 4.5 $0.00010 $0.00544

Measured 4d ago against content hash 753b2f85cb34, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

agentsop-reranker-stage scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agentsop-reranker-stage/SKILL.md · 379 lines

How it starts

The opening of the file, as written. The whole thing — 379 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reranker Stage · SOP

Third-person analytical view of how a mature RAG pipeline thinks about the reranker. The skill is for an LLM agent that writes / reviews / debugs retrieval code — it teaches the cross-framework reranking discipline, not one vendor's API. For the per-framework API, descend to [[llamaindex]] (node postprocessors) or [[agentsop-hybrid-retrieval]] (the recall stage that feeds the reranker).

This is the C4 gap skill in the Phase-D enhance pass. The reranker SOP existed only buried inside [[llamaindex]] (OP-03 AddReranker, Stage 3 step 7, anti-pattern A6). It is the highest-ROI single addition to a naive RAG pipeline, so it earns a standalone overlay.


1 · 何时激活 (Activation Rules)

Activate when any holds:

  1. A RAG pipeline's answer quality has plateaued after the cheap knobs (prompt, embedding model, chunk size) are exhausted — [[llamaindex]] Stage 3 lists reranking as the last optimization step, deliberately.
  2. Diagnostics show the relevant document is in top-k but buried — high hit-rate, low MRR, wrong top-1. This is LlamaIndex failure modes #1 / #10 ([[llamaindex]] OP-03).
  3. The LLM context window is under pressure — too many marginal chunks inflate cost, latency, and "lost-in-the-middle" degradation. A reranker lets you retrieve 50 and feed 5.
  4. A user asks where to add a reranker, how to tune N vs k, or API vs local.

Do not activate (boundary — see §6):

  • Recall is the bottleneck: the right doc is not in top-N at all. A reranker can only reorder what retrieval already found — fix retrieval, hybrid ([[agentsop-hybrid-retrieval]]), or chunking first.
  • top-k is already small (≤5) and answers are correct — no plateau.
  • A hard sub-100ms path where the extra round-trip is unaffordable and quality is already acceptable.

2 · 核心心智模型 (Core Mental Model)

The one sentence

Retrieve wide for recall with a cheap bi-encoder; rerank narrow for precision with an expensive cross-encoder that sees query + document together — something the bi-encoder structurally could not do.

Read the full file on GitHub · 379 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · -19 lines · -282 tokens per session 753b2f85cb34
  2. 8d ago First seen · 398 lines · 382 tokens per session scan A 93ddb1c8665a

Subscribe to this mod's changes

agentsop-reranker-stage is a skill published in the GitHub repository agentsope/SkillAlchemy (370 stars, last pushed 6d ago), licensed MIT. It adds 100 tokens to every session and 5,438 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

karpathy-llm-wiki

Use when building or maintaining a personal LLM-powered knowledge base. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki quality, 'add to wiki', 'what do I know about', or any mention of 'LLM wiki' or 'Karpathy wiki'.

Astro-Han/karpathy-llm-wiki · 67 tokens

mixedbread-search

Build and query managed search indexes (Stores) using the Mixedbread Python and TypeScript SDKs. Use when creating knowledge bases, uploading documents, performing semantic or vector search, asking questions over documents, using agentic multi-step retrieval, combining store search with web results, filtering by…

mixedbread-ai/skills · 70 tokens

mxbai-cli

Use the mxbai CLI to manage stores, upload files, search documents, ask questions, and sync directories from the terminal. Use when performing Mixedbread operations via command line, setting up CI/CD pipelines with store sync, or managing API keys.

mixedbread-ai/skills · 55 tokens

rag-evaluator

Generates tailored giskard.checks evaluation suites for RAG (Retrieval-Augmented Generation) systems. Use whenever a user describes a Q&A bot grounded in documents, a knowledge-base chatbot, a retrieval system, or wants to evaluate answer groundedness, faithfulness, hallucination, retrieval quality, citation accuracy…

Giskard-AI/giskard-skills · 204 tokens

local-rag-mcp

Use when querying, ingesting, or maintaining a local RAG MCP corpus for semantic document retrieval with privacy controls.

yeaight7/agent-powerups · 29 tokens

milvus

Operate Milvus vector database with pymilvus Python SDK. Use when the user wants to connect to Milvus, create collections, insert vectors, perform similarity search, hybrid search, full-text search, manage indexes, partitions, databases, or RBAC via Python code.

zilliztech/milvus-skill · 57 tokens