Multi-Step Query Planning with Search APIs
Breaking a broad question into a sequence of narrower search queries an agent executes in order.
How it works
Rather than issuing one search call per question, a planning agent first decomposes a broad or multi-part question into an ordered list of narrower sub-queries, executes them in sequence, and often refines later queries based on what earlier ones returned — effectively treating search as an iterative narrowing process rather than a single lookup.
Example
Question: 'Which cloud provider is cheapest for a small startup's GPU workload?' Step 1 queries cloud GPU pricing comparison 2026 to get a general landscape. Step 2, informed by provider names surfaced in step 1, queries "[Provider A]" vs "[Provider B]" GPU instance pricing for a direct comparison. Step 3 queries "[Provider A]" startup credits GPU to check for a factor the first two steps didn't surface.
Pitfalls
- A plan generated up front without allowing revision based on intermediate results wastes the main advantage of multi-step planning — the ability to course-correct after seeing what step 1 actually returned.
- Over-decomposing a genuinely simple question into unnecessary sub-queries adds latency and cost without improving answer quality.
- Sub-queries that are too dependent on a specific prior result (a specific product name that step 1 didn't actually surface) can produce a query with zero results, and the plan needs a fallback rather than treating that as task failure.