iterative-retrieval

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

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill iterative-retrieval-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/iterative-retrieval
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill iterative-retrieval-freedom909

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: Dispatch broad queries, evaluate file relevance on a 0-1 scale, refine search criteria with discovered terminology, and loop up to 3 cycles. - Relevance Scoring and Gap Detection: Score candidate files, exclude low-relevance paths, and explicitly identify missing context to drive the next refinement. - Use Case: When fixing an authentication token expiry bug, start with broad keyword searches for "token" and "auth", discover the codebase uses "jwt" and "refresh" terminology, then refine until high-relevance files like session-manager.ts are found. ## Quick Start Use the iterative-retrieval pattern to gather the right codebase context for a subagent tasked with adding rate limiting to the API endpoints.

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: dispatch a broad keyword search, evaluate each file's relevance on a 0-1 scale, identify missing context, then refine the query and repeat up to 3 cycles. Return files scoring 0.7 or higher.

How to fix missing context failures in multi-agent workflows?▼

Missing context failures happen when subagents cannot predict needed files upfront. Iterative retrieval addresses this by learning codebase terminology in early cycles and targeting explicit gaps in later refinement passes.

What relevance score should files meet for agent context?▼

Files scoring 0.7 or higher are considered high relevance and should be included. Files below 0.2 should be confidently excluded, since low-relevance files will not become relevant in later cycles.

When should I stop the iterative retrieval loop?▼

Stop when you have at least 3 high-relevance files and no critical gaps, or after a maximum of 3 cycles. Three high-relevance files provide better context than ten mediocre ones.

What are the limitations of iterative context retrieval?▼

The loop caps at 3 cycles, so tasks needing deeper exploration may return incomplete context. Initial broad queries can also miss domain-specific terminology until the first evaluation cycle reveals naming conventions.