跳到正文
cccskills
免费在 GitHub 公开

rag-evaluation-harness

Evaluate retrieval and citation behavior for RAG pipelines from deterministic JSONL fixtures. Use when an agent needs offline Recall@K, reciprocal rank, context precision, citation coverage, citation validity, diagnostics, Markdown/JSON reports, or threshold-gated evaluation in CI.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(4)

  • SKILL.md3.2 KB
  • examples/sample-evaluation.jsonl431 B
  • scripts/evaluate-rag.mjs8.8 KB
  • scripts/evaluate-rag.test.mjs5.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

RAG Evaluation Harness

Use this skill to measure a retrieval-and-citation contract without making model calls or network requests. The bundled evaluator compares explicit document IDs, so it is suitable for repeatable local checks and CI gates.

Input Contract

Provide one JSON object per line with a unique string id and three arrays of document IDs:

{"id":"question-1","relevant_document_ids":["doc-a"],"retrieved_document_ids":["doc-b","doc-a"],"cited_document_ids":["doc-a"]}

Blank lines are ignored. Invalid JSON, missing arrays, non-string IDs, and duplicate case IDs fail with the JSONL line number. Keep the fixture's relevance labels and citation IDs explicit; do not infer them from answer text.

Run an Evaluation

Set the installed skill directory and run the standard-library-only evaluator:

SKILL_DIR="<absolute path to the installed rag-evaluation-harness skill>"
node "$SKILL_DIR/scripts/evaluate-rag.mjs" "$SKILL_DIR/examples/sample-evaluation.jsonl" \\
  --k 3 --format markdown

Use --format json for CI or downstream tooling. Add any of these optional thresholds (each must be between 0 and 1):

--min-recall
--min-mrr
--min-context-precision
--min-citation-coverage
--min-citation-validity

The process exits 0 when all requested thresholds pass, 1 when a threshold fails, and 2 for invalid arguments or input. Threshold failures are written to stderr while the complete report remains on stdout.

Interpret the Report

  • Recall@K: relevant IDs found in the first K unique retrieved IDs divided by all relevant IDs.
  • Reciprocal rank: inverse rank of the first relevant retrieved ID, or zero when none is found.
  • Context precision@K: relevant IDs in the first K unique retrieved IDs divided by the number of retrieved IDs considered.
  • Citation coverage: relevant IDs cited divided by all relevant IDs.
  • Citation validity: cited IDs that were retrieved divided by all cited IDs.

The summary is a macro average. Recall and citation coverage are null for cases with no relevant IDs and are excluded from their macro denominators. Other empty denominators are reported as zero. Diagnostics call out empty retrieval, absent relevance labels, duplicate retrieved IDs, citations that were not retrieved, and missing citations.

These are ID-level proxy metrics. They do not establish semantic answer quality, entailment, attribution correctness, or groundedness. Pair them with a separate answer-quality evaluation when those properties matter.

Verification

Run the focused tests and the repository skill validator:

node --test "$SKILL_DIR/scripts/evaluate-rag.test.mjs"
node scripts/validate-skills.js

The evaluator is deterministic and offline. It reads only the supplied JSONL file and never executes retrieved content, calls an MCP server, accesses credentials, or mutates the input.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Handle ActiveCampaign contact and marketing tasks through Rube MCP, a connection for agent tools. Find or create contacts, manage tags and subscriptions, enroll contacts in existing automated workflows, and create follow-up tasks.

中文简介正在准备中。当前显示英语简介。

  • Finding or registering contacts
  • Adding or removing contact tags
  • Subscribing contacts to lists or unsubscribing them
davepoon/buildwithclaude36662026年10月20日 更新

Research competitors’ live Meta and Google ads to identify opening hooks, offers, calls to action, and landing pages. Receive a sourced creative brief and up to three test ideas adapted to your product.

中文简介正在准备中。当前显示英语简介。

  • Find angles for new ad copy
  • Plan creative tests using competitor ads
  • Choose a landing page message
davepoon/buildwithclaude36662026年10月20日 更新

Analytics your AI agent can actually use. Track, analyze, run A/B experiments, and optimize across all your projects via CLI. Includes a growth playbook so your agent knows HOW to grow, not just what to track.

中文简介正在准备中。当前显示原文说明。

davepoon/buildwithclaude36662026年10月20日 更新

Teaches when to recall from long-term memory before acting and when to save durable decisions, corrections and failures afterwards. Use when a memory tool or MCP memory server is connected but the agent is not using it consistently, when the user complains that the assistant forgets preferences, conventions or past decisions between sessions, or when setting up persistent memory for a project. Works with any memory backend: a folder of Markdown files, a local MCP server, or a managed service.

中文简介正在准备中。当前显示原文说明。

davepoon/buildwithclaude36662026年10月20日 更新

Audit local AI coding-agent sessions with agenttrace for cost, tokens, tool failures, latency, anomalies, health, diffs, and CI gates.

中文简介正在准备中。当前显示原文说明。

davepoon/buildwithclaude36662026年10月20日 更新

Checks which private files (.env, keys, secrets) Claude Code and its subagents reached in this project, whether a value came into an agent's context, and which key to change, by running the open source agentwhy CLI over the session records Claude Code already keeps on disk. Use when the user asks whether the agent or a subagent read their .env or other secrets, which private files a session touched, whether a key leaked into the conversation, or which key to rotate. Runs locally and never prints a secret value.

中文简介正在准备中。当前显示原文说明。

davepoon/buildwithclaude36662026年10月20日 更新

查看 davepoon 的全部技能

报告此技能的问题