eval-rag

eval-rag is a command for Claude Code from latestaiagents/agent-skills. It costs 8 tokens per session (471 once invoked), scanned A, original, MIT.

A guide to evaluating a RAG pipeline using test questions, expected answers, retrieval measures, answer-quality checks, and system performance data.

In plain words
What is it for?
Use it to create evaluation datasets and measure retrieval recall, ranking, faithfulness, relevance, correctness, latency, cost, and throughput.
Why use it?
It shows whether the system finds the right documents, gives grounded answers, responds quickly, and uses resources efficiently.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the rag-architect plugin — 7 skills, 3 commands shipped together

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.

agentmods
npx agentmods add commands/latestaiagents/agent-skills/eval-rag
Clone the repo
git clone --depth 1 https://github.com/latestaiagents/agent-skills

Made for: Claude Code.

Or install rag-architect, the plugin that ships this one along with the rest of its 7 skills, 3 commands.

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/latestaiagents/agent-skills/eval-rag.svg)](https://agentmods.dev/commands/latestaiagents/agent-skills/eval-rag)
Your own site
<a href="https://agentmods.dev/commands/latestaiagents/agent-skills/eval-rag"><img src="https://agentmods.dev/badge/commands/latestaiagents/agent-skills/eval-rag.svg" alt="Measured on agentmods" height="20"></a>
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 471 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00008 $0.00471
Opus 5 $0.00004 $0.00235
Sonnet 5 $0.00002 $0.00094
Haiku 4.5 $0.00001 $0.00047

Measured 2d ago against content hash 82d45fa4c3fe, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

eval-rag 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 2d 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.

plugins/rag-architect/commands/eval-rag.md · 82 lines

What it actually says

/eval-rag

Run comprehensive evaluation on your RAG pipeline.

What I Need

Tell me:

  • Do you have a test dataset? (queries + expected answers)
  • What metrics matter most? (accuracy, latency, cost)
  • Current retrieval/generation setup?

Evaluation Steps

Step 1: Test Dataset

I'll help you create or validate your test dataset:

  • Query variety (simple, complex, edge cases)
  • Ground truth answers
  • Relevant document mappings

Step 2: Retrieval Metrics

Measure retrieval quality:

  • Recall@k - Are relevant docs in top-k?
  • MRR - How high do relevant docs rank?
  • NDCG - Quality of ranking order

Step 3: Generation Metrics

Assess answer quality:

  • Faithfulness - Is answer grounded in context?
  • Relevance - Does answer address the question?
  • Correctness - Is answer factually correct?

Step 4: System Metrics

Track operational performance:

  • Latency - p50, p95, p99 response times
  • Cost - Per-query LLM/embedding costs
  • Throughput - Queries per second

Quick Evaluation

from ragas import evaluate
from ragas.metrics import faithfulness, answer_relevancy

# Prepare data
eval_data = {
    "question": [...],
    "answer": [...],
    "contexts": [...],
    "ground_truth": [...]
}

# Run evaluation
results = evaluate(Dataset.from_dict(eval_data),
                   metrics=[faithfulness, answer_relevancy])
print(results)

Benchmark Targets

Metric Good Great
Recall@5 >0.7 >0.85
MRR >0.6 >0.75
Faithfulness >3.5/5 >4.0/5
Relevance >3.5/5 >4.0/5
Latency p95 <2s <500ms

Output

I'll provide:

  • Metric scores with comparisons
  • Failure case analysis
  • Specific improvement recommendations
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. 2d ago First seen · 82 lines · 8 tokens per session scan A 82d45fa4c3fe

Subscribe to this mod's changes

eval-rag is a command published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 8 tokens to every session and 471 once invoked, about $0.0000 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-03.