iterative-retrieval

Refine context retrieval across up to three iterative cycles for subagent tasks.

3|2|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/agentmatters/mullai-bot --skill iterative-retrieval-agentmatters
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iterative-retrieval
Source: https://github.com/agentmatters/mullai-bot/tree/main/src/Mullai.Skills/Skills/claude-code-everything/iterative-retrieval
Command: npx skills add https://github.com/agentmatters/mullai-bot --skill iterative-retrieval-agentmatters

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Solves the context problem in multi-agent workflows where subagents don't know what context they need until they start working.

Core Features & Use Cases

  • Four-phase iterative retrieval loop (DISPATCH, EVALUATE, LOOP, REFINE) to progressively identify relevant files.
  • Supports scoring and filtering by relevance, dynamic query refinement, and cycle-limited execution (max 3 cycles).
  • Integrates with codebase exploration for context refinement, handling context size limits and missing context.

Quick Start

Run the iterative retrieval process to gather highly relevant files for a subagent task by starting with a broad query and refining it over up to three cycles.

Frequently Asked Questions about iterative-retrieval

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

FAQPage Schema
How do I narrow down large codebase context for subagents without losing critical information?

Iterative retrieval progressively narrows large codebase contexts by running a four-phase loop—DISPATCH, EVALUATE, LOOP, REFINE—across up to three cycles. It scores file relevance and dynamically refines queries to return only highly relevant files to subagents.

What is the best way to handle evolving context needs in multi-agent workflows?

Evolving context in multi-agent workflows is handled by iteratively refining retrieval queries as subagents work. The process dispatches broad queries, evaluates results, and loops back with refined queries, ensuring subagents receive context they did not know they needed initially.

How does iterative context retrieval work for managing token usage in codebase exploration?

Iterative context retrieval manages token usage by filtering out irrelevant files through relevance scoring and dynamic query refinement. By executing a maximum of three retrieval cycles, it excludes unnecessary context, keeping the token count within size limits.

When do I need iterative retrieval for subagent context management?

You need iterative retrieval when spawning subagents that require evolving codebase context. It is specifically designed for scenarios where subagents do not know what context they need until they start working, or when large contexts must be narrowed without losing critical information.

Can I use iterative retrieval to filter codebase files by relevance scoring?

Yes, iterative retrieval filters codebase files by applying relevance scoring during the EVALUATE phase. It dynamically refines search queries and excludes irrelevant files over multiple cycles, returning a highly relevant subset of files for your subagent tasks.

What are the limitations of using a cycle-limited retrieval loop for context refinement?

The retrieval loop is limited to a maximum of three cycles, meaning context refinement stops after the third iteration regardless of whether optimal relevance is achieved. This bounds execution time but may miss deeply nested context in extremely large codebases.