Appearance
Exercise 2: Ground a Prompt with Einstein Search
In this exercise, you'll create a Flex template to enable users to ask questions about Coral Cloud Resorts' policies. You'll use Einstein Search to ground the prompt with unstructured data using retrieval augmented generation (RAG).
Step 1: Create the Flex template
In Setup, search for Prompt Builder, and select Prompt Builder.
Click the New Prompt Template button.
Configure the template as follows:
Parameter Value Prompt Template Type Flex Prompt Template Name Policy Questions API Name Keep default Template Description Answer customer questions about Coral Cloud Resorts' policies. Resource Name Question API Name myQuestiion Object Free Text Use the screenshot below to make sure that you entered the values correctly.
Click Next.
Paste the following text in the Prompt Template Workspace:
txtYour task is to provide clear and helpful answers to customer inquiries about Coral Cloud Resorts' policies. Here's the customer's question: QUESTION_QUERY Please use the following information to help you answer the question: SEARCH_RESULTS Remember to tailor your response to the specific question, focusing on the relevant details. Your tone should be friendly and informative, as if you were speaking directly to the customer.
Replace the placeholders with the corresponding merge fields (click the Resource search box to access merge fields):
Placeholder Merge field QUESTION_QUERY Free Text > Question SEARCH_RESULTS Einstein Search > Resort Information > Default Resort Information Retriever In the Configuration sidebar, configure the Default Resort Information Retriever as follows:
Field Value Search Text Free Text > Question Output Fields Chunk Number of Results 6 Use the screenshot below to make sure that you entered the values correctly.
Step 2: Try it out
In the Preview panel, click Test Inputs.
Enter the following text into the
Question
field:txtWhat is the resort's cancellation policy?
Click Preview.
- In the Resolution panel, examine the prompt that was generated. The JSON structure represents the weighted responses from Einstein Search.
- In the Response panel, examine the response the LLM generated.
Enter another prompt in the
Input
field:txtWhat wedding venue options are available at Coral Cloud Resorts?
Click Preview.
Click Activate.
This prompt template can now be used from Apex, Flow, or within an agent.