Plan or Retrieve First? A Scale Study of Tool Discovery Architectures
Tool-augmented LLM agents discover relevant APIs from large registries before planning execution, yet finite context windows prohibit injecting all tool definitions into a single prompt.

ProofPaper ↗
Key points
- The dominant approach, which we term Retrieve-then-Plan (RtP), embeds the user query and retrieves similar tools via approximate nearest-neighbor search.
- We study an alternative Plan-then-Retrieve (PtR) paradigm in which the LLM first generates Abstract Tool Stubs (hypothesized function signatures describing needed capabilities) which then serve as retrieval queries against the registry.
- Evaluating on ToolBench (46,984 unique API endpoints, 50 categories) across single-tool (G1), intra-category multi-tool (G2), and cross-category multi-tool (G3) query subsets, we find a clear complexity-dependent crossover: RtP outperforms PtR on single-tool queries while PtR outperforms RtP on multi-tool queries.
- We further analyze token overhead and show that PtR’s extra discovery call roughly doubles inference cost, which pays off on multi-tool queries but hurts on single-tool ones, motivating complexity-adaptive routing as a practical direction—one that can be driven by a zero-cost signal already present in the pipeline (RtP’s top-1 retrieval score).
Sources (2)
- [1]Plan or Retrieve First? A Scale Study of Tool Discovery ArchitecturesApple Machine Learning Research · Oct 15, 12:00 AM
Tool-augmented LLM agents discover relevant APIs from large registries before planning execution, yet finite context windows prohibit injecting all tool definitions into a single prompt.
The dominant approach, which we term Retrieve-then-Plan (RtP), embeds the user query and retrieves similar tools via approximate nearest-neighbor search.
- [2]Plan or Retrieve First? A Scale Study of Tool Discovery ArchitecturesarXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 13, 07:03 PM
Extractive summary: sentences quoted from the sources.
Before this
- Oct 13, 2026Evaluating Large Language Models for Multilingual Abstractive Summarization: A Comprehensive Study of English and Bengali
- Oct 13, 2026TRACESTEER: Trace Driven Activation Steering for Hallucination Mitigation in Diffusion Language Models
- Oct 13, 2026Mitigating Cross-Modal Hallucinations by Correcting Modality Misrouting in Omnimodal LLMs
- Oct 13, 2026Beyond the Verdict: Agentic Code Judging with Verifiable Feedback
- Oct 13, 2026Are We Testing Too Much? A Survey of Benchmark Compression for Efficient Evaluation of Large Language Models
- Oct 12, 2026Label-Centric Knowledge Retrieval for Zero-Shot Text Classification