grading

Grade retrieved documents for binary relevance to a query.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/edangx100/adaptive_rag --skill grading
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grading
Source: https://github.com/edangx100/adaptive_rag/tree/main/.claude/skills/grading
Command: npx skills add https://github.com/edangx100/adaptive_rag --skill grading

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the time-consuming task of manually reviewing search results by automatically scoring document relevance.

Core Features & Use Cases

  • Binary Relevance Scoring: Uses AI to determine if documents are relevant (yes/no) with reasoning.
  • Adaptive Pipeline Control: Triggers query rewriting when no relevant documents are found.
  • Use Case: When a search returns 10 documents, this Skill automatically identifies the 3 most relevant ones for answer generation.

Quick Start

Grade the retrieved documents for relevance to the query "gaming laptops."

Frequently Asked Questions about grading

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

FAQPage Schema
How do I filter irrelevant documents from search results automatically?

Document filtering uses AI-powered binary relevance scoring to automatically identify which retrieved documents answer your query. This Skill applies yes/no grading to each document, outputs a relevant boolean with reasoning, and enables downstream systems to retain only high-confidence results for answer generation.

Can I use AI grading to improve RAG pipeline quality?

Yes. Grading documents for relevance in retrieval-augmented generation pipelines removes noise from sources like ChromaDB or web search. When no relevant documents pass the grading threshold, the system can trigger query rewriting or retries, improving answer quality without manual review.

What happens when a retrieval search returns no relevant documents?

The grading Skill detects when zero documents meet relevance thresholds and signals downstream logic to initiate adaptive pipeline control—query rewriting or retry attempts—rather than generating answers from irrelevant sources.

How does document relevance grading work with ChromaDB or web search?

Relevance grading applies binary classification (relevant/not relevant) to documents retrieved from ChromaDB, web search, or other sources. The Skill uses configurable AI models with structured outputs including relevance decision and reasoning explanation.

Do I need to configure which model grades document relevance?

Document grading is config-driven through GRADING_MODEL in config.py, defaulting to Claude Haiku 3.5 with temperature 0 for consistent scoring. You can specify alternative models while maintaining structured result output.

What's the difference between filtering documents manually versus using AI grading?

Manual filtering is time-consuming and subjective; AI grading automatically scores all retrieved documents against query intent in seconds, identifies the most relevant subset for answer generation, and scales consistently across retrieval pipeline workflows.