Search Benchmark 标志

Search Benchmark

组织
agentic-community
search-benchmark

为 AI Registry 生成搜索质量基准测试。根据注册表中的资源生成基准答案,针对语义搜索 API 运行 100+ 条查询,使用 NDCG@10/MRR/Recall 评估结果,并生成 Markdown 报告。适用于您想在评分算法、嵌入模型或索引内容变更后衡量搜索质量的情况。

Add to TypingMind

概览

发布者agentic-community
代码仓库mcp-gateway-registry
技能名称search-benchmark
星标数
969
复刻数
244
附带文件
仅含指令
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 agentic-community 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Search Benchmark AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/agentic-community/mcp-gateway-registry/tree/main/.claude/skills/search-benchmark
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/agentic-community/mcp-gateway-registry.git /tmp/mcp-gateway-registry
mkdir -p .claude/skills
cp -r /tmp/mcp-gateway-registry/.claude/skills/search-benchmark .claude/skills/search-benchmark
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Search Benchmark,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Search Benchmark。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Search Benchmark 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Search Benchmark Skill

Measure semantic search quality against a deployed AI Registry. Generates a ground truth dataset from the registry's own assets, runs queries against the live API, evaluates results using standard information retrieval metrics (NDCG@10, MRR, Recall@10), and produces a markdown report.

Prerequisites

  1. Registry URL - The base URL of the deployed registry (e.g., https://d2xl2zfuhgc4l0.cloudfront.net)
  2. JWT Token - A valid admin token in .token file (get from "Get JWT Token" button in registry UI)
  3. Registry must have assets indexed - At least some servers, agents, or skills registered

The .token file supports both raw JWT format and the full JSON response from the registry UI.

Input

/search-benchmark [REGISTRY_URL] [TOKEN_FILE]
  • REGISTRY_URL - Base URL of the registry to benchmark (default: reads from user or uses http://localhost)
  • TOKEN_FILE - Path to the token file (default: .token)

Workflow

Step 1: Check for Existing Ground Truth

Check if a ground truth dataset already exists:

bash
ls tests/fixtures/search_dataset/ground_truth.json 2>/dev/null

If the file exists, report how many queries it contains and ask the user: "A ground truth dataset already exists (N queries). Do you want to use it or generate a new one from this registry?"

  • If use existing: skip to Step 2
  • If generate new: proceed to Step 1b

Step 1b: Generate Expert Ground Truth

This is NOT a simple programmatic generation. You must deeply analyze the registry's assets and craft queries like a search expert. Follow this process:

1b.1: Fetch all assets as JSON

bash
TOKEN=$(python3 -c "
import json
with open('{TOKEN_FILE}') as f:
    raw = f.read().strip()
if raw.startswith('{'):
    data = json.loads(raw)
    print(data.get('tokens',{}).get('access_token') or data.get('access_token',''))
else:
    print(raw.replace('Bearer ',''))
")

curl -s -H "Authorization: Bearer $TOKEN" "{REGISTRY_URL}/api/servers?limit=2000" > /tmp/servers.json
curl -s -H "Authorization: Bearer $TOKEN" "{REGISTRY_URL}/api/agents?limit=2000" > /tmp/agents.json
curl -s -H "Authorization: Bearer $TOKEN" "{REGISTRY_URL}/api/skills?limit=2000" > /tmp/skills.json

1b.2: Analyze the assets deeply

Read the JSON dumps. Filter out stress-test and security-pending assets. For each real asset, understand:

  • What it does (from description)
  • What tools it has (tool names and descriptions)
  • What tags it uses
  • How users would naturally search for it

1b.3: Craft 100 queries across these categories

CategoryCountStrategy
exact-name10Product/server/agent names as queries
semantic15Natural language paraphrases with NO keyword overlap
tool-precision10Exact tool names as queries
tag-based10Tag vocabulary combinations
multi-entity10Queries where correct answers span servers + agents + skills
conflict10Ambiguous terms where vector and keyword disagree
no-answer10Queries completely outside the dataset (no match exists)
agent-focused10Queries specifically targeting agents
skill-focused10Queries specifically targeting skills
tricky15Edge cases, short queries, non-English, adversarial

1b.4: For each query, define expected results

json
{
  "query": "the search query",
  "category": "one of the categories above",
  "description": "what this query tests and why",
  "expected": [
    {"path": "/exact-path-from-registry", "grade": 3, "reason": "why this should match"},
    {"path": "/another-path", "grade": 2, "reason": "why this is relevant but not perfect"}
  ]
}

Grade scale: 3 = perfect match, 2 = highly relevant, 1 = somewhat relevant. For no-answer queries, expected should be an empty list.

1b.5: Validate all paths exist

Every path in expected results must exist in the fetched assets. Verify before saving.

1b.6: Save

Write the ground truth to tests/fixtures/search_dataset/ground_truth.json.

Tell the user how many queries were created per category and that they should review it.

Step 2: Run Benchmark

Run all queries against the live semantic search API and generate a report:

bash
uv run python scripts/benchmark_search.py \
    --url {REGISTRY_URL} \
    --token-file {TOKEN_FILE} \
    --queries tests/fixtures/search_dataset/generated_ground_truth.json

Output:

  • tests/fixtures/search_dataset/benchmark_results.json (raw results)
  • tests/fixtures/search_dataset/benchmark_results.md (markdown report)

Step 3: Review Report

Show the user the key metrics from the report:

  1. Quality Metrics - NDCG@10 > 0.7 is good, > 0.8 is excellent
  2. Score Health - Saturated scores at 1.0 should be < 15% (if higher, scoring formula may have issues)
  3. Quality by Category - Identify weak areas (e.g., agent-focused queries underperforming)
  4. Per-query results - Check specific queries that scored 0.0 (complete miss) or low NDCG

Open the report in the editor for the user to review.

Step 4: Compare Before/After (Optional)

If asked to compare two runs (e.g., before and after a scoring algorithm change):

bash
uv run python scripts/benchmark_search.py \
    --compare tests/fixtures/search_dataset/benchmark_results.json other_results.json

Output Format

The report includes:

  • Registry metadata: version, database backend, server/agent/skill counts
  • Quality Metrics: NDCG@10, MRR, Recall@10 averaged across all queries
  • Score Health: saturation analysis (unique scores, % at 1.0, range)
  • Quality by Category: breakdown per query type
  • Per-query results: top 5 results with scores and ground truth comparison

Interpreting Metrics

MetricGoodExcellentPoor
NDCG@10> 0.65> 0.80< 0.50
MRR> 0.70> 0.85< 0.50
Recall@10> 0.75> 0.90< 0.60
Score saturation< 15%< 5%> 30%

Example

$ /search-benchmark https://d2xl2zfuhgc4l0.cloudfront.net .token

This will:

  1. Generate ~90 queries from the registry's assets
  2. Run each query against the semantic search API
  3. Produce a report showing search quality metrics
  4. Open the report for review

Troubleshooting

  • 401 errors: Token expired. Get a fresh one from the registry UI "Get JWT Token" button.
  • 0 assets found: Registry has no servers/agents/skills registered, or token lacks permissions.
  • Low NDCG on "description-derived" category: Expected for programmatically generated queries. Add hand-curated queries for better evaluation.
  • High saturation (>30% at 1.0): Scoring formula may be using the legacy additive method. Set SEARCH_FUSION_METHOD=rrf on the registry.

Related

常见问题

Search Benchmark AI 技能有什么作用?

为 AI Registry 生成搜索质量基准测试。根据注册表中的资源生成基准答案,针对语义搜索 API 运行 100+ 条查询,使用 NDCG@10/MRR/Recall 评估结果,并生成 Markdown 报告。适用于您想在评分算法、嵌入模型或索引内容变更后衡量搜索质量的情况。

为什么在 TypingMind 中使用 Search Benchmark?

因为您只需安装一次,就能搭配任何模型使用。Search Benchmark 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Search Benchmark?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/agentic-community/mcp-gateway-registry/tree/main/.claude/skills/search-benchmark。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Search Benchmark?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Search Benchmark 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Search Benchmark 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Search Benchmark AI 技能免费吗?

是的。agentic-community 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