iterative-retrieval

Refine codebase retrieval across multiple cycles using relevance scoring and gap detection.

Updated May 4, 2026
One-click install
npx skills add https://github.com/gganbukim1/myskills --skill iterative-retrieval-gganbukim1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/gganbukim1/myskills/tree/main/iterative-retrieval
Command: npx skills add https://github.com/gganbukim1/myskills --skill iterative-retrieval-gganbukim1

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Iterative retrieval prevents multi-agent subworkers from failing due to missing or oversized context by progressively narrowing which code files are most relevant to the task.

Core Features & Use Cases

  • Progressive context refinement: Starts with a broad candidate set, evaluates relevance, refines the query, and repeats for up to three cycles.
  • Relevance scoring with gap detection: Assigns a relevance score and explicitly identifies missing context to guide the next retrieval pass.
  • Terminology and pattern learning: Updates search patterns and keywords based on what the codebase actually uses, improving accuracy over cycles.
  • Use Cases: Debugging authentication/session issues, implementing features when the project uses unfamiliar naming, and reducing token usage in agent orchestration by stopping once “good enough” context is found.

Quick Start

Ask an AI agent to retrieve the minimal set of code files for your multi-agent task by running iterative retrieval for up to three cycles using broad keywords first, then refining based on relevance scores and identified context gaps.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I prevent multi-agent subagents from failing due to missing or oversized codebase context?

Multi-agent context failures are prevented by using iterative retrieval to progressively narrow broad candidate files into high-relevance selections. This approach evaluates relevance scores and identifies context gaps over up to three cycles to ensure optimal context size.

What is the best way to find relevant code files when the project uses unfamiliar naming patterns?

Finding relevant files with unfamiliar naming requires iterative retrieval with terminology and pattern learning. The mechanism updates search keywords based on actual codebase usage during each retrieval cycle, progressively improving search accuracy for bug fixing or feature implementation.

How does iterative retrieval optimize token usage in RAG pipelines?

Token optimization in RAG pipelines is achieved by applying relevance scoring with early stopping. The iterative retrieval process halts once sufficient high-relevance context is found, preventing oversized context windows from consuming excessive tokens during agent orchestration.

Can I use iterative retrieval for code exploration tasks in a multi-agent system?

Yes, iterative retrieval is designed for multi-agent code exploration scenarios. It applies a multi-cycle loop with candidate dispatch and query refinement, explicitly identifying missing context to guide the next retrieval pass until relevant files are acquired.

What are the limitations of using progressive context refinement for codebase search?

Progressive context refinement is limited to a maximum of three retrieval cycles. If the high-relevance context threshold is not met within these cycles, the mechanism stops, potentially requiring manual query refinement for complex codebase search tasks with deeply nested dependencies.