Prisme.ai natively supports hybrid tool selection capabilities. This functionality is transparently integrated into agent creation processes within both AI Knowledge and AI Builder products. The platform allows developers to completely customize their tool selection system, giving you the control over how your AI agents operate. Learn how to implement custom tool selection logic so your AI agents can intelligently choose the right tools at precisely the right time, maximizing efficiency and performance.
Effective tool selection is critical for tool-using agents. It ensures that agents choose the right tool for each task, leading to accurate, efficient, and purposeful interactions. This guide explores strategies and techniques for implementing your own tool selection in Prisme.ai.
These guides provide example YAML files for educational purposes, showcasing the range of possibilities. It is up to the technical teams to implement them according to your internal tools and APIs.
For many applications, LLM-based selection provides the best balance of flexibility and effectiveness:
1
Craft Clear Tool Descriptions
Provide the LLM with detailed information about each tool.
Effective description elements:
Copy
Ask AI
name: CustomerLookupdescription: | Use this tool to find customer information in the CRM system. This tool should be used when the user asks about specific customer details, account status, or purchase history. Do NOT use this tool for general product inquiries or non-customer-specific questions. The tool requires either a customer ID or an email address to perform the lookup.
Key components include:
Clear purpose statement
When to use the tool
When NOT to use the tool
Required parameters
Expected outcomes
2
Provide Selection Guidelines
Include explicit guidance for tool selection in your agent instructions.
Example guidelines:
Copy
Ask AI
When choosing between available tools:1. Always use the most specific tool for the task2. Prefer internal data sources over external ones when both contain the information3. Use the ProductSearch tool for general product inquiries and ProductDetails for specific product information4. Only use the CustomerUpdate tool when explicitly asked to change customer information5. If multiple tools could work, explain your selection reasoning to the user
These guidelines help the LLM make consistent decisions aligned with business preferences.
3
Implement Parameter Extraction
Guide the LLM in extracting and formatting parameters from user requests.
Example guidance:
Copy
Ask AI
When extracting parameters for tools:1. For customer lookups, identify any customer ID (format: CUS-XXXXX) or email address2. For product searches, extract product type, category, price range, and features3. For date ranges, convert relative dates (e.g., "last week") to specific date formats4. Always confirm ambiguous parameters with the user before tool execution5. Format numeric parameters according to each tool's requirements
Prepare for tool selection errors with recovery strategies.
Example recovery instructions:
Copy
Ask AI
If a tool returns an error or no results:1. First, check if parameters were correctly formatted and try again with adjustments2. If parameters are correct but no results found, try an alternative tool if available3. For customer lookups that fail, try searching by alternate identifiers4. If all tool attempts fail, explain to the user what was tried and ask for additional information5. Never make up information if tools cannot retrieve it
These strategies ensure resilience when initial tool selections don’t succeed.
Here’s a complete example of custom implementation of LLM-based tool selection:
Copy
Ask AI
slug: llm-tool-selectionname: "LLM-Based Tool Selection"description: "Uses the LLM to select appropriate tools based on user input"do: - AgentAnalyzer.chat-completion: prompt: | Select the most appropriate tool for this user request: User request: "{{input.text}}" Available tools: 1. WeatherTool - Gets current weather information for a location 2. CalendarTool - Manages calendar events and appointments 3. StockTool - Retrieves current stock prices and market information Respond with a JSON object containing: - selectedTool: name of the selected tool - reasoning: why this tool was selected - parameters: parameters to pass to the tool output: toolSelection - conditions: '{{toolSelection.selectedTool}} == "WeatherTool"': - WeatherTool.execute: location: "{{toolSelection.parameters.location}}" output: result '{{toolSelection.selectedTool}} == "CalendarTool"': - CalendarTool.execute: action: "{{toolSelection.parameters.action}}" date: "{{toolSelection.parameters.date}}" output: result '{{toolSelection.selectedTool}} == "StockTool"': - StockTool.execute: symbol: "{{toolSelection.parameters.symbol}}" output: result default: - set: name: result value: error: "No appropriate tool selected"output: "{{result}}"when: events: - user-request
Make tool selection reasoning visible to users when appropriate.
Recommendations:
Explain which tool was selected and why
Indicate when the agent is using external systems
Show progress during tool execution
Provide context for tool results
Example agent response:
Copy
Ask AI
I'll check our product inventory system to find that information for you.[Checking inventory...]Based on our inventory system, the XPS 15 laptop is currently in stock at 3 locations:- Downtown Store: 5 units- Westside Mall: 2 units- Online Warehouse: 15 units
Implement Progressive Tool Access
Start with limited tool access and expand based on need and performance.
Recommendations:
Begin with core, high-reliability tools
Add tools incrementally as selection logic matures
Implement usage limits for new or sensitive tools
Monitor performance before expanding capabilities
Implementation approach:
Copy
Ask AI
# Tool tiers with progressive accesstoolTiers: tier1: # Core tools available to all agents - ProductSearch - FAQlookup tier2: # Added after baseline performance validation - CustomerLookup - OrderStatus tier3: # Limited to specific use cases with approval - PaymentProcessing - AccountUpdate
Continuous Improvement
Use actual usage data to refine selection logic over time.
Recommendations:
Implement usage logging for selection decisions
Analyze patterns in successful and unsuccessful selections
Identify common error cases and add specific handling
For AI Knowledge agents, implement effective tool selection through these configurations:
1
Configure Tool Descriptions
Create detailed, LLM-friendly descriptions for each tool.
Effective descriptions include:
Clear purpose and capabilities
When to use and when not to use
Example scenarios
Required parameter information
Expected result formats
2
Set Tool Selection Instructions
Add specific guidance for tool selection in agent instructions.
Example instructions:
Copy
Ask AI
Available Tools:1. Web Browsing: Use when the user needs current information not in our knowledge base. Only use for factual information that would be publicly available.2. Customer Database: Use when the user asks about specific customer records. Requires a customer ID or email address. Never use for general inquiries.3. Product Catalog: Use when the user needs detailed product specifications or inventory information. Prefer this over Web Browsing for any product-related queries.When choosing tools:- First check if the information is available in our knowledge base- Only use Web Browsing for current events or information that changes frequently- Always use the most specific tool for the task- If multiple tools could work, explain your choice to the user
3
Add Usage Examples
Provide concrete examples of correct tool selection.
Example:
Copy
Ask AI
Example 1:User: "What's the current price of the XPS 15 laptop?"Appropriate tool: Product CatalogReasoning: This is a specific product query about current pricing, which is exactly what the Product Catalog tool is designed for.Example 2:User: "Did we release any new products this month?"Appropriate tool: Knowledge Base first, then Product CatalogReasoning: Check our knowledge base first for recent product announcements. If not found or if the information might be outdated, use the Product Catalog to check for products with recent release dates.Example 3:User: "What were the key announcements at yesterday's tech conference?"Appropriate tool: Web BrowsingReasoning: This is about a recent external event, so the information is likely not in our knowledge base and requires current web information.
4
Test and Refine
Evaluate tool selection performance with real-world scenarios.