Research
Organizing generated reasoning tools with ToolLibGen
Semantic clustering and code-review agents consolidate task-specific tools into interfaces that support retrieval and reuse.
Generating a tool for a particular question can leave behind a useful piece of code. ToolLibGen asks how a growing collection of those pieces can become a library that an agent can search and reuse.
Group tools by the work they perform
The pipeline begins with discrete tools created for individual reasoning tasks. It clusters those tools into semantically related topics. This grouping supplies a local context for consolidation: functions that perform related work can be reviewed together.
The structure of the collection matters to retrieval. A library with clear groupings and reusable interfaces gives the retrieval step a more organized set of candidates to consider as the collection grows.
Refactor with a code-and-review loop
Within a cluster, a code agent designs and implements aggregated tools. Shared logic moves into Python classes and supporting functions, with interface functions exposing the resulting capabilities.
A reviewing agent checks the new implementation against the tasks associated with the original tools. Feedback returns to the code agent for refinement. This creates a concrete link between code consolidation and the reasoning questions that the tools were built to solve.
Library quality becomes part of reasoning quality
The paper evaluates tool retrieval and downstream reasoning across multiple tasks. Its experiments report that the structured library improves retrieval and reasoning, with benefits as the initial collection grows.
The contribution is a method for managing a generated tool collection over time. Creation, organization, and consolidation each have their own role in the pipeline. That decomposition gives developers several useful places to inspect the system: the task that motivated a function, the cluster containing it, and the review that connects a refactored interface to its original use.
Murong Yue and collaborators developed ToolLibGen through work at Salesforce AI Research and George Mason University. Haolin Chen is a co-author. Read the paper.