cd /news/ai-agents/plan-or-retrieve-first-a-scale-study… · home › topics › ai-agents › article
[ARTICLE · art-150900] src=machinelearning.apple.com ↗ pub= topic=ai-agents verified=true sentiment=· neutral

Plan or Retrieve First? A Scale Study of Tool Discovery Architectures

A scale study by Mingfei Zhang, Amit Surana, Ziauddin Majid, Chenxi Wang and Michael Xu found a complexity-dependent crossover between two tool-discovery architectures for LLM agents: Retrieve-then-Plan (RtP) beats Plan-then-Retrieve (PtR) on single-tool queries, while PtR wins on multi-tool queries. Evaluated on ToolBench's 46,984 unique API endpoints across 50 categories and query subsets G1, G2 and G3, the crossover held at every retrieval budget from k=1 to 20, across registry sizes from 1k to 47k APIs, and across Gemini 2.5 Flash and gpt-oss-120b. The authors attribute PtR's edge on complex queries to Abstract Tool Stubs decomposing multi-faceted intent, but note PtR's extra discovery call roughly doubles inference cost, motivating complexity-adaptive routing driven by RtP's top-1 retrieval score.

read2 min views1 publishedOct 15, 2026
Plan or Retrieve First? A Scale Study of Tool Discovery Architectures
Image: Apple ML Research

content type paperpublished October 2026 Plan or Retrieve First? A Scale Study of Tool Discovery Architectures

AuthorsMingfei Zhang, Amit Surana, Ziauddin Majid, Chenxi Wang, Michael Xu

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. 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. This crossover holds at every retrieval budget (k=1 to 20), is robust across registry sizes from 1k to 47k APIs, and is consistent across model families (Gemini 2.5 Flash and gpt-oss-120b). We characterize a stub-hallucination failure mode (the LLM invents plausible but non-existent API names) that acts as a double-edged sword: on simple queries PtR’s stubs abstract away proper-noun signals that RtP matches directly, yet on complex queries the same mechanism decomposes multi-faceted intent into functional sub-needs. 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).

ProTIP: Progressive Tool Retrieval Improves Planning

December 20, 2023research area Knowledge Bases and Search, research area Speech and Natural Language Processing

Large Language Models (LLMs) are increasingly employed for complex multi-step planning tasks, where the Tool Retrieval (TR) step is crucial for achieving successful outcomes. Two prevalent approaches for TR are single-step retrieval, which utilizes the complete query, and sequential retrieval using Task Decomposition (TD), where a full query is segmented into discrete atomic subtasks. While single-step retrieval lacks the flexibility to handle…

Context Tuning for Retrieval Augmented Generation

December 18, 2023research area Knowledge Bases and Search, research area Speech and Natural Language ProcessingWorkshop at EACL

This paper was accepted at the UncertaiNLP workshop at EACL 2024.

Large language models (LLMs) have the remarkable ability to solve new tasks with just a few examples, but they need access to the right tools. Retrieval Augmented Generation (RAG) addresses this problem by retrieving a list of relevant tools for a given task. However, RAG’s tool retrieval step requires all the required information to be explicitly present in the query. This is a…

── more in #ai-agents 4 stories · sorted by recency
── more on @mingfei zhang 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/plan-or-retrieve-fir…] indexed:0 read:2min 2026-10-15 · —