Search papers, labs, and topics across Lattice.
The paper introduces Dynamic Tool Dependency Retrieval (DTDR), a retrieval method that conditions on both the initial query and the evolving execution context to address the limitations of static tool retrieval in function calling agents. DTDR models tool dependencies from function calling demonstrations, enabling adaptive retrieval as plans unfold and improving the selection of relevant tools. Experiments across multiple datasets and LLM backbones demonstrate that DTDR significantly improves function calling success rates, achieving gains between 23% and 104% compared to static retrievers.
LLM agents can boost function calling success by up to 104% simply by dynamically retrieving tools based on the evolving execution context, instead of relying on static retrieval.
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.