一键导入
retrieval-evaluation-metrics
Measure retrieval quality with recall, precision, MRR, nDCG, and context precision and recall.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Measure retrieval quality with recall, precision, MRR, nDCG, and context precision and recall.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use this skill when building, debugging, or improving Retrieval-Augmented Generation systems, including chunking, vector database selection, hybrid search, reranking, multimodal RAG, code documentation RAG, retrieval latency, and production RAG architecture.
Chunk nested documents into parent-child levels so retrieval can move from broad sections to fine-grained passages.
Use semantic boundaries and embedding similarity to chunk text for higher-relevance retrieval.
Route RAG chunking decisions across semantic, hierarchical, sliding-window, contextual-header, and framework-selection strategies.
Use overlapping windows to preserve context across chunk boundaries while controlling retrieval size.
Reduce retrieval latency with caching, batching, and index-level optimization.
| name | retrieval-evaluation-metrics |
| title | Retrieval Evaluation Metrics |
| description | Measure retrieval quality with recall, precision, MRR, nDCG, and context precision and recall. |
| allowed-tools | ["Read","Grep","Glob","Bash"] |
| category | evaluation-metrics |
| tags | ["retrieval","recall","ndcg","mrr","context-precision"] |
Retrieval evaluation measures whether the pipeline fetched the right chunks before the LLM ever sees them. Because generation quality is capped by retrieval quality, these metrics isolate the most common and most fixable source of bad RAG answers.
Teams judge RAG only by final answer quality, which hides where the failure is. When the right chunk is never retrieved, no prompt or model change can recover, yet the pipeline is often blamed on generation instead of retrieval.
Collect representative questions and mark which document chunks are relevant to each. This golden set is the ground truth every metric compares against.
Why: Rank-based metrics are meaningless without known-relevant targets to score against.
Start with recall@k across candidate k values to confirm relevant chunks are retrieved at all, then check precision and rank quality with MRR and nDCG.
Why: A relevant chunk that is never retrieved cannot be re-ranked into place, so recall is the ceiling for everything downstream.
Use LLM-judged context precision and context recall when human relevance labels are scarce, to score whether retrieved context supports the reference answer.
Why: Manual relevance labels are expensive; reference-free metrics scale evaluation to larger query sets.
For definitions and implementations, see RAGAS context metrics, the RAGAS paper, and scikit-learn ranking metrics.