iterative-retrieval

Refine file retrieval criteria through DISPATCH, EVALUATE, REFINE, and LOOP cycles.

1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/khetansarvesh/ai_skills_repo --skill iterative-retrieval-khetansarvesh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/khetansarvesh/ai_skills_repo/tree/main/skills/iterative-retrieval
Command: npx skills add https://github.com/khetansarvesh/ai_skills_repo --skill iterative-retrieval-khetansarvesh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Iterative retrieval helps agent workflows succeed when subagents are launched with insufficient or unpredictable codebase context, causing “missing context” or “context too large” failures.

Core Features & Use Cases

  • Progressively refined context retrieval: Uses a 4-phase loop (DISPATCH → EVALUATE → REFINE → LOOP) to narrow from broad candidates to the most relevant files.
  • Relevance scoring with gap detection: Assigns a relevance score per retrieved file and identifies what critical information is still missing.
  • Token-efficient retrieval strategy: Limits cycles (max 3) and stops early when enough high-relevance context is found.

Quick Start

Ask an AI to retrieve the minimum set of code files needed for a subagent task by running the iterative retrieval loop with at most 3 refinement cycles.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I retrieve the right codebase context for a subagent when required files are unpredictable?

To retrieve the right codebase context, use an iterative retrieval loop that progressively refines file search criteria. This method applies a DISPATCH, EVALUATE, REFINE, and LOOP workflow to narrow broad candidate files down to the most relevant context for your subagent.

What is the best way to prevent missing context failures in a multi-agent code exploration pipeline?

Prevent missing context failures by applying an iterative retrieval loop with relevance scoring and gap detection. This approach progressively narrows file candidates and identifies missing critical information until enough high-relevance context is retrieved.

How do I optimize token usage when retrieving files for a RAG-like debugging pipeline?

Optimize token usage during file retrieval by implementing a maximum of three refinement cycles with an early-stop rule. This strategy limits retrieval loops and stops early once sufficient high-relevance context is identified for the debugging pipeline.

How does relevance scoring work when refining context retrieval for feature implementation scenarios?

Relevance scoring assigns a score per retrieved file and identifies critical information gaps during the EVALUATE phase. The query is then refined to target those gaps, progressively improving target relevance for your feature implementation scenarios.

Can I use iterative retrieval for multi-agent workflows with unpredictable context requirements?

Yes, you can use iterative retrieval for multi-agent workflows with unpredictable context requirements. It solves the subagent context problem by progressively refining file retrieval criteria through up to three cycles of query refinement and missing-context gap identification.