Bridging Tool Dependencies and Domain Knowledge: A Graph-Based Framework for In-Context Planning

Shengjie Liu, Li Dong, Zhenyu Zhang

TL;DR

This paper introduces a framework that automates the creation of high-quality planning examples for AI agents by fusing two distinct sources of information: a tool knowledge graph (how APIs depend on each other) and a domain knowledge graph (extracted from internal documents and SOPs). By linking these graphs and using graph-based retrieval, the system significantly improves an LLM's ability to plan complex, multi-step tasks in specialized business environments.

What Problem Does This Paper Address?

While Large Language Models (LLMs) are increasingly capable of using simple tools like "send email" or "search web," they often stumble when faced with complex, domain-specific business tools (e.g., inventory tracking or financial reporting).

The authors identify a "cold-start" problem: to perform well in a new business domain, an LLM needs high-quality "exemplars"—examples of how to use specific tools in sequence. Manually creating these is expensive and slow. Furthermore, standard retrieval methods often fail to find the right tools because they don't account for structural dependencies (e.g., Tool B requires the output of Tool A) or the procedural nuances hidden in Standard Operating Procedures (SOPs).

Methods

The researchers propose a multi-stage pipeline to bridge the gap between tool schemas and domain logic:

  1. Tool Graph Construction: They adapt a "Deep Research" approach to analyze tool schemas (descriptions, arguments, and payloads). They use an LLM-as-a-judge to identify and verify dependencies between tools, creating a directed graph of how data flows between APIs.
  2. Domain Knowledge Graph: Using GraphRAG, they convert internal documents and SOPs into a knowledge graph that captures procedural knowledge.
  3. Knowledge Fusion: These two graphs are fused in a graph database (Amazon Neptune). A new relationship, _can_use_this_tool_output, is established to link domain concepts to specific tool capabilities.
  4. Dense-Sparse Integration: To generate a plan for a specific user query, the system uses a framework inspired by HippoRAG2. It treats the tool graph as a "sparse" structural component and the domain KG as a "dense" semantic component.
  5. Personalized PageRank (PPR): Instead of simple keyword matching, the system uses PPR to traverse the fused graph and find the most relevant "subgraph" for a query, which is then used to prompt the LLM to generate a plan.

Datasets

The study utilizes ToolBench, a massive dataset containing 16,464 APIs. The authors sampled 3,000 queries across three levels of complexity:

  • G1: Single-tool instructions.
  • G2: Multi-tool instructions within the same category.
  • G3: Multi-tool instructions across different collections.

They also simulated external domain knowledge by using the Tavily-Search API to fetch real-world documentation related to the ToolBench API payloads.

Key Insights and Ideas

  • Structural vs. Procedural Knowledge: The core "aha moment" is that knowing what a tool does (schema) isn't enough; you must also know how it fits into a business process (SOP). Fusing these two types of graphs allows the agent to "see" connections that aren't obvious from text alone.
  • The Power of Personalized PageRank: The authors found that PPR is critical for surfacing "hidden" dependencies. For example, a simple embedding search might miss a tool like BacklogCheck if the query is about "inventory," but PPR can find it by following the dependency links from other inventory tools.
  • Model Agnosticism: Interestingly, the quality of the retrieved subgraph matters more than the size of the LLM. The relatively small Qwen3-8B model performed nearly as well as much larger models when provided with the right graph-based context.

Key Results

  • Dependency Accuracy: GPT-4o and Claude 4 both achieved high performance in identifying tool dependencies, with GPT-4o reaching 90.7% precision.
  • Plan Generation: In "Binary Match Accuracy" (how well the generated plan matches the ground truth), GPT-4o led with 77%, but the 8-billion parameter Qwen3-8B followed closely at 72%.
  • Ablation Success: Removing the Personalized PageRank (PPR) component resulted in a 9 percentage-point drop in accuracy, proving that graph traversal is superior to simple vector-based retrieval for complex planning.

Limitations and Future Work

The authors acknowledge a significant hurdle: the absence of real-world benchmarks specifically designed for detecting tool dependencies. Most current datasets are synthetic or simplified.

Future work will likely focus on:

  1. Developing more robust, "real-world" benchmarks for tool-augmented reasoning.
  2. Refining the "Human in the Loop" stage of the graph construction to ensure even higher precision in high-stakes business environments.
  3. Exploring how this framework handles "multi-turn" execution where the plan must change based on live tool outputs.

Summary updated

BibTeX
@inproceedings{liu2025bridging,
  author = {Shengjie Liu and Li Dong and Zhenyu Zhang},
  title = {{Bridging Tool Dependencies and Domain Knowledge: A Graph-Based Framework for In-Context Planning}},
  booktitle = {LAW @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=zurPaX2NLY},
}
Figure