Important: The functionality described on this page is only available to early adopters.
Agent tools are a capability that provides your Large Language Model (LLM) additional information from your Vault to help it execute an agent action. When executed, agent tools operate as extensions of agent actions, allowing the action to interact with other areas of your Vault to provide relevant information to Veeva AI Chat users.
An agent’s capabilities are dependent on the configured Tool Type. For example, VernBio has created a custom Document Quality Check agent action that checks document spelling and grammar. They would like the agent action to also check if company terms and acronyms used in documents exist in VernBio’s glossary. To accomplish this behavior, they created an agent tool using the VQL Query Tool Type, which allows the agent action to query the VernBio Glossary object for accepted terms and phrases. Now, when a user clicks Document Quality Check, it will not only provide spelling and grammar checks, but also check if company terms used in the document are available in the glossary.
When assigning an agent tool to an agent action, you may include details on when and how to execute the tool in the agent action’s instructions. In addition, you can configure the agent action to always use an assigned agent tool, or let your LLM decide when to employ the agent action. The Description of the agent tool and Input parameters can also help your LLM to understand how to use the agent tool without explicit mention in the instructions.
Note: Ensure that the Description of the agent tool and Input parameters are clear and concise, as your LLM uses this information to understand the purpose of and how to execute the agent tool. If the Description is easy to understand, your LLM can invoke the agent tool without explicit direction in the agent action instructions.
How to Configure an Agent Tool
To configure an agent tool:
- Navigate to Admin > Configuration > Tools.
- Click Create.
- Select VQL Query as the Tool Type.
- Enter a Label. The API Name field value is populated based on the Label value.
- Set the Status to Active or Inactive. By default, new agent tools are created in the Active status.
- Enter a Description.
- Under Input, click Add. This option is not available until you select the Tool Type.
- Enter a Property. This value represents the attribute your LLM uses to execute the Agent Tool. For example, if you enter
SELECT id, name__v FROM documents WHERE TONAME(type__v) = 'promotional_piece__c'in the Query field, you would enterpromotional_piece__cas the Property. - Select String, Integer, or Number from the Type drop-down.
- Enter a Description of the Input parameter.
- Click Add.
- Enter your VQL statement in the Query field.
- Click Save.
The agent tool is now created and you can assign it to an agent action.
Best Practices
Use the following best practices when configuring agent tools:
- Reference Input parameters in the Query field using the
${parameter_name}format. Parameter names are case sensitive and must match the Property. For example, if you enterSELECT id, name__v FROM documents WHERE TONAME(type__v) = ${promotional_piece__c}in the Query field, you must enter${promotional_piece__c}as the Property. - Always include an
ORDER BYclause when using a query that returns multiple records to ensure the LLM receives the most relevant data first within the 1,000 record limit. - Your LLM uses the agent tool Description to interpret and execute the agent tool within agent actions. Ensure the Description is accurate and easy to understand to help the LLM when executing the agent tool.
- Use the
ASclause to provide meaningful Name values to fields and help the LLM accurately interpret the data. For example:status__v AS current_approval_status. - Use the developer portal to learn more about VQL syntax.
Limits
The following limits apply to configuring agent tools:
- The VQL Query agent tool does not support
LIMIT,PAGESIZE, orPAGEOFFSETVQL query clauses. - The VQL Query agent tool only supports object and document query targets.
- You can add up to ten Input parameters per agent tool.
- VQL Query agent tools can return a maximum of 1,000 records. If the query returns over 1,000 records, only the first 1,000 are sent to the LLM. Subquery limits are determined by your Vault’s
MAXROWSconfiguration. - The characters “ ‘ () and \ are escaped if used in Property values. The % and * characters are not escaped when used in
LIKEandFINDoperators. - The Property field does not support lists and enumerations.
- When using multiple arguments in a
CONTAINSoperator, you must provide multiple individual tokens. For example:WHERE CONTAINS(${PROD_1}, ${PROD_2}). - You must use search phrases in
FINDVQL clauses as tokens. For example:FIND( ${search_statement} )is valid whileFIND( ${prod_1} AND ${prod_2})is invalid.