Iterative Retrieval Pattern
Solves the "context problem" in multi-agent workflows where subagents don't know what context they need until they start working.
The Solution: Iterative Retrieval
A 4-phase loop that progressively refines context:
- •DISPATCH: Initial broad query to gather candidate files.
- •EVALUATE: Assess retrieved content for relevance (0.0 to 1.0).
- •REFINE: Update search criteria based on evaluation (add keywords, patterns, excludes).
- •LOOP: Repeat with refined criteria (max 3 cycles).
Best Practices
- •Start broad, narrow progressively.
- •Learn codebase terminology from the first cycle.
- •Track what's missing to drive refinement.
- •Stop at "good enough".