Configure a Component for Use in Setup with Agentforce
Add an AI-related description to your component to make it accessible to Agentforce in Setup. AI component descriptions are used only in orgs that have Setup with Agentforce enabled. For more information, see Setup with Agentforce.
When Setup with Agentforce is enabled in an org, the Setup agent can analyze and recommend custom components when creating a new Lightning page from a user utterance. For Agentforce to successfully analyze whether your custom component fits the requirements outlined in the user’s utterance, the component must contain an AI-related description of what it does as well as descriptions of its properties.
Add an AI Description to a Lightning Web Component
In the component’s js-meta.xml file, add the ai tag set at the top level. Specify the ai tag only once. The ai tag at the top level contains one description tag, and can contain multiple property tags. The description tag contains the AI-related component description.
Each property tag in the ai tag set contains the AI-related description for a single component property, and supports only the name and aiDescription attributes.
Define the component properties using the property tag in the targetConfig tag set just like usual.
js-meta.xml
1<?xml version="1.0" encoding="UTF-8"?>2<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">3 <apiVersion>64.0</apiVersion>4 <isExposed>true</isExposed>5 <ai>6 <description>AI component description. Example: The component enables users to add and style text content for dashboards, supporting features such as hyperlinks, bullet points, and text alignment. Ideal for adding formatted text sections such as instructions</description>7 <property name="prop1" aiDescription="AI description for prop1"/>8 <property name="prop2" aiDescription="AI description for prop2"/>9 </ai>10 <targets>11 <target>lightning__AppPage</target>12 <target>lightning__RecordPage</target>13 </targets>14 <targetConfigs>15 <targetConfig targets="lightning__AppPage">16 <property type="String" name="prop1" description="property description"/>17 <property type="String" name="prop2" description="property description"/>1819 </targetConfig>20 <targetConfig targets="lightning__RecordPage">21 <property type="String" name="prop1" description="property description"/>22 <property type="String" name="prop2" description="property description"/>23 <objects>24 <object>Account</object>25 <object>CustomObject__c</object>26 </objects>27 <supportedFormFactors>28 <supportedFormFactor type="Large" />29 <supportedFormFactor type="Small" />30 </supportedFormFactors>3132 </targetConfig>33 </targetConfigs>34</LightningComponentBundle>