Advanced Tool Use (BM25 Tool Retrieval)
Automatically discover relevant tools at runtime using BM25 lexical search. When you have many tools, this feature keeps the model prompt small: the model sees tools_retriever, searches the runtime tool catalog, then calls the matching tool returned by the search.
Quick Setup
agent_config = {
"enable_advanced_tool_use": True # Enable BM25 retrieval
}
How It Works
- Local tools, MCP tools, workspace/artifact tools, skills, and other registered runtime tools are indexed in memory.
- Always-visible harness tools such as
tools_retriever, workspace tools, artifact tools, and subagent tools stay directly visible.
- The model calls
tools_retriever with a semantic query for the capability it needs.
- The retriever returns the top matching tools with names, descriptions, and parameters.
- The model calls the selected tool normally.
Benefits
- Scales to 1000+ tools — searchable tools do not all need to be stuffed into the prompt
- Zero network I/O — index lives in memory
- Deterministic — same query always selects same tools
- Container-friendly — no external dependencies
Enable when you have many local or MCP tools and want the agent to discover the right capability through the runtime tool catalog.