Skip to content

Conversation

@kevincogan
Copy link

@kevincogan kevincogan commented Oct 29, 2025

Summary

Implemented the Tool Fetcher algorithm to let an agent dynamically discover and call tools via a single hub. Uses dense embeddings + optional Milvus vector index, with substring fallback. Reduces context overhead by fetching only relevant tools on-demand instead of loading all tools upfront.

What's included

  • Algorithm: evaluator/algorithms/tool_fetcher_algorithm.py
    • Single exposed tool tool_hub that supports:
      • action='search' to retrieve relevant tools by name/description
      • action='call' to invoke a specific tool by exact name
    • Embedding-based retrieval using HuggingFaceEmbeddings with optional Milvus index; automatic fallback to substring match
    • Configurable hybrid search (dense + BM25), cross-encoder reranking, similarity thresholds, and indexed tool parts
    • Query-scoped active tool tracking and JSON responses for search/call actions
    • Tool usage logging via TOOL_LOG_PATH
  • Config: evaluator/config/yaml/tool_fetcher_experiments.yaml
    • 17 total algorithms (16 variants + baseline) testing different embedding models, top_k values, indexed parts, and similarity metrics
    • Uses StableToolBench remote datasets (G1 category/instruction/tool) and reference answers
    • Includes tool selection, retrieval (Recall@k, AP), answer quality, and efficiency metric collectors

Quick test

# From repository root:
cd tool-rag-experiments

# Ensure .env file is configured with the correct values
# MILVUS_URL, QWEN_MODEL_URL, optional TOOL_LOG_PATH

python main.py -c evaluator/config/yaml/tool_fetcher_experiments.yaml

@kevincogan kevincogan force-pushed the feature/tool-fetcher branch 3 times, most recently from 2f94d57 to a53abf2 Compare October 31, 2025 10:50
@kevincogan kevincogan force-pushed the feature/tool-fetcher branch from a53abf2 to 358dd39 Compare October 31, 2025 12:53
@kevincogan kevincogan marked this pull request as ready for review October 31, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant