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.
npx skills add latestaiagents/agent-skills --skill rag-evaluationgit clone --depth 1 https://github.com/latestaiagents/agent-skillsWrote 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.
[](https://agentmods.dev/skills/latestaiagents/agent-skills/rag-evaluation)<a href="https://agentmods.dev/skills/latestaiagents/agent-skills/rag-evaluation"><img src="https://agentmods.dev/badge/skills/latestaiagents/agent-skills/rag-evaluation.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00063 | $0.02931 |
| Opus 5 | $0.00032 | $0.01465 |
| Sonnet 5 | $0.00013 | $0.00586 |
| Haiku 4.5 | $0.00006 | $0.00293 |
Grade A, and why
rag-evaluation 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 5d 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.
How it starts
The opening of the file, as written. The whole thing — 365 lines — stays where its author put it; the contents beside it link to each section on GitHub.
RAG Evaluation
Measure, monitor, and improve RAG system performance with comprehensive metrics.
When to Use
- Setting up RAG evaluation pipelines
- Comparing retrieval strategies
- Measuring generation quality
- Building regression tests for RAG
- Debugging poor RAG performance
Evaluation Framework
┌─────────────────────────────────────────────────────────┐
│ RAG Evaluation │
├─────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
│ │ Retrieval │ │ Generation │ │ End-to-End │ │
│ │ Metrics │ │ Metrics │ │ Metrics │ │
│ ├─────────────┤ ├─────────────┤ ├─────────────┤ │
│ │ • MRR │ │ • Faithful- │ │ • Answer │ │
│ │ • Recall@k │ │ ness │ │ Correct- │ │
│ │ • Precision │ │ • Relevance │ │ ness │ │
│ │ • NDCG │ │ • Coherence │ │ • Latency │ │
│ │ • Hit Rate │ │ • Toxicity │ │ • Cost │ │
│ └─────────────┘ └─────────────┘ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────┘
Retrieval Metrics
Implementation
import numpy as np
from typing import List, Dict
def mean_reciprocal_rank(results: List[List[str]], relevant: List[List[str]]) -> float:
"""
Calculate MRR across queries.
results: List of ranked document IDs per query
relevant: List of relevant document IDs per query
"""
mrr_sum = 0.0
for res, rel in zip(results, relevant):
rel_set = set(rel)
for rank, doc_id in enumerate(res, 1):
if doc_id in rel_set:
mrr_sum += 1.0 / rank
break
return mrr_sum / len(results)
def recall_at_k(results: List[List[str]], relevant: List[List[str]], k: int) -> float:
"""Calculate Recall@k."""
recall_sum = 0.0
for res, rel in zip(results, relevant):
retrieved_k = set(res[:k])
relevant_set = set(rel)
if relevant_set:
recall_sum += len(retrieved_k & relevant_set) / len(relevant_set)
return recall_sum / len(results)
def precision_at_k(results: List[List[str]], relevant: List[List[str]], k: int) -> float:
"""Calculate Precision@k."""
precision_sum = 0.0
for res, rel in zip(results, relevant):
retrieved_k = set(res[:k])
relevant_set = set(rel)
precision_sum += len(retrieved_k & relevant_set) / k
return precision_sum / len(results)
def ndcg_at_k(results: List[List[str]], relevant: List[List[str]], k: int) -> float:
"""Calculate NDCG@k."""
def dcg(scores):
return sum(s / np.log2(i + 2) for i, s in enumerate(scores))
ndcg_sum = 0.0
for res, rel in zip(results, relevant):
rel_set = set(rel)
gains = [1 if doc in rel_set else 0 for doc in res[:k]]
ideal_gains = sorted(gains, reverse=True)
dcg_val = dcg(gains)
idcg_val = dcg(ideal_gains)
ndcg_sum += dcg_val / idcg_val if idcg_val > 0 else 0
return ndcg_sum / len(results)
def hit_rate(results: List[List[str]], relevant: List[List[str]], k: int) -> float:
"""Calculate Hit Rate (any relevant doc in top-k)."""
hits = 0
for res, rel in zip(results, relevant):
if set(res[:k]) & set(rel):
hits += 1
return hits / len(results)
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.
- 5d ago First seen · 365 lines · 63 tokens per session scan A 936959784773
rag-evaluation is a skill published in the GitHub repository latestaiagents/agent-skills (5 stars, last pushed 4mo ago), licensed MIT. It adds 63 tokens to every session and 2,931 once invoked, about $0.0003 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.
Other skills, from other repositories
mem0-integration
Mem0 memory layer integration for AI agents. Implement persistent, semantic memory for long-term context retention and personalization.
vector-memory
HNSW vector search for pattern similarity retrieval and knowledge graph maintenance with PageRank scoring, community detection, and 3-tier memory management.
chroma-integration
Chroma local vector database setup and operations for development and production.
haystack-pipeline
Haystack NLP pipeline configuration for document processing and QA.
langchain-retriever
LangChain retriever implementation with various retrieval strategies for RAG applications.
llamaindex-agent
LlamaIndex agent and query engine setup for RAG-powered agents.