Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Dynamic Tool Dependency Retrieval for Efficient Function Calling

About

Function calling agents powered by Large Language Models (LLMs) select external tools to automate complex tasks. On-device agents typically use a retrieval module to select relevant tools, improving performance and reducing context length. However, existing retrieval methods rely on static and limited inputs, failing to capture multi-step tool dependencies and evolving task context. This limitation often introduces irrelevant tools that mislead the agent, degrading efficiency and accuracy. We propose Dynamic Tool Dependency Retrieval (DTDR), a lightweight retrieval method that conditions on both the initial query and the evolving execution context. DTDR models tool dependencies from function calling demonstrations, enabling adaptive retrieval as plans unfold. We benchmark DTDR against state-of-the-art retrieval methods across multiple datasets and LLM backbones, evaluating retrieval precision, downstream task accuracy, and computational efficiency. Additionally, we explore strategies to integrate retrieved tools into prompts. Our results show that dynamic tool retrieval improves function calling success rates between $23\%$ and $104\%$ compared to state-of-the-art static retrievers.

Bhrij Patel, Davide Belli, Amir Jalalirad, Maximilian Arnold, Aleksandr Ermolov, Bence Major• 2025

Related benchmarks

TaskDatasetResultRank
Function SelectionTinyAgent
Function Selection Accuracy94.2
50
Function SelectionTaskBench HuggingFace
Function Selection Accuracy71.9
45
Function SelectionTaskBench DailyLife
Function Selection Accuracy93.7
36
Function SelectionTaskBench Multimedia
Function Selection Acc74.8
36
Function CallingTinyAgent
FSA0.807
18
Function CallingTB-DL
FSA89
18
Function CallingTB-HF
FSA60.5
18
Function CallingTB-MM
FSA64.1
18
Tool Retrieval and Function SelectionTaskbench-HF
MRR0.75
18
Tool RetrievalTinyAgent
MRR93
9
Showing 10 of 13 rows

Other info

Follow for update