Tool Selection
Overview
Tool Selection — a component of the agent architecture responsible for choosing the appropriate tool (function, API, plugin) based on the current state of the dialogue and the agent's intent. It can be performed by an LLM through function calling or by a separate classifier.
Selection Strategies
- LLM function calling: the model receives descriptions of tools and returns a JSON with the selected tool and arguments.
- Semantic router: the embedding of the query is compared to the embeddings of tool descriptions.
- Rules and heuristics: deterministic conditions for simple scenarios.
- Hybrid approach: a combination of LLM and heuristics to increase reliability.
Example function calling
{
"name": "get_weather",
"arguments": "{\"city\": \"Moscow\"}"
}