Tool Selection Strategy
The Tool Selection Strategy is currently in preview. The Vector selection strategy is currently limited to Claude models served on Databricks.
When you enable an extension, you gain access to all of its tools. For example, the Google Drive extension provides tools for reading documents, updating permissions, managing comments, and more. By default, Goose loads all tools into context when interacting with the LLM.
Enabling multiple extensions gives you access to a wider range of tools, but loading a lot of tools into context can be inefficient and confusing for the LLM. It's like having every tool in your workshop spread out on your bench when you only need one or two.
Choosing an intelligent tool selection strategy helps avoid this problem. Instead of loading all tools for every interaction, it loads only the tools needed for your current task. Both vector and LLM-based strategies ensure that only the functionality you need is loaded into context, so you can keep more of your favorite extensions enabled. These strategies provide:
- Reduced token consumption
- Improved LLM performance
- Better context management
- More accurate and efficient tool selection
Tool Selection Strategies
Strategy | Speed | Best For | Example Query |
---|---|---|---|
Default | Fastest | Few extensions, simple setups | Any query (loads all tools) |
Vector | Fast | Keyword-based matching | "read pdf file" |
LLM-based | Slower | Complex, ambiguous queries | "analyze document contents" |
Default Strategy
The default strategy loads all tools from enabled extensions into context, which works well if you only have a few extensions enabled. When you have more than a few extensions enabled, you should use the vector or LLM-based strategy for intelligent tool selection.
Best for:
- Simple setups with few extensions
- When you want all tools available at all times
- Maximum tool availability without selection logic
Vector Strategy
The vector strategy uses mathematical similarity between embeddings to find relevant tools, providing efficient matching based on vector similarity between your query and available tools.
Best for:
- Situations where fast response times are critical
- Queries with keywords that match tool names or descriptions
Example:
- Prompt: "read pdf file"
- Result: Quickly matches with PDF-related tools based on keyword similarity
The default embedding model is text-embedding-3-small
. You can change it using environment variables.
LLM-based Strategy
The LLM-based strategy leverages natural language understanding to analyze tools and queries semantically, making selections based on the full meaning of your request.
Best for:
- Complex or ambiguous queries that require understanding context
- Cases where exact keyword matches might miss relevant tools
- Situations where nuanced tool selection is important
Example:
- Prompt: "help me analyze the contents of my document"
- Result: Understands context and might suggest both PDF readers and content analysis tools
Configuration
- Goose Desktop
- Goose CLI
- Click the gear icon ⚙️ on the top toolbar
- Click
Advanced settings
- Under
Tool Selection Strategy
, select your preferred strategy:Default
Vector
LLM-based
- Run the
configuration
command:
goose configure
- Select
Goose Settings
:
┌ goose-configure
│
◆ What would you like to configure?
│ ○ Configure Providers
│ ○ Add Extension
│ ○ Toggle Extensions
│ ○ Remove Extension
│ ● Goose Settings (Set the Goose Mode, Tool Output, Tool Permissions, Experiment, Goose recipe github repo and more)
└
- Select
Router Tool Selection Strategy
:
┌ goose-configure
│
◇ What would you like to configure?
│ Goose Settings
│
◆ What setting would you like to configure?
│ ○ Goose Mode
│ ● Router Tool Selection Strategy (Configure the strategy for selecting tools to use)
│ ○ Tool Permission
│ ○ Tool Output
│ ○ Toggle Experiment
│ ○ Goose recipe github repo
└
- Select your preferred strategy:
┌ goose-configure
│
◇ What would you like to configure?
│ Goose Settings
│
◇ What setting would you like to configure?
│ Router Tool Selection Strategy
│
◆ Which router strategy would you like to use?
│ ● Vector Strategy (Use vector-based similarity to select tools)
│ ○ Default Strategy
└
Currently, the LLM-based strategy can't be configured using the CLI.
This example output shows the Vector Strategy
was selected:
┌ goose-configure
│
◇ What would you like to configure?
│ Goose Settings
│
◇ What setting would you like to configure?
│ Router Tool Selection Strategy
│
◇ Which router strategy would you like to use?
│ Vector Strategy
│
└ Set to Vector Strategy - using vector-based similarity for tool selection
Goose CLI display a message indicating when the vector or LLM-based strategy is currently being used.