Sunday, 10 March 2024

Hands on with Salesforce Copilot

Image generated by DALL-E 3 based on a prompt from Bob Buzzard

Introduction

Copilot from Salesforce entered beta at the end of Feb '24, without too much of a build-up I think it's fair to say. Given how quiet the likes of Marc Benioff were on the socials, I was half-expecting it to be delayed until nearer to the Summer release. I'm very pleased that wasn't the case, but not as pleased as I was to get access to it.

Setup

Much like Prompt Builder, enabling copilot is pretty simple :

  • Go to Setup -> Einstein Generative AI -> Einstein Setup and toggle it on
  • The go to Setup -> Einstein Generative AI -> Einstein Copilot Studio (Beta) -> Einstein Copilots and toggle that on.
Copilot is then enabled in your org. It's not active though - you have to head into Builder and click the Activate button to see it in the user interface. You can play around with it pretty well inside the Builder though, so don't activate until you are happy.

Accessing


Once you've activated your copilot, you'll see a new Enstein icon up at the top right of the user interface - looks a bit Heisenberg-esque to me, which I think is awesome:


Clicking this opens copilot in a new sidebar, moving the current screen contents over to the left rather than overlaying them - it's the little things:


One key point to note - copilot doesn't always have the context you are working in - the screengrab above is copilot opening while I'm viewing an opportunity. It's tempting to think that I can just refer to 'this opportunity' and it will pick up the details from my current context/URL, but that doesn't happen - instead it says 'Sure, which opportunity is this?"


As an aside, it also really wants me to use the name of the record - if I try the Id, it tells me that nothing was found in the query. This might seem limited, but I think it'sactually working exactly as intended. There's an action in this copilot configuration that retrieves a record and it requires the record name. If I want to use Ids instead, I need a different action.

Back to context though, if I click the Summarize Opportunity button, it does know about the opportunity and gives me the details : 


Making a Request


As always with generative AI, the quality of the response has a pretty direct correlation with the quality of the prompt. Just vaguely asking for help doesn't go well:


I then tried a request that I thought had enough detail, but in hindsight lacked a little clarity:


Third time's the charm though, and now I have a few accounts to focus on:



Extending


The standard functionality is all well and good, but I'm always interested in how I can extend and customise. There was a bit of trial and error involved, as the docs aren't perfect yet, but remember this is a beta feature.

I was trying to think of something that wasn't in place already, and after a short while it struck me - there's just not enough poetry in enterprise software nowadays, so an action to write a haiku about an account was the obvious, if not the only, choice.

This will be a Prompt Template action, so the first job is to define the prompt:

You are a world renowned haiku writer, who has a side gig as a CRM administrator.
Write a haiku based for the account {!$Input:Account.Name} which operates in the {!$Input:Account.Industry} industry. 
The haiku should not include any PII.

Then the copilot action: 

The important parts of the action are :

  • Copilot Action Instructions - this is used by the AI to determine whether an action is appropriate for a plan. The more detailed the better, although in this case there probably won't be multiple actions competing for the job of writing the haiku.
  • Require user confirmation - tick this if any data is going to be changed. 
  • Account Instructions - these are the instructions for the input named Account that I've specified in the prompt. I've identified which fields I'm interested in, the type, and that it's required. I'm not asking the user to enter any data and there's no PII to mask as I'm just using the Name and Industry fields, which is public information
  • Prompt Response Instructions - here I've defined what type of response, but most importantly ticked Show in conversation. Without this nothing will be returned to the user.
Once this action is added to my copilot, I can add writing a haiku to a request and get the user experience I've been craving:


More Information


2 comments:

  1. Bob, I don't see this in my org (Enterprise Edition). Is this not included in my edition?

    ReplyDelete
    Replies
    1. It isn't included in Enterprise Edition unless you buy a separate license - see : https://help.salesforce.com/s/articleView?id=sf.copilot_overview.htm&type=5

      Delete