Skip to main content

Agentforce Setup

Agentforce is the Salesforce-native channel of the aprity Org Expert. Once set up, users ask questions about your org from the Agentforce panel in Lightning Experience and receive answers grounded in your latest aprity scan, with their sources.

Overview​

The aprity managed package ships two Apex invocable actions:

  • aprity - Answer Documentation Question -- returns a grounded answer, with citations, from the aprity backend.
  • aprity - Record Help Feedback -- records a thumbs up / thumbs down vote on a previous answer.

The package does not ship an agent, subagent, plugin or planner metadata, so it installs on any org whatever its Agentforce licensing. You create your own agent and attach the aprity actions to it, following the five steps below. The same guide, with live prerequisite checks, is available in the aprity app: open the aprity tab, then Agentforce in the Assist section of the side menu.

Terminology

Salesforce now calls agent Topics "Subagents". Older Salesforce documentation and some org screens may still say "Topic": it is the same concept.

Prerequisites​

The Agentforce page of the aprity app checks the first two automatically (use Refresh to re-run the checks):

  1. Agentforce feature enabled on your aprity plan. The Agentforce channel is available on the Intelligence and Trial plans. The Agentforce menu entry is hidden when your plan does not include it.
  2. At least one completed aprity scan. The agent answers from your latest completed scan. Without one, it has nothing to answer from.
  3. The aprity managed package installed -- it contains the two actions and the aprity Agent User permission set.
  4. Agentforce enabled in your Salesforce org, so that you can create and activate agents in Agentforce Studio.

Step 1: Create the agent​

  1. From the App Launcher, open Agentforce Studio, then go to Build > Agents.

  2. Click New Agent.

  3. In the Or, start with a template section, locate Agentforce Employee Agent (internal assistant), click Details, then Select Template.

  4. Set the Agent Name to aprity -- the Developer Name fills in automatically -- then click Let's Go.

  5. In Agentforce Builder, open the agent Settings and set the description:

    AI assistant for Salesforce. Answers questions about the org's objects, validation rules, triggers, flows and business processes, and helps end users find how to accomplish their tasks with what is configured in the org — using documentation generated by aprity.

  6. The template ships with default subagents and actions: remove the ones you don't need.

note

The agent must be deactivated before you can change anything in Agentforce Builder.

Step 2: Add the documentation subagent​

  1. In Agentforce Builder, click New Subagent.

  2. Set the subagent label: Documentation aprity.

  3. Set the Classification Description (when to use this subagent):

    The user asks a question about their Salesforce org — objects, fields, validation rules, triggers, flows, business processes, dependencies, technical documentation — OR asks how to accomplish a task in the org (where to record something, how to create it, which fields to fill).

  4. Set the Scope:

    Answer questions about the Salesforce org configuration and functionality, and about what the org provides for the user's business tasks, using documentation indexed by aprity. Do not fabricate information.

  5. Add these Instructions:

    • Use "aprity - Answer Documentation Question" to get a grounded answer from the aprity backend
    • "How do I…" user-task questions go to the same action: the answer explains what the org provides for the need. Never answer them from general Salesforce knowledge
    • When the user explicitly says the answer was helpful or unhelpful, call "aprity - Record Help Feedback" with the returned queryId and the vote — exactly "up" or "down" in lowercase. Never prompt the user for feedback
    • Base answers ONLY on sources returned. Never fabricate information
    • Cite your sources (citations returned by the action)
    • If no source answers the question, clearly state it
    • Reply in the user's language
  6. Click Save.

Step 3: Add the actions to the subagent​

In the Documentation aprity subagent, click New Action twice to add the two aprity actions. Each action has a two-page wizard.

Action 1 -- aprity - Answer Documentation Question (required)​

Page 1: Connect an existing action

FieldValue
Reference Action TypeApex
Reference Action CategoryInvocable Method
Reference Actionaprity - Answer Documentation Question

Agent Action Label and API Name are filled in automatically. Click Next.

Page 2: Configure

FieldValue
Agent Action DescriptionReturns a grounded answer from aprity documentation
Show loading textChecked
Loading TextQuerying aprity documentation...

Inputs:

InputDescriptionRequire inputCollect from user
QuestionThe user's question about Salesforce org configurationYesYes
LanguageResponse language code (e.g. fr, en). Defaults to user's languageNoNo
Record IdOptional record Id for record-context questionsNoNo
Object API NameOptional SObject API name matching Record IdNoNo
Scan IdSpecific scan ID to query. Leave empty to use the latest scanNoNo
Max CitationsMaximum number of citations to include (default: 3)NoNo

