Skip to main content
Register now for TDX! Join the must-attend event to experience what’s next and learn how to build it.

Build a Grounded Service Agent

Learning Objectives

After completing this unit, you’ll be able to:

  • Create an agent action that contains the prompt template.
  • Build an agent that answers questions using Case knowledge.
  • Test your agent with questions.
Note

Beginning in April 2026, agent topics are now called subagents. There are no changes to functionality. During this transition, you may see a mix of the new and previous terms in our documentation and UI.

Subagents and Actions

In this unit, you create a service agent that uses the prompt template to respond to customer inquiries. You create subagents and actions for the agent. Let’s use a home renovator as a metaphor to explore these concepts.

Home renovators have a variety of jobs they can do, and different tasks for each job. For agents, the jobs are called subagents and the tasks are called actions.

Jobs (Subagents)

Tasks (Actions)

Home Renovator

Design kitchen layout

  • Take measurements of kitchen
  • Draw a blueprint of design
  • Review and revise with customer

Agent

Answer questions with Case information

Answer Questions with Case Data agent tool

Create an Agent Action

First, create an agent action containing the Answer Questions with Case Data prompt template. You add this action to an agent later so the agent can answer questions about toaster ovens using Case data.

  1. From Setup, in the Quick Find box, search for and select Agentforce Assets.
  2. Click the Actions tab.
  3. Click New Agent Action.
  4. For the Reference Action Type, select Prompt Template.
  5. For the Reference Action, select the Answer Questions with Case Data prompt template. If you don’t see your prompt template, make sure it’s active.
  6. Make sure the Agent Action Label is Answer Questions With Case Data and the API Name is Answer_Questions_with_Case_Data, then click Next.
  7. For Agent Action Description, enter: Answer questions that customers have about product issues. Use the provided customer cases, where the description and subject tell you what is going wrong, or how the customer is struggling. For example: “What are some common issues with the toaster oven?”These instructions describe what the action does and when to use it in a conversation.
  8. Ensure that Show loading text for this action is enabled.
  9. For Loading Text, enter Getting an answer…This will be displayed in the chat window when your agent is formulating its response.
  10. Under Inputs, fill in the required fields.
  • For RetrieverIdOrName Description, enter: Use the retriever that is hard coded in the prompt template.
  • For Query Description, enter: A string created by generative AI to be used in the Case search.
    • Under Query, enable Collect data from user.
  • For Citation Mode Description, delete the default text and enter: Do not generate citations.
  • Leave all other defaults in Inputs.
  1. Under Outputs, for the Prompt Response, enable Show in conversation.
Note

We can’t check input and output settings in the challenge, so be sure to follow every step carefully; pay particular attention to steps 10 and 11.

  1. Leave all other defaults and click Finish.

Create a Service Agent

Next, create a service agent that contains the Answer Questions with Case Data tool.

  1. From the App Launcher, search for and select Agentforce Studio.
  2. Click New Agent.
  3. In the “What do you want your agent to do?” text box, enter: This AI agent works for a company that sells toaster ovens. The agent's job is to answer questions that customers have about product issues. Use the provided customer cases, where the description and subject tell you what is going wrong, or how the customer is struggling. For example: “What are some common issues with the toaster oven?”
  4. Click the send icon.
  5. For the Agent Name, enter Toaster Service Agent then tab to the next field, Developer Name.
  6. Ensure that the Developer Name is Toaster_Service_Agent.
  7. Leave New User selected. Click Let’s Go.

Give the new user permissions.

  1. In a different browser tab, click the gear icon and launch Setup.
  2. In the Quick Find box, search for and select Users.
  3. Click EinsteinServiceAgent User.
  4. Click Permission Set Assignments.
  5. Click Edit Assignments.
  6. Click Agentforce Service Agent Secure Base, then click Add.
  7. Click Save.

Navigate back to the browser tab with Agentforce Studio.

Note

Remember that "agent topics" have been renamed to "subagents." However, not all orgs have made this update. If you still see the term "topics" in your org, just know those terms are interchangeable during this transition period.

  1. Click Skip Ahead.
  2. In the Explorer tab, hover over Subagents and click the + button.
  3. Click New Subagent.
  4. Enter Answer Questions with Case information as the Subagent Name and Description.
  5. Click Create and Open.
  6. In the Instructions, enter: Answer questions about toaster ovens.
  7. Under Actions Available for Reasoning, click Select Action.
  8. Click Add from Asset Library, then click Select on Answer Questions with Case Data. There may be actions with similar names, so make sure you select the right action.
  9. Click Add to Agent.
  10. Click Preview to open the chat window with your new agent.

Test Your Agent

In the chat window, ask a question to test your agent. Here are some questions you can ask.

  • What are some common product issues with toaster ovens?
  • Why does my toaster oven not start?
  • Why does my toast burn in the toaster?

A chat showing the agent’s grounded and relevant response to the question, “What are some common product issues with toaster ovens?”

Notice how the answer is not a generic answer about all toaster ovens. Instead, it reflects information from Case Subject and Description fields. It’s easy to see how the LLM response is grounded in data you ingested. You can see the agent’s reasoning process in the Interaction Details window.

You can also try questions your agent can’t answer.

  • How many toasters have you sold in the last year?
  • Why did the chicken come before the egg?

Your agent should redirect the customer and should not make up a hallucinated answer.

Activate Your Agent

Once you’re done chatting with your agent, commit and activate it so it can be deployed to channels.

  1. Click Commit Version, then click Commit Version.
  2. Click Activate, then click Activate.

Now your agent’s ready to be used by customers. Learn more in Agentforce Deployment: Quick Look.

Next, learn about RAG best practices.

Resources

Salesforce 도움말에서 Trailhead 피드백을 공유하세요.

Trailhead에 관한 여러분의 의견에 귀 기울이겠습니다. 이제 Salesforce 도움말 사이트에서 언제든지 새로운 피드백 양식을 작성할 수 있습니다.

자세히 알아보기 의견 공유하기