rag-evaluate-quality

rag-evaluate-quality is a skill for Claude Code, Codex from lyonzin/knowledge-rag. It costs 52 tokens per session (1,153 once invoked), scanned A, original, MIT.

A measurement workflow for testing how well a knowledge base finds relevant information. It reports retrieval metrics such as MRR, Recall, and Precision, which show ranking quality and how many relevant results were found.

In plain words
What is it for?
Use it weekly, after major index changes or upgrades, or when answers seem less accurate, to inspect index health and compare retrieval quality over time.
Why use it?
It replaces impressions about search quality with repeatable measurements and can reveal whether reindexing or upgrades made results worse.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it weekly, after major index changes or upgrades, or when answers seem less accurate, to inspect index health and compare retrieval quality over time.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lyonzin/knowledge-rag/rag-evaluate-quality
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 lyonzin/knowledge-rag --skill rag-evaluate-quality
Clone the repo
git clone --depth 1 https://github.com/lyonzin/knowledge-rag

Made for: Claude Code, Codex.

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 rag-evaluate-quality

README.md
[![agentmods](https://agentmods.dev/badge/skills/lyonzin/knowledge-rag/rag-evaluate-quality/github.svg)](https://agentmods.dev/skills/lyonzin/knowledge-rag/rag-evaluate-quality)
Your own site
<a href="https://agentmods.dev/skills/lyonzin/knowledge-rag/rag-evaluate-quality"><img src="https://agentmods.dev/badge/skills/lyonzin/knowledge-rag/rag-evaluate-quality/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 rag-evaluate-quality

Your own site · 80×15
<a href="https://agentmods.dev/skills/lyonzin/knowledge-rag/rag-evaluate-quality"><img src="https://agentmods.dev/badge/skills/lyonzin/knowledge-rag/rag-evaluate-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,153 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.00052 $0.01153
Opus 5.5 $0.00021 $0.00461
Sonnet 5.5 $0.00010 $0.00231
Haiku 4.5 $0.00005 $0.00115

Measured 12d ago against content hash 0d6fd431c93f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rag-evaluate-quality 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 12d 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/maintenance/rag-evaluate-quality/SKILL.md · 93 lines

How it starts

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

rag-evaluate-quality — measure, do not guess

Use this workflow when the user asks to evaluate retrieval, after a relevant change, or as part of an already authorized recurring evaluation. Do not infer that every session needs a benchmark or that invoking this skill creates a recurring schedule.

Workflow

  1. Call get_index_stats(). The response contains a stats object. Record stats.total_documents, stats.total_chunks, stats.embedding_model, stats.embedding_dim, and stats.query_cache.hit_rate. The cache rate describes repeated-query reuse, not relevance.

  2. Reuse an independently selected evaluation set, or prepare questions with known answer documents. Each case has one non-empty question and one non-empty expected path:

    [
      {"query": "authentication design", "expected_filepath": "docs/adr/0018-auth.md"},
      {"query": "retry policy", "expected_filepath": "docs/adr/0031-retries.md"}
    ]
    

    These are illustrative paths. Verify that expected documents exist in the actual corpus. Do not derive the expected answer from whichever source the current search happens to rank first.

  3. Serialize the array as a JSON string and pass the test_cases parameter:

    import json
    
    cases = [
        {"query": "authentication design", "expected_filepath": "docs/adr/0018-auth.md"},
        {"query": "retry policy", "expected_filepath": "docs/adr/0031-retries.md"},
    ]
    evaluate_retrieval(test_cases=json.dumps(cases))
    

    The MCP tool returns mrr_at_5, recall_at_5, total_queries, and per_query. It does not return Precision@5. Invalid cases are rejected before searches execute.

  4. Inspect individual misses and rank changes before interpreting aggregates:

    Metric Meaning
    MRR@5 Mean reciprocal rank of the expected document; a miss contributes zero
    Recall@5 Fraction of cases whose expected document occurs in the first five results
    found_at_rank Rank for each case, or null if the expected document was not found

Read the full file on GitHub · 93 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. 12d ago Changed · -120 lines · -26 tokens per session 0d6fd431c93f
  2. 1mo ago First seen · 213 lines · 78 tokens per session scan A f538e3762fdc

Subscribe to this mod's changes

rag-evaluate-quality is a skill published in the GitHub repository lyonzin/knowledge-rag (296 stars, last pushed today), licensed MIT. It adds 52 tokens to every session and 1,153 once invoked, about $0.0002 per session on Opus 5.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