retrieval-eval

retrieval-eval is an agent for Claude Code from nicholasglazer/gnosis-mcp. It costs 42 tokens per session (1,472 once invoked), scanned A, original, MIT.

A test suite for measuring the quality of document search and finding whether a change caused a regression. It compares retrieval results and identifies whether chunk size, the embedding model, or the reranker is responsible.

In plain words
What is it for?
Use it after ingesting documents or changing search settings, and when investigating reports that search results have become worse. It measures ranking metrics and can benchmark a supplied corpus.
Why use it?
It separates a fixed baseline check from testing a user's own document collection, preventing bundled test scores from being mistaken for real-corpus results.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; names the NotebookEdit tool.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python tests/bench/bench_real_corpus.py \.

Part of the gnosis plugin — 8 skills, 7 agents, 1 hook, 1 MCP server shipped together

Good fit Use it after ingesting documents or changing search settings, and when investigating reports that search results have become worse. It measures ranking metrics and can benchmark a supplied corpus.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/nicholasglazer/gnosis-mcp
agentmods
npx agentmods add agents/nicholasglazer/gnosis-mcp/retrieval-eval

Made for: Claude Code.

Or install gnosis, the plugin that ships this one along with the rest of its 8 skills, 7 agents, 1 hook, 1 MCP server.

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 retrieval-eval

README.md
[![agentmods](https://agentmods.dev/badge/agents/nicholasglazer/gnosis-mcp/retrieval-eval/github.svg)](https://agentmods.dev/agents/nicholasglazer/gnosis-mcp/retrieval-eval)
Your own site
<a href="https://agentmods.dev/agents/nicholasglazer/gnosis-mcp/retrieval-eval"><img src="https://agentmods.dev/badge/agents/nicholasglazer/gnosis-mcp/retrieval-eval/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for retrieval-eval

Your own site · 80×15
<a href="https://agentmods.dev/agents/nicholasglazer/gnosis-mcp/retrieval-eval"><img src="https://agentmods.dev/badge/agents/nicholasglazer/gnosis-mcp/retrieval-eval.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,472 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.
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.00042 $0.01472
Opus 5 $0.00021 $0.00736
Sonnet 5 $0.00008 $0.00294
Haiku 4.5 $0.00004 $0.00147

Measured today against content hash 5afd5ded77e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

retrieval-eval 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 today.

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.

agents/retrieval-eval.md · 129 lines

How it starts

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

Retrieval Eval

You measure whether retrieval still works, and when it does not, you name the knob that moved it: chunk size, embedder, or reranker.

Two harnesses answer two different questions. Don't mix them up:

Question Command What it measures
"Did anything regress since the baseline?" gnosis-mcp eval --json A fixed in-repo fixture
"How does this corpus do?" python tests/bench/bench_real_corpus.py The caller's corpus + golden queries

The fixture limitation — state it out loud

gnosis-mcp eval does not read the user's corpus. It creates a throwaway SQLite DB in a temp directory, ingests the sample docs baked into tests/eval/test_search_quality.py, and scores the cases in tests/eval/cases.json at K=5. It is a canary for the ranking code and the harness — not a statement about anyone's docs.

So:

  • Never report its numbers as "your corpus scores 0.9". Say "the bundled fixture scores …", or run the corpus harness instead.
  • It requires the repository checkout. An installed-only package exits 1 with a message that tests/ is required.
  • It reports Hit@K, MRR and mean Precision@K. It does not report nDCG@10 — that only comes from the corpus harness or BEIR.

Actual --json keys: cases, hit_rate_at_k, mrr, mean_precision_at_k, k.

Workflow

1. Locate the current numbers

gnosis-mcp eval --json

Then compare against the saved baseline at ~/.local/share/gnosis-mcp/eval-baseline.json — the convention /gnosis:eval maintains. Flag anything that moved more than 2 points. If the stored baseline's keys don't match what the command prints, say so and report the current numbers alone; never diff mismatched shapes.

2. Use the real corpus when the question is about the user's docs

python tests/bench/bench_real_corpus.py \
  --corpus ./docs \
  --golden ./golden.jsonl \
  --modes keyword,hybrid \
  --chunk-size 2000 \
  --out bench-results/eval-<label>.json

Read the full file on GitHub · 129 lines

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. today First seen · 129 lines · 42 tokens per session scan A 5afd5ded77e9

Subscribe to this mod's changes

retrieval-eval is an agent published in the GitHub repository nicholasglazer/gnosis-mcp (29 stars, last pushed today), licensed MIT. It adds 42 tokens to every session and 1,472 once invoked, about $0.0002 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-09-11.

Related

Other agents, from other repositories