Parent Type
The fullName is the agent's API name, for example, MyAgent. Each version of the agent is an AiAgentDefinitionVersion component named with a version number, for example MyAgent#1 or MyAgent#2.
File Suffix and Directory Location
AiAgentDefinition components have the suffix .aiAgentDefinition and are stored in the aiAgents folder. For example, aiAgents/MyAgent.aiAgentDefinition.
Version
AiAgentDefinition components are available in API version 68.0 and later.
Special Access Rules
AiAgentDefinition is available only if Agents is enabled in your org.
Fields
| Field Name | Description |
|---|---|
| agentDescription |
|
| agentDSLEnabled |
|
| agentType |
|
| botUser |
|
| contextVariables |
|
| logPrivateConversationData |
|
| richContentEnabled |
|
| type |
|
ConversationContextVariable
Represents the context variable that stores data available to the agent during a conversation.
| Field Name | Description |
|---|---|
| contextVariableMappings |
|
| dataType |
|
| description |
|
| developerName |
|
| includeInPrompt |
|
| label |
|
| SObjectType |
|
ConversationContextVariableMapping
Represents the variable that associates the context variable with a source field.
| Field Name | Description |
|---|---|
| fieldName |
|
| messageType |
|
| SObjectType |
|
Declarative Metadata Sample Definition
Here's an example of an AiAgentDefinition component.
<?xml version="1.0" encoding="UTF-8"?>
<AiAgentDefinition xmlns="http://soap.sforce.com/2006/04/metadata">
<agentDSLEnabled>true</agentDSLEnabled>
<agentDescription>Answers common customer questions and escalates complex issues.</agentDescription>
<agentType>EinsteinServiceAgent</agentType>
<botUser>myagent.user@example.com</botUser>
<contextVariables>
<contextVariableMappings>
<SObjectType>MessagingSession</SObjectType>
<fieldName>MessagingSession.ChannelType</fieldName>
<messageType>EmbeddedMessaging</messageType>
</contextVariableMappings>
<dataType>Text</dataType>
<description>The channel the customer is messaging from.</description>
<developerName>ChannelType</developerName>
<includeInPrompt>false</includeInPrompt>
<label>Channel Type</label>
</contextVariables>
<logPrivateConversationData>false</logPrivateConversationData>
<richContentEnabled>true</richContentEnabled>
<type>ExternalCopilot</type>
</AiAgentDefinition>
Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.