Outputs:

OutputDescriptionShow in conversation
Answer TextThe generated answer to display to the userYes
Query IdUnique id for this Q&A pair — pass it to aprity - Record Help Feedback to record a voteNo
Answer ModeHow the answer was produced: GROUNDED, PARTIAL, or NO_ANSWERNo
Has AnswerTrue if a valid answer was returnedNo
ConfidenceConfidence score between 0 and 1No
Used ObjectsSalesforce objects referenced in the answer (one per line)No
Used Scan IdThe scan ID used to generate the answerNo
Citations JsonJSON array of source citations with titles and excerptsNo
Follow Up QuestionsSuggested follow-up questions (one per line)Yes

Click Finish.

Page 1: Connect an existing action

FieldValue
Reference Action TypeApex
Reference Action CategoryInvocable Method
Reference Actionaprity - Record Help Feedback

Click Next.

Page 2: Configure

FieldValue
Agent Action DescriptionRecords a thumbs up / down vote on the previous aprity answer

Inputs:

InputDescriptionRequire inputCollect from user
Query IdValue returned by aprity - Answer Documentation QuestionYesNo
VoteEither "up" or "down" (lowercase)YesNo

Outputs:

OutputDescriptionShow in conversation
SuccessTrue if the vote was recordedNo
MessageHuman-readable statusNo

Click Finish.

Optional -- Rich answer card​

The package also ships the aprityAnswer lightning type and its aprity Answer Card renderer. With it, the answer displays as a formatted card (formatted text, source badges, follow-up questions, thumbs up / down) instead of plain text. It is supported in the Agentforce panel (Lightning Experience) and Enhanced Chat v2.

  1. In Action 1's configuration, set the Rich Rendering input to the constant value True (Require input unchecked, Collect from user unchecked). The answer then keeps its Markdown formatting.
  2. On the Answer Card output, set Output Rendering to aprityAnswer and check Show in conversation. An "Unsupported Data Type" note may appear next to Map to Variable: it is harmless.
  3. Uncheck Show in conversation on Answer Text and Follow Up Questions -- the card already displays them.
  4. The card's vote buttons call aprity directly: users who vote need the aprity Agent User permission set (see Step 5).
note

Salesforce requires the Answer Card output to stay visible to the planner for rendering, which roughly doubles the answer's token footprint in Einstein credits. Citations link to your aprity portal when a portal is published for the scan.

Step 4: Activate and test​

  1. Click Activate in Agentforce Builder.
  2. Test in the Conversation Preview panel of Agentforce Builder, or open the Testing Center from Agentforce Studio for batch tests.
  3. Try these sample questions:
    • What are the validation rules on Account?
    • How does the opportunity creation process work?
    • What triggers exist on Contact?
    • Explain the Case object
  4. Verify that the answers include the citations returned by the action.

Step 5: Deploy to users​

  1. Assign the aprity Agent User permission set (included in the aprity package) to every user who will use the agent. It grants access to the two aprity actions.
  2. Grant access to the agent itself: in Setup, open Permission Sets and create a permission set (for example aprity Agent Access), or open an existing one.
  3. In that permission set, go to Apps > Agent Access, click Edit, and add the aprity agent to the Enabled Agents list.
  4. Click Manage Assignments and assign the permission set to your users.
  5. Users open the agent from the Agentforce icon in the top-right corner of Lightning Experience. Employee agents are also available in the Salesforce mobile app and in Slack.
info

The agent runs in the context of each user: answers are scoped by the user's own access, and feedback votes are recorded per user.

Keeping answers current​

The agent answers from the latest completed scan, not from the live org. Run a new analysis after significant changes to your org so that answers follow them (see Scan Frequency).

Questions asked through Agentforce count against your organization's Org Expert budget (see Org Expert).

Troubleshooting​

IssueCauseResolution
The Agentforce menu entry is missingYour plan does not include AgentforceAgentforce is available on Intelligence and Trial. See Plan Comparison.
aprity actions not listed in the action wizardManaged package not installedInstall the aprity managed package.
The agent gives empty answersNo completed scan yetRun a scan so the agent has data to answer from.
The agent does not respondAgent not activatedComplete Step 4 (Activate) in Agentforce Builder.
Users do not see the agentAgent access not grantedAdd the agent under Apps > Agent Access in a permission set assigned to them (Step 5).
Action calls fail for some usersaprity Agent User permission set missingAssign the aprity Agent User permission set to those users.
Answers are outdatedStale scanRun a new scan.

For anything else, contact contact@aprity.ai.