Tool Finder Tutorial¶

Complete Tutorial to using ToolUniverse’s three built-in tool discovery methods

Introduction¶

ToolUniverse contains a vast repository of over 600+ scientific tools. To help you quickly find the right tools for your research tasks, ToolUniverse provides three sophisticated tool finder methods, each optimized for different use cases and computational requirements.

Why Use Tool Finders?¶

The Challenge: With hundreds of available tools across domains like bioinformatics, chemistry, literature search, and data analysis, manually browsing through tool lists is time-consuming and inefficient.

The Solution: ToolUniverse’s tool finders allow you to describe your research task in natural language and automatically discover the most relevant tools.

Three Approaches: - Keyword Search: Fast, precise, resource-efficient - LLM Search: Intelligent, context-aware, handles complex queries - Embedding Search: Semantic understanding, scalable, similarity-based

Overview of Tool Finder Methods¶

Strategic Trade-offs¶

Each method offers different advantages:

Tool Finder Comparison¶

Method

Speed

Semantic Understanding

Resource Usage

Keyword Search

Very Fast

Basic

Very Low

LLM Search

Moderate

Excellent

High

Embedding Search

Fast

Good

Moderate

When to Use Each Method¶

🔍 Keyword Search - Use when: - You know specific technical terms - You need fast results - Working with limited computational resources - Looking for tools with specific names or exact terminology

đź§  LLM Search - Use when: - You have complex, multi-step research questions - Need intelligent interpretation of abstract goals - Want tool sequence recommendations - Have access to LLM APIs

🎯 Embedding Search - Use when: - You want semantic similarity matching - Need scalable search across large tool sets - Looking for conceptually similar tools - Want to find tools based on research intent rather than exact keywords

Comparing Search Methods¶

Practical Comparison¶

Let’s compare all three methods on the same query:

from tooluniverse import ToolUniverse

# Initialize ToolUniverse
tu = ToolUniverse()
# Load tool finder tools
tu.load_tools()

query = "find drugs for treating diabetes"

# Method 1: Keyword Search
keyword_result = tu.run({
    "name": "Tool_Finder_Keyword",
    "arguments": {"description": query, "limit": 5}
})

# Method 2: LLM Search
llm_result = tu.run({
    "name": "Tool_Finder_LLM",
    "arguments": {"description": query, "limit": 5}
})

# Method 3: Embedding Search
embedding_result = tu.run({
    "name": "Tool_Finder",
    "arguments": {"description": query, "limit": 5}
})

# Compare results
print("🔍 KEYWORD SEARCH RESULTS:")
print(keyword_result)

print("\nđź§  LLM SEARCH RESULTS:")
print(llm_result)

print("\n🎯 EMBEDDING SEARCH RESULTS:")
print(embedding_result)

Performance Analysis¶

Measure and compare performance:

from tooluniverse import ToolUniverse

# Initialize ToolUniverse
tu = ToolUniverse()
# Load tool finder tools
tu.load_tools()
import time

test_queries = [
    "protein structure analysis",
    "drug adverse events",
    "gene expression profiling",
    "molecular similarity search"
]

def benchmark_search_method(method_name, queries):
    times = []
    total_results = 0

    for query in queries:
        start_time = time.time()
        result = tu.run({
            "name": method_name,
            "arguments": {"description": query, "limit": 5}
        })
        end_time = time.time()

        times.append(end_time - start_time)
        total_results += len(result)

    avg_time = sum(times) / len(times)
    return avg_time, total_results

# Benchmark all methods
methods = [
    "Tool_Finder_Keyword",
    "Tool_Finder_LLM",
    "Tool_Finder"
]

for method in methods:
    avg_time, total_results = benchmark_search_method(method, test_queries)
    print(f"{method}:")
    print(f"  Average time: {avg_time:.3f}s")
    print(f"  Total results: {total_results}")

Troubleshooting¶

Common Issues and Solutions¶

Issue: LLM search fails

# Check API configuration
import os

required_env_vars = [
    "AZURE_OPENAI_API_KEY",
    "AZURE_OPENAI_ENDPOINT"
]

for var in required_env_vars:
    if not os.getenv(var):
        print(f"❌ Missing environment variable: {var}")
    else:
        print(f"âś… {var} is set")

Conclusion¶

ToolUniverse’s three tool finder methods provide powerful and flexible approaches to discovering the right tools for your research:

🔍 Keyword Search: Perfect for precise, fast searches with technical terminology

đź§  LLM Search: Ideal for complex, multi-step research workflows requiring intelligence

🎯 Embedding Search: Excellent for semantic similarity and conceptual tool discovery

Key Takeaways:

  1. Choose the right method for your specific use case and computational constraints

  2. Combine methods for comprehensive tool discovery

  3. Optimize queries based on the search method’s strengths

  4. Use fallback strategies when initial searches don’t yield results

Happy tool hunting! 🔬

Further Resources¶

Related Documentation: - Available Tools Reference - Overview of all ToolUniverse tools - Examples & Code Samples - Practical usage examples - custom_tools - Creating your own tools

API References: - ../api_comprehensive - Complete API documentation - ../reference/tool_categories - Tool categories and descriptions

Need Help?: - Troubleshooting Tutorial - Common issues and solutions - FAQ - Frequently Asked Questions - Frequently asked questions