Iterative Retrieval
Parent: Retrieval & RAG · Published reference · snapshot 2026-09-08 · skill ai-rag-retrieval/references/iterative-retrieval.md
↓ Facts as markdownall context files
マルチエージェントワークフローにおける「コンテキスト問題」を解決します。サブエージェントは作業を開始するまで、どのコンテキストが必要かわかりません。
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
反復検索パターン
- マルチエージェントワークフローにおける「コンテキスト問題」を解決します。サブエージェントは作業を開始するまで、どのコンテキストが必要かわかりません。 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#反復検索パターン]
問題
- サブエージェントは限定的なコンテキストで起動されます。以下を知りません: [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#問題]
- どのファイルに関連するコードが含まれているか [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#問題]
- コードベースにどのようなパターンが存在するか [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#問題]
- プロジェクトがどのような用語を使用しているか [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#問題]
- すべてを送信: コンテキスト制限を超える [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#問題]
- 何も送信しない: エージェントに重要な情報が不足 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#問題]
- 必要なものを推測: しばしば間違い [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#問題]
解決策: 反復検索
- コンテキストを段階的に洗練する4フェーズのループ: [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#解決策-反復検索]
フェーズ1: DISPATCH
- 候補ファイルを収集する初期の広範なクエリ: [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#フェーズ1-dispatch]
フェーズ2: EVALUATE
- 高(0.8-1.0): ターゲット機能を直接実装 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#フェーズ2-evaluate]
- 中(0.5-0.7): 関連するパターンや型を含む [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#フェーズ2-evaluate]
- 低(0.2-0.4): 間接的に関連 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#フェーズ2-evaluate]
- なし(0-0.2): 関連なし、除外 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#フェーズ2-evaluate]
フェーズ4: LOOP
- 洗練された基準で繰り返す(最大3サイクル): [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#フェーズ4-loop]
ベストプラクティス
- 広く開始し、段階的に絞る - 初期クエリで過度に指定しない [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#ベストプラクティス]
- コードベースの用語を学ぶ - 最初のサイクルでしばしば命名規則が明らかになる [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#ベストプラクティス]
- 不足しているものを追跡 - 明示的なギャップ識別が洗練を促進 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#ベストプラクティス]
- 「十分に良い」で停止 - 3つの高関連性ファイルは10個の平凡なファイルより優れている [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#ベストプラクティス]
- 確信を持って除外 - 低関連性ファイルは関連性を持つようにならない [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#ベストプラクティス]
関連項目
- The Longform Guide - サブエージェントオーケストレーションセクション [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#関連項目]
- continuous-learningスキル - 時間とともに改善するパターン用 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#関連項目]
- ~/.claude/agents/内のエージェント定義 [archived source: https://llms-explorer.com/sources/mdb-context-hub/iterative-retrieval/#関連項目]
Where this helps
- Multi-agent or subagent workflows where a dispatched agent starts with little or no context about which files, patterns, or terminology are relevant to its assigned task. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Situations where sending the full codebase or document set up front would blow the context budget, but a single guessed query risks missing the information the agent actually needs. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Tasks where the right search terms aren't known upfront — codebase-specific naming conventions typically only surface after an initial broad query returns real results to learn from. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Retrieval pipelines that need a principled stopping point rather than an unbounded search loop — capping refinement at a fixed number of cycles trades a small chance of missed context for predictable latency and cost. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Project ideas
- Build a DISPATCH → EVALUATE → LOOP retrieval harness for a coding subagent: an initial broad file-search call, a relevance-scoring pass over the candidates (on a 0-1 scale), and a bounded refinement loop capped at 3 cycles. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Prototype a context-budget-aware retrieval agent that tracks explicit "gaps" — what it still doesn't know — between loop iterations, instead of silently re-running the same query. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Build an eval harness that compares "send everything," "send nothing," and iterative-retrieval strategies on the same subagent task, measuring context-window usage against task success rate. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Add a stopping-condition module to an existing RAG or agent pipeline that halts refinement once a small number of high-relevance (0.8+) results are found, instead of always running to a fixed cycle count. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Antipatterns
- Sending an overly narrow, over-specified query on the first DISPATCH pass instead of starting broad — the opposite of the pattern's own best-practice guidance to widen first, then narrow gradually. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Treating a low-relevance (0.2-0.4) file as worth revisiting later — the pattern's guidance is to exclude with confidence, since low-relevance files don't become relevant on later cycles. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Looping indefinitely instead of capping refinement at a fixed number of cycles (the pattern caps at 3) — an unbounded loop defeats the purpose of trading completeness for a bounded cost. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Guessing what context a subagent needs instead of running an explicit DISPATCH phase — the pattern names guessing as one of its three core failure modes, alongside sending everything and sending nothing. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Known issues
- The pattern caps refinement at roughly 3 cycles, trading thoroughness for bounded latency and cost — a task whose relevant context is unusually scattered across the codebase may need more cycles than the pattern budgets for. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- The relevance-scoring bands (High 0.8-1.0, Medium 0.5-0.7, Low 0.2-0.4, None 0-0.2) are a coarse four-way heuristic judged by the evaluating agent itself, not a precise numeric ranking, so files near a band boundary can be misclassified. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- The pack's own facet breakdown documents Phase 1 (DISPATCH), Phase 2 (EVALUATE), and Phase 4 (LOOP), but no separate Phase 3 — the refinement step between evaluation and looping is only implied, not spelled out as its own documented phase. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Children
- Context Refinement Patterns (frontier)
- Subagent Context Problems (frontier)
- Progressive Information Fetching (frontier)
Frontier under this node: Context Refinement Patterns, Progressive Information Fetching, Subagent Context Problems