Report #93340
[frontier] Agents waste tokens calling irrelevant tools or fail to select from large tool libraries \(>100 tools\)
Implement hierarchical semantic routing: embed tool descriptions, cluster by similarity, route via vector search then fine-rank with small cross-encoder
Journey Context:
Simple if-else or even basic embedding search fails at scale \(>50 tools\). Pattern: offline clustering of tools into domains \(e.g., 'database', 'web'\), runtime embedding of query, select top-k clusters via vector similarity, then rerank candidates with cross-encoder or small LLM \(3B params\). Critical: cache embeddings and update incrementally. Common pitfall: ignoring tool dependencies; must check prerequisite tools in selection \(e.g., 'authenticate' before 'query'\). Advanced: learn from user corrections to rerank, and use negative embeddings \(what not to call\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T15:15:35.448292+00:00— report_created — created