In a previous post, we discussed how to set up a connection between Data Cloud and Amazon SageMaker. In a subsequent post, we showed you how to leverage Amazon SageMaker’s machine learning capabilities with Data Cloud data. In this post, you’ll learn how to set up your artificial intelligence (AI) and machine learning models (ML) in Einstein Copilot Studio.

What is Einstein Copilot Studio?

With Einstein Copilot Studio, companies can leverage their proprietary, real-time customer data from Data Cloud to train AI models that solve specific business needs. Einstein Studio’s Bring Your Own Model (BYOM) solution enables companies to use their preferred AI model with Data Cloud. This allows them to leverage customer data that is stored on the Einstein1 Platform in Commerce Cloud, Salesforce, and Marketing Cloud in their AI models.

Einstein Copilot Studio makes it easy for data science and engineering teams to manage and deploy AI models more efficiently. Companies can easily use their company data from Salesforce Data Cloud to train AI models using industry technologies, such as Amazon SageMaker from Amazon Web Services (AWS), Google Cloud’s Vertex AI, and other AI services. Einstein Copilot Studio also allows teams to output inferences in Salesforce Data Cloud’s canonical data model.

How to set up your AI models

Set up your endpoint

The first part of setting up an AI model in Einstein Copilot Studio is to set up your endpoint. Your AI models will have an endpoint that you can call to run your data through the model. To set up your endpoint in Einstein Copilot Studio, you’ll first need to enter a name for your model, an API name, and an optional description.

Screenshot of setting up a model name, API name, and model description in Einstein Copilot Studio

Next, you’ll enter the information for the endpoint of your model, a request format, and a response format. In our example below, our model expects JSON for the request and will return JSON with the response, so we selected JSON for the request and response.

Screenshot of Inference Endpoint URL, request format, and response format in Einstein Copilot Studio

Set up authentication

At the time of writing this post, you can use either API key or JSON Web Token (JWT) for authenticating from Einstein Studio to your model’s endpoint. For API key-based authentication, you just need to enter your secret key, an endpoint name, and an endpoint API name. For JWT, you need to enter the audience, an endpoint name, and an API name.

Screenshot of setting up API-key and JWT based authentication for a model

Set up your model for predictions

On the Variables tab, you can enter in the variables that will be fed to your model for making predictions with your data. The variables must be entered in the exact same order as your model expects them, otherwise, your model’s predictions will be wrong. Setting up your variables out of order can also cause your model to error.

Screenshot of variables setup for a model in Einstein Copilot Studio

Output your inferences/predictions

The Outputs tab is where you set up the predictions from your model. Here, you can create a data model object or select an existing data model object to hold your predictions and inferences. You can also create the field(s) that will hold the prediction(s) from your model.

Tip: If you chose a response format of JSON, you will need to create your fields with the following naming convention $.predictions.fieldname. Be sure to use the same field name as designated in your model.

Screenshot of setting up an output for an AI model in Einstein Copilot Studio

View the refresh history of your model

In Einstein Copilot Studio, you have the ability to create predictions from your model on-demand by hitting the refresh button while in your model. The Refresh History tab is where you can view the previous and current running jobs to get predictions using your model. You can also view the dates and times of previous refreshes, whether they succeeded or failed, and how many rows were processed.

Screenshot of setting up outputs for an AI model in Einstein Copilot Studio

Closing words

In this post, you learned how to set up and authenticate your AI models in Einstein Copilot Studio. You also learned how to output your predictions in Data Cloud and how to refresh your models’ predictions. With this new knowledge, you now have the power to make predictions using your Data Cloud data and the Einstein 1 platform. Now it’s time for you to start bringing your own models to Einstein Copilot Studio!

Resources

About the author

Danielle Larregui is a Senior Developer Advocate at Salesforce focusing on the Data Cloud platform. She enjoys learning about cloud technologies, speaking at and attending tech conferences, and engaging with technical communities. You can follow her on X(Twitter).

Get the latest Salesforce Developer blog posts and podcast episodes via Slack or RSS.

Add to Slack Subscribe to RSS