Loading
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Ingredients of a Prompt Template

          Ingredients of a Prompt Template

          When you start to build your own prompt templates, it can feel intimidating. Like all new skills, designing great prompts requires some experimentation and practice. To guide your prompt design, it’s helpful to start with the key components of every effective prompt template. Like a good recipe, these “ingredients” work together to help large language models (LLMs) generate accurate and consistent responses.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, and Unlimited Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations

          All prompts are different. You don’t need every ingredient in every prompt template.

          Participants

          Describe who’s sending and receiving the model’s response. You can use merge fields that reference record fields, flows, Apex and more when you describe the participants.

          Example
          Example
          You’re a <sender.JobTitle_Merge_Field> and your
          name is <sender.Name_Merge_Field> and you’re from an
          organization called <sender.Company_Merge_Field>. Your
          prospect is <recipient.Name_Merge_Field> from the company
          <recipient.Company_Merge_Field>.

          Setting

          Give the model contextual information, such as the communication channel or type of content that the response is for. Your prompt template type determines your setting. For example, if you choose the Field Generation template type, your setting is a record field.

          Goal

          Describe what you hope to achieve with the model’s response. Make sure that you consider your users’ context, preferences, and past behavior. You can add details to your goals by using merge fields.

          Example
          Example
          Encourage your contact to attend the <event.Subject_Merge_Field> event in <event.Location_Merge_Field>.

          Relationships

          Describe the relationship between the participants involved. Also mention how the model’s response relates to the participants.

          Example
          Example
          You are a customer service agent interacting with a customer over chat for the first time.

          Data

          Give the model relevant CRM data to work with using merge fields.

          Instructions

          Tell the LLM what type of content you want and what it must include. Surround instructions in triple quote boundaries, which helps the LLM to distinguish between prompt context and instructions.

          Example
          Example
          Instructions:
          """
          Generate an introduction email to your prospect. Indirectly encourage the prospect to respond to your email by showing that you are willing to answer any questions they may have.
          """
          

          Guidelines

          To reduce the possibility of hallucinations, give the model guidelines that it must follow.

          Example
          Example
          When I ask you to generate an introduction email, you must strictly follow my instructions below.

          Language

          Tell the model which language to generate the response in. For a list of supported languages, see Supported Languages in Prompt Template Responses.

          Style and Tone

          Give the model style and tone guidelines to follow.

          Example
          Example
          Use clear, concise, and straightforward language using the active voice and strictly avoiding the use of filler words and phrases and redundant language.

          Questions for Effective Prompts

          To contextualize these ingredients, use these questions to identify the details that your prompt template requires to be effective.

          • What’s the goal of the prompt template?—By declaring the goal of the response first, you can better answer all the subsequent questions.
          • Who is involved?—Describe the participants who send or receive the response, the relationship between the participants, and the relationship between the participants and the response.
          • What’s the context of the prompt template and the response?—Define a setting for the model response, the CRM data to ground the prompt in, and add a command that tells the model what to generate.
          • What guardrails does this prompt template need to succeed?—You can add more information, such as instructions for the response’s style and tone.

          An effective prompt template answers these questions so that the LLM can generate a personalized response every time. A great prompt template is also scalable so that you can reuse it across different use cases. With Prompt Builder, it’s easy to design prompt templates that achieve these goals.

           
          Loading
          Salesforce Help | Article