Search
Close this search box.
Einstein Copilot in Action: How to Enhance Salesforce with Generative AI

Einstein Copilot in Action: How to Enhance Salesforce with Generative AI

In February 2024, Salesforce introduced Einstein Copilot, a powerful Generative AI tool designed to transform the way you work in Salesforce, saving you valuable time and boosting your productivity. But how do you harness this potential? In this post, I’ll break down how Einstein Copilot works, and guide you through the process of creating your own custom Copilot actions. These actions tailor Copilot to your organization’s unique needs, making it a true efficiency game-changer. Let’s dive in and transform the way you work with Salesforce.

What is Einstein Copilot?

Salesforce Einstein Copilot is a trusted conversational AI assistant embedded within the Salesforce ecosystem. Think of it as an intelligent assistant that understands the ins and outs of your organization’s Salesforce data.

Out-of-the-box, Einstein Copilot offers a variety of standard actions for tasks, like finding and summarizing a specific record, drafting sales emails, and even answering basic data inquiries (e.g., “How many opportunities were created in the last 2 days?” or “What are my top deals right now?”). These pre-built actions allow users to quickly experience the benefits of generative AI within Salesforce.

The true power of Einstein Copilot lies in its customizability. Using Copilot Builder, you can design custom actions tailored to your unique business processes, enhancing the Salesforce experience for your users. In essence, Einstein Copilot is a framework that empowers users to leverage natural language queries to extract trusted, data-driven responses from their Salesforce environment, ultimately boosting productivity and efficiency. 

How it works

Einstein Copilot leverages Large Language Models (LLMs) and three core concepts to deliver its powerful, trustworthy assistance: grounding, actions, and dynamic plans. Let’s break down each of these concepts:  

Grounding. Grounding is the fundamental principle that allows Einstein Copilot and other Salesforce AI tools like Prompt Builder to provide insightful responses that are tailored to your specific business. Grounding means that these tools are able to use the Salesforce data from your organization, and generate outputs that are directly relevant to your business context and use cases.

Actions. Actions are the building blocks of Einstein Copilot’s functionality. These are pre-defined sets of instructions that automate various tasks for your Salesforce users. Key points to understand about actions are:

  • Standard actions: These are provided out-of-the-box to help users accomplish common tasks like searching, summarizing records, drafting emails, and accessing knowledge articles.
  • Custom actions: These are actions that users can create to allow for more flexibility, and the ability to create actions that are specific to your industry, processes, and data. These can be created from flows, apex code, or prompt templates.
  • Instructions, inputs & outputs: Each action must be carefully defined especially when creating a custom action. Instructions dictate when an action should be used, inputs specify the required information like a record ID, and outputs determine the format of the result that Copilot should return. These instructions and definitions assist with Copilot’s decision-making.

Dynamic plans. When a user asks a question, Copilot begins a multi-step process to determine the user’s underlying intent. Copilot is able to do this by leveraging LLMs to analyze the user’s natural language query and the descriptions from its library of available actions. Through this analysis, Copilot is able to dynamically generate a plan that outlines the ideal sequence of actions required to provide the most relevant and accurate response, taking into account the specific context of the user’s question.  

Copilot in action: A guided example

 Let’s illustrate the inner workings of Einstein Copilot with a practical scenario. Imagine you are a sales representative preparing for a client call. You need a quick, comprehensive overview of the “Acme Partners” account. Einstein Copilot already has a standard action called “Summarize Record” that can help. So, let’s open Copilot Builder to understand how this works.

Step 1: Issue a query
Open Copilot Builder and input the following natural language query: “Tell me about the Acme Partners Account.”

Step 2: Behind the scenes analysis
Copilot Builder is a framework that provides transparency into how Einstein Copilot operates. It reveals the actions available to the Copilot and the dynamic plan that Copilot creates to address your specific request. In this case:

  • Record identification: Copilot first finds the Salesforce record ID corresponding to the “Acme Partners” account that you asked about.
  • Action selection: Next, Copilot understands your desire for detailed account information and determines that the “Summarize Record” action is the most appropriate tool to fulfill this request. 

Step 3: Response
Copilot executes the dynamic plan and generates this response: 

Key takeaways: Einstein Copilot doesn’t provide a static answer, but instead uses intelligent analysis to understand your intent, identify relevant data, select optimal actions, and deliver a response that is tailored to the context of your specific request. 

Copilot in action: Creating a custom action

While standard actions like “Summarize Record” offer immediate value, they might not always align perfectly with your business’s specific workflows. Let’s consider the previous example, the generated account summary covered core account details, related cases, and related opportunities. However, what if you frequently need a comprehensive view of recent activity as well, including tasks and events, for a given account? This scenario presents an opportunity to create a custom Copilot action.

Step 1: Define the custom action’s purpose
We aim to provide users with a concise overview of upcoming and recently completed tasks and events associated with a specific account.

Step 2: Design data-gathering flows
Three template-triggered flows are needed to retrieve the desired information:
 
Flow 1: Upcoming tasks
Flow 2: Recently completed tasks
Flow 3: Recent events

These three flows follow a similar logic: 

  1. Retrieve relevant tasks/events linked to the account ID provided as input.
  2. Loop through the tasks/events and extract key data points (e.g., subject, description, due date).
  3. Structure the output data for use in the prompt template. 

Step 3: Create a prompt template
In Prompt Builder, design a template that integrates the task and event data retrieved by your flows into a summary about an account’s activities to return to the user. This involves:

  • LLM selection. Choose the most suitable LLM for your needs.
  • Data grounding. Ground your prompt in your Salesforce data by referencing the flows that were created in Step 2.
  • Iterative testing. Test the prompt thoroughly with various account inputs to make sure it generates the desired responses. Adjust the prompt as needed for optimal results.

Step 4: Build the custom Copilot action

  1. Open Einstein Copilot actions and select the option to create a new action.
  2. Action type: Select the type, “Prompt Template,” and choose the newly created template from Step 3.
  3. Add instructions: Provide clear and concise instructions to guide Copilot in determining when to utilize this action. Iterative testing and refinement of these instructions may be necessary. 

Step 5: Add your action to the Copilot and test

  1. Add action: Deactivate the Copilot, add the action to your library, then after testing, reactivate the Copilot.
  2. Rigorous testing: Employ a wide range of “utterances” (user queries) to evaluate the action’s triggering behavior, and ensure the action is executing when desired. Refine the action instructions as necessary for optimal accuracy. 

Key takeaways:
Custom actions are the key to unlocking the full potential of Einstein Copilot. By tailoring Copilot’s actions to your organization’s unique data and workflows you can create a streamlined user experience that boosts efficiency and productivity.

Remember that developing effective custom actions often involves an iterative process. Rigorous testing of prompts, flows, and action instructions is essential. Analyze results, refine your approach, and retest to ensure your custom actions consistently deliver the valuable insights your users need. 

See Einstein Copilot in action

We brought together two generative AI experts from Salesforce and Atrium for a live demo of Copilot — Avi Shah, Director of Product Management for Salesforce AI, and Paul Harmon, Atrium’s Head of Data Science. Check out the webinar to get the inside scoop on all things Copilot.