ir-analysis

Compute precision, recall, MRR, nDCG, and MAP for file retrieval comparisons.

32|4|Updated Feb 1, 2026
One-click install
npx skills add https://github.com/sourcegraph/CodeScaleBench --skill ir-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ir-analysis
Source: https://github.com/sourcegraph/CodeScaleBench/tree/main/skills/ir-analysis
Command: npx skills add https://github.com/sourcegraph/CodeScaleBench --skill ir-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill quantifies how effectively AI agents retrieve relevant files from a codebase, comparing different retrieval methods against a known ground truth.

Core Features & Use Cases

  • Information Retrieval (IR) Metrics: Computes Precision, Recall, MRR, nDCG, and MAP for file access.
  • Config Comparison: Directly compares retrieval performance between baseline (local tools) and advanced (e.g., Sourcegraph MCP) configurations.
  • Use Case: Evaluate if an AI coding assistant is more likely to find the correct files needed for a task when using a semantic search tool versus relying solely on traditional file system commands.

Quick Start

Run the ir-analysis skill to compute retrieval metrics for all benchmarks.

Frequently Asked Questions about ir-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I measure information retrieval quality for an AI agent in my codebase?

You measure retrieval quality by comparing file access results against known ground truth data to calculate precision, recall, MRR, nDCG, and MAP metrics for different configurations.

What is the best way to compare semantic search against local file system commands for AI coding assistants?

Comparing retrieval methods involves evaluating file recall performance between baseline local tools and advanced semantic search configurations to see which finds correct files faster.

How does evaluating ground truth data improve codebase search quality assessments?

Evaluating ground truth data provides a known baseline to calculate recall and precision, verifying whether an AI agent successfully retrieves the relevant files needed for a task.

Can I calculate MRR and nDCG metrics for file access retrieval without external dependencies?

Yes, you can calculate MRR and nDCG natively, as the analysis operates without external dependencies to directly compute information retrieval metrics from benchmark ground truth data.

When do I need to run nDCG and MAP evaluations for codebase file retrieval?

You run nDCG and MAP evaluations when you need to quantify how effectively an AI agent retrieves relevant files from a codebase across different retrieval configurations.