iterative-retrieval

Refines codebase context retrieval through iterative dispatch, evaluate, and refine cycles.

2|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/adamreger/ecc-antigravity --skill iterative-retrieval-adamreger
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/adamreger/ecc-antigravity/tree/main/skills/iterative-retrieval
Command: npx skills add https://github.com/adamreger/ecc-antigravity --skill iterative-retrieval-adamreger

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Subagents in multi-agent workflows are spawned with limited context and cannot predict which files or patterns they need upfront, leading to context overflow, missing information, or failed tasks. ## Core Features & Use Cases - Four-Phase Retrieval Loop: Implements DISPATCH, EVALUATE, REFINE, and LOOP phases that progressively narrow search criteria over a maximum of three cycles. - Relevance Scoring: Scores candidate files on a 0-1 scale and identifies missing context gaps to drive the next query refinement. - Terminology Discovery: Learns codebase-specific naming conventions (e.g., discovering "throttle" instead of "rate limit") during early cycles to improve later retrieval. - Use Case: When fixing an authentication token expiry bug, the agent starts with broad keyword searches, evaluates relevance of auth.ts and tokens.ts, refines with discovered terms like "jwt" and "refresh", and returns only high-relevance files. ## Quick Start Use the iterative-retrieval pattern to gather the right codebase context for this task, running up to three refinement cycles and returning only files with relevance above 0.7.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I give subagents the right codebase context?▼

Use iterative retrieval: start with a broad keyword and file-pattern search, score each file's relevance on a 0-1 scale, identify missing context, then refine the query and repeat up to three cycles. Return only files scoring 0.7 or higher.

How to reduce token usage in multi-agent workflows?▼

Iterative retrieval reduces token usage by sending only high-relevance files instead of entire codebases. Low-relevance files are excluded after evaluation, and the loop stops once sufficient context is found, typically within three cycles.

What is the iterative retrieval pattern for AI agents?▼

It is a four-phase loop of DISPATCH, EVALUATE, REFINE, and LOOP that progressively narrows search criteria. Each cycle scores candidate files, extracts new keywords and patterns from relevant results, and excludes confirmed irrelevant paths.

Why do subagents fail with missing context errors?▼

Subagents fail because they are spawned without knowing which files, patterns, or terminology the codebase uses. Sending everything exceeds context limits while sending nothing lacks critical information; iterative retrieval resolves this by discovering context progressively.

When should I stop the retrieval refinement loop?▼

Stop when you have at least three high-relevance files (0.7 or above) with no critical context gaps, or after a maximum of three cycles. Three high-relevance files generally outperform ten mediocre matches.