28,79 €
Written for Salesforce architects who want quickly implementable AI solutions for their business challenges, Architecting AI Solutions on Salesforce is a shortcut to understanding Salesforce Einstein’s full capabilities – and using them.
To illustrate the full technical benefits of Salesforce’s own AI solutions and components, this book will take you through a case study of a fictional company beginning to adopt AI in its Salesforce ecosystem. As you progress, you'll learn how to configure and extend the out-of-the-box features on various Salesforce clouds, their pros, cons, and limitations.
You'll also discover how to extend these features using on- and off-platform choices and how to make the best architectural choices when designing custom solutions. Later, you'll advance to integrating third-party AI services such as the Google Translation API, Microsoft Cognitive Services, and Amazon SageMaker on top of your existing solutions.
This isn’t a beginners’ Salesforce book, but a comprehensive overview with practical examples that will also take you through key architectural decisions and trade-offs that may impact the design choices you make.
By the end of this book, you'll be able to use Salesforce to design powerful tailor-made solutions for your customers with confidence.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 381
Veröffentlichungsjahr: 2021
Design powerful and accurate AI-driven state-of-the-art solutions tailor-made for modern business demands
Lars Malmqvist
BIRMINGHAM—MUMBAI
Copyright © 2021 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Associate Group Product Manager: Alok Dhuri
Senior Editor: Rohit Singh
Content Development Editor: Tiksha Lad
Technical Editor: Pradeep Sahu
Copy Editor: Safis Editing
Project Coordinator: Manisha Singh
Proofreader: Safis Editing
Indexer: Manju Arasan
Production Designer: Nilesh Mohite
First published: October 2021
Production reference: 1081021
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-80107-601-2
www.packt.com
To Damiana, Ada, and Pino. To my mother, Inger Bejder, and the memory of my father, Finn Malmqvist.
– Lars Malmqvist
Lars Malmqvist has spent the past 12 years working as an architect and CTO within the Salesforce ecosystem. For the past 5 years, he has been particularly focusing on advanced AI solutions. He has worked on over 40 Salesforce implementations, ranging from simple out-of-the-box scenarios to advanced, bespoke, multi-cloud solutions for large global brands. He is a 23x certified Salesforce CTA with degrees in computer science, mathematics, and technology management and an MBA from the University of Cambridge. Currently, he works as a senior manager at Accenture and is in the final stages of completing a PhD with a focus on deep learning.
I would like to thank my wife, Damiana, for her undying support and my children, Ada and Pino, for their constant inspiration.
As a Salesforce solution architect, Madhav Kakani delivers exceptional value to customers by designing high-performance solutions and leading successful implementations of Salesforce CRM to automate sales, marketing, and business-critical processes.
His work entails negotiating solutions to complex problems with multiple parties and agendas, managing technical scope and client expectations, and managing development and change following the Salesforce governance framework.
He has been working on the Salesforce platform for 15 years, and in addition to leading projects, he has also done numerous implementations using different technologies available on the platform, namely Apex, Visualforce, Aura Lightning Components, Lightning Web Components, and Flows.
Rafael Gutierrez Castillo is a Salesforce architect with multi-cloud implementation experience. With ten years of working experience, he started his career in the education industry, developing leadership programs for university students.
He has worked in different positions within the Salesforce ecosystem, including business consultant, tester, solution consultant, and solution architect.
Working as an associate manager at Accenture, he designs solutions that bridge the gap between business processes and technology and advises companies on their digitalization and transformation journeys. With 20 Salesforce certificates, he is passionate about building automation processes, solution design, process management, and development of leadership skills.
Ashvin Bhatt is an enterprise architect, technical writer, trainer, and speaker with more than 10 years of experience on the Salesforce platform and working on various clouds. He has trained 500+ people on Salesforce through various initiatives. He is a certified application architect and holds a wealth of experience on various Salesforce products. He is a co-organizer of Salesforce Architect Summit and has been a speaker at various events, such as Dreamforce and TDX.
He has worked in a variety of domains, such as high-tech, advertising, manufacturing, health, insurance, and pharma, to name a few. He believes in sharing his knowledge through community-led initiatives to help foster learning and innovation.
In this section, you will learn the background material needed to understand the rest of the book (which assumes a pre-existing Salesforce background), how architecting for AI solutions is different from traditional architecture, as well as getting acquainted with Pickled Plastics Ltd., the running scenario used to exemplify features throughout the book.
This section comprises the following chapter:
Chapter 1, AI Solutions on the Salesforce Einstein PlatformIn this chapter, we will see why it is a good idea to build AI solutions on Salesforce and what business and technical benefits this approach can have. We will then take a bird's eye view of the various components that will be discussed throughout the book, present a basic architectural view of Salesforce Einstein, the AI platform embedded in Salesforce, and continue with a discussion on how architecting AI solutions is different from architecting traditional solutions.
This chapter ends by presenting Pickled Plastics Ltd., a scenario that will be expanded throughout the book to help reinforce the real-world applications of the technology.
In this chapter, we're going to cover the following main topics:
Why would you build AI solutions on Salesforce?What are the main components of Salesforce AI?What are the elements of Salesforce Einstein?What's special about architecting for AI?Presenting Pickled Plastics Ltd.By the end of this chapter, you will know how to think about architecting AI solutions on Salesforce.
There are no explicit technical requirements for this chapter, but you may find it useful to have an analytics-enabled developer org available to review points as we go through. This can be requested using the form here: https://developer.salesforce.com/promotions/orgs/analytics-de.
AI is at the heart of the Salesforce platform. There isn't a cloud or prominent feature today that doesn't have predictive or analytical capabilities available. Right now, you can build advanced AI solutions using clicks, not code, across most major Salesforce applications. To some extent, this is surprising. Salesforce is a relative latecomer to the world of AI.
The Einstein platform, which is Salesforce's collective name for its various AI and analytical features, did not exist until 2016. However, once it got going, the pace of evolution has been breathtaking. In 2016 alone, Salesforce acquired 10 companies, many of which were rolled into its AI capability.
In 2019, they acquired Tableau, an undisputed market leader in analytical software. Tableau CRM, the name given to the product combining Einstein Analytics and Tableau, is poised to become the de facto standard for analyzing CRM data. Even in academic AI research, Salesforce has become a force to be reckoned with, presenting groundbreaking research on natural language processing and computer vision. It is one of the first companies committed to a vision for responsible AI, encompassing the five trusted AI principles that AI should be responsible, accountable, transparent, empowering, and inclusive.
Overall, Salesforce has made an impressive commitment to including AI features across its product portfolio and doing so in a way that honors the platform by allowing extensive point-and-click-based configuration and more in-depth code-based customization. However, this begs a simple question: Why do I need AI capabilities in my CRM in the first place? Given the already extensive customization and configuration capabilities of Salesforce, do I need to complicate the picture with artificial intelligence (AI)? As you may guess from the fact that you're reading a book about these features, my answer is a resounding yes. In the next section, I will summarize why you need integrated AI features in your CRM platform.
For most large companies today, CRM is one of the vital arteries through which critical business data flows. Put bluntly, it is the system that knows about customers. The more we know about customers and the better we can use that knowledge to serve their needs, the better our businesses will do. If we learn more about customers, we can sell them products that better fit their needs at the exact time they need them. We can address their questions and concerns proactively both before and after purchase. Not least, we will be able to respond to changes in the market so that our products and services remain relevant over time.
These points have always been true, even before there was such a thing as CRM software. What CRM has enabled companies to do is track their relationship with customers in a way that far surpasses traditional methods. Similarly, an AI-enabled CRM far surpasses a conventional CRM in building and strengthening customer relationships over time.
The first important reason for that is the increasing complexity of the relationships that companies have with consumers. Today, you need to track interactions across digital and physical channels, in-store purchases, promotional events, social media, email campaigns, website visits, online orders, mobile notifications, and potentially a whole plethora of apps and dedicated digital experiences. Some of these may also have real-world components that may generate more relationship data, such as with wearable technology. This complexity means that it is increasingly difficult for a salesperson or customer support representative to look at the customer's profile and understand what is going on and what action is appropriate at a given point in time. They need help to make sense of the actual relationship and make the right decision when dealing with the customer.
Taking this up a level, complexity of relationships generates previously unseen levels of fast-moving data in various formats that do not necessarily respond well to traditional BI/reporting treatment. Managers and marketers, therefore, can no longer rely on the conventional way of analyzing and interpreting data. They need help to aggregate, simplify, and make actionable the treasure trove of behavioral insights found in customer data. The ability to precisely target consumers and interact with them in a genuinely personalized way is at the core of why you need AI in your CRM.
On a more practical level, AI allows the automation of a wide range of traditional CRM tasks, freeing up resources to help make use of the new opportunities generated by complex and varied data. Use cases such as automated report generation, data cleanup, quality management, handling simple sales, and service requests through automated channels (such as chatbots and automating routine process steps via RPA-like technologies) all offer immediate efficiencies.
While, in theory, these technologies need not sit inside the CRM, a native capability that enables you to gain access to these tremendous benefits easily is, in most cases, a no-brainer. With a native capability, you do not have to move data around, transform it, or manage yet another set of complex integrations. You can build on your existing team's skill sets rather than have to learn entirely new technologies and limit off-platform choices to only the areas where you can make a genuine business case.
While the Einstein platform is relatively new compared to the Salesforce platform, it has been around for long enough that we can have a look at a few cases where these benefits have been realized.
U.S. Bank is the fifth-largest bank in the United States, with 73,000 employees. They are a long-term user of Salesforce and also an early adopter of the Einstein platform. They adopted the Einstein platform's predictive capabilities across several functions within the bank, explicitly to address the issues of fast-moving and varied relationship data. By increasing the volume and quality of their data, they can see patterns that they wouldn't have been able to identify manually.
This information is brought to the front line by adding predictive analytical capabilities to the interface seen by front-line officers, enabling them to make better sense of the relationship and make the right decision with the customer.
Accenture is the largest IT services company in the world, with more than 500,000 employees. Within the company's CRM, the Einstein platform is used to visualize and predict information relevant to winning more deals. By embedding Einstein capabilities into lightning components shown in the relevant part of the CRM, users get highly relevant and accurate information that helps them clarify the steps to take for a given opportunity and a prediction of the current win rate.
Stonewall Kitchen is a US-based specialty food company with wholesalers across 42 countries and its stores in the US. From an AI perspective, Stonewall Kitchen has gone all-in on personalizing the online retail experience. Based on the Einstein platform, they have developed a product recommendation engine that is so good that 78% of customers who get a recommendation end up adding that recommendation to their cart, and 41% go on to buy. From an e-commerce perspective, these are awe-inspiring numbers.
These are just a few examples of how different companies have leveraged the Einstein platform to improve their ability to engage with customers and serve them better. These examples, however, are just the beginning. As a relatively young platform under constant development, we can expect genuinely great solutions to come to light in the future. Maybe after reading this book, you will work on some of them. Having gained an understanding of why using the Salesforce Einstein platform may be a good idea, we will now continue to look at the components that make up the platform.
The most important fact about the Einstein platform is that while it is an entity in its own right, it is also an integral part of the complete Salesforce platform. That means, first and foremost, that the core CRM data model that powers the rest of the Salesforce feature set is directly available to the Einstein platform's AI features. That also means that the core security model, user interface, administrative functions, and so forth that make up the Salesforce CRM can be used by and straightforwardly use the Einstein features. This fact is crucial to maximizing the benefit of working on CRM instead of integrating third-party solutions. The following diagram gives an overview of the platform architecture:
Figure 1.1 – Einstein platform architecture
The architecture diagram starts at the bottom level, with programmatic services that require advanced programming skills to implement, and proceeds up the stack to the pre-built solutions, which can be activated at the click of a button.
The Platform Services layer, sometimes referred to as myEinstein, is the part of the Einstein platform that directly builds on top of the core data model to provide customizable capabilities for prediction and analysis. Overall, in keeping with the Salesforce platform, these can be divided into declarative services that you can configure via the administrative user interface and platform services that enable programmatic access to the platform:
In the first category, we find, for instance, Einstein Prediction Builder, a point-and-click interface for making predictions about the value of fields on CRM records. This feature has extensive configurability and allows substantial tweaking of what data is used for prediction and how the system will evaluate the prediction. This feature can be maintained administratively and does not require a data scientist or a developer to implement it.In the second category, we find, for instance, the Einstein Vision feature. Einstein Vision is a programmatic API-based deep learning model that you can train for your particular use cases. For example, you could train a model to detect instances of your brand imagery in visual imagery. This feature requires considerable programming skills and machine learning knowledge to implement well.The analytics capabilities of Tableau CRM are prodigious, and they make use of many of the Einstein platform features that are discussed in this book. When considering the Einstein platform, this is often seen resting as a separate layer on top of the services layer. It is, however, well outside the scope of this book to go into any detail about this area. It deserves a large volume of its own. It is also principally focused on analyzing data to gain insight rather than using it for the types of AI-centric use cases we will be considering. Some of the pre-built solutions that we will learn about have analytics elements in them, but we will cover the specifics as and when required in these cases.
The Lightning Platform in and of itself does not have any AI capabilities. However, you can't meaningfully operationalize the other features without them, so it deserves a mention in the overall architecture. Typically, you might bring in the predictive capability in the UI, for instance, as a field on a record that is set based on a machine learning model, or in a more elaborate scenario as a custom component, visualizing the information in a way that is particularly relevant to the context record.
However, in many cases, you may want to use the AI features directly in automation, such as a flow or process builder. A simple example might be a model that classifies incoming support cases based on which might likely escalate. If that probability is above a certain threshold, automation might alert relevant managers and assign the case to a special queue for velvet-glove treatment.
The last and increasingly largest category of features is found within specific Einstein products. These are prepackaged AI and analytics offerings that address particular use cases in particular clouds. It is more the rule than the exception for a Salesforce cloud to have a dedicated Einstein product offering, although some are better developed than others. There are many of these, they vary wildly, and more are added at a rapid clip release after release.
We will be going through many of these in later chapters, so we do not need to labor the point here. These solutions are, broadly speaking, less configurable than the Platform Services, but they are the obvious place to start if they fit your use case.
While it is generally advisable to use the platform options whenever possible, sometimes you reach a point where they do not offer the functionality you require. In those cases, you have two options:
First, you can look at AppExchange and see if someone has created a pre-built app for you to utilize. Second, you can integrate third-party APIs into your solution. We will examine three options for this in Chapter 8, Integrating Third-Party AI Services, and give detailed guidance on when it is appropriate to go down that route. However, you should go down this route only when there is a much stronger fit for your requirements from going off-platform than staying on it.With this foundation in place, let's move on to looking at the platform's various components in detail.
This section will serve as a crash course in the various elements of the Einstein platform. It also serves as a handy reference for the content that will be coming in future chapters. All the features shown in the following diagram will be elaborated on further on in the book.
The chapters are standalone, so if anything catches your fancy, feel free to skip ahead to that section. I do, however, recommend that you take the time to finish this introductory chapter, as it sets the scene for the rest of the book.
Figure 1.2 – An overview of Einstein elements
We will start by considering the components of the Einstein platform related to sales.
Sales are the first use case that springs to mind when you think of Salesforce. It is, therefore, not surprising that this is an area with a strong AI offering as well. The following sections will introduce you to the various elements in play.
With Einstein Lead and Opportunity Scoring, you get an out-of-the-box way to apply AI to filter leads and opportunities within your CRM so that you can focus on the most likely to succeed and not waste scarce sales resources. Practically, that means each lead or opportunity is assigned a numeric score that indicates their attractiveness. Attractiveness in this context implies the likelihood that it will convert from a lead to an opportunity and from an opportunity to a sale.
While each model used for scoring is unique to the specific customer, the underlying model framework is fully automated. Salesforce automatically builds the model based on the data available in the lead and opportunity objects. You have minimal control over how this model is built, but you can use the score for various additional automated purposes. That might include alerting relevant people when a score crosses some threshold, automatically subscribing leads to a given customer journey in Marketing Cloud based on their lead score, or automatically stopping and archiving records where the score drops too low.
The need to increase forecast accuracy is near-universal. Very few organizations get their forecasts consistently correct. It is, therefore, not surprising that Salesforce has included an automated forecasting capability in Sales Cloud Einstein. Much like lead and opportunity scoring, Einstein Forecasting automatically analyzes data in individual Sales Cloud objects, mainly Opportunity but also others, and generates a set of predictive models to explain the outcomes.
Based on the best model, it generates several dashboards where you can see the forecast broken down by teams, with a confidence interval and information about key factors influencing the forecast. You can also see trend information based on the forecast and Einstein's prediction of future developments.
Einstein Activity Capture is a way to automate some of the drudgery involved in matching emails and calendar events to Salesforce contacts and accounts. Once installed, it automatically matches emails and calendar events in your email client to existing accounts and contacts, saving you a considerable headache.
The synchronization details and how fields are mapped across can be a little tricky, but it's well worth it for the reduced manual work. Architecturally, it is also slightly different from most Salesforce offerings in that it stores information in a public cloud rather than on Salesforce itself. This has implications both for how you can use the data and for compliance.
Einstein Conversation Insights is one of the most exciting offerings in the Sales Cloud suite. It offers part-automated sales coaching via AI to improve the efficiency of sales teams. The critical ability is for AI to identify key moments within a conversation, such as the mention of a product or a competitor brand. Managers can then review this moment directly without the need to revisit the entire conversation.
That capability allows sales coaches and managers to handle a much higher volume of calls and substantially improve the feedback given to sales staff. The product also allows for analytics on top of the voice call data to see aggregate information about calls over time. Technically speaking, this is a bit more difficult to set up as it requires integrated telephony to be viable. However, there are many good options for doing this, including both native and third-party solutions.
Service is almost as commonly used on the Salesforce platform as Sales. The Service AI offering has many unique and interesting features that can help you enrich your solutions. In the following sections, we will explore how.
Chatbots are becoming ubiquitous as a channel for both sales and service. It is, therefore, not surprising that Salesforce has introduced its own bot framework directly within the Einstein platform. That means you now have the capability of building bots and exposing them via Salesforce chat, external websites, or social media channels.
The bot learns by example using natural language programming, which is to say that you define the limits of the dialogue that the bot will be able to participate in and the actions it will be able to take, but that you need to provide a certain amount of input for it to be effective. You can create chatbots without Einstein. However, it will not be able to make any kind of inferential leap. Bots can undertake a wide variety of actions on your behalf and can also escalate to a human operator if they get confused.
One of the most common activities within any Service Cloud implementation is working out ways to effectively route cases to the right people at the right time. Salesforce has a variety of options to deal with this area, depending on the level of complexity. Now one of them comes with AI.
Einstein Case Classification and Routing is a pre-built feature that allows easy creation of a machine learning model that enables predicting certain case fields based on other information in that record. Effectively, this will allow you to set the value of pick lists and checkboxes based on the model's best guess derived from historical data. This, in turn, will enable you to route cases based on that information using the usual methods. Thereby, companies can save the manual effort in the call center spent on classifying incomplete records.
Einstein Article Recommendations is another feature that focuses on eliminating drudgery. Searching through the knowledge base and attaching relevant articles to a case is one of the most common parts of the customer service agent's day job. The purpose of article recommendations is to partially automate this by Einstein automatically searching for similar cases and relevant articles and suggesting them directly without the need for agent interaction.
It works by building a machine learning model on top of the case object and the knowledge object. You have the option of telling it what fields to learn from and what fields are more important than others, and once this is done, agents will start seeing improved article recommendations that they can simply accept to have them tied to the case.
Many chat interactions are quite repetitive, and Einstein Reply Recommendations leverage this fact to generate automatic reply options for customer service agents that they can use to help make chat interactions faster and more effective. Once activated and trained, the reply recommendations mode suggests replies in real time based on the current state conversation. Agents can either post these directly or edit them before posting.
Replies are generated using an advanced deep learning-based natural language processing model customized using historical data from past chats. It can, therefore, only be used where a substantial amount of historical data exists.
Marketing Cloud is arguably the leading digital marketing platform on the planet. The need to precisely target audiences with the right message at the right time is one that positively begs for an AI approach. We'll explore how Salesforce has risen to this challenge in the following sections.
Einstein Engagement Scoring is a deceptively simple feature that uses a pre-built machine learning model to segment your subscribers based on their tendency to engage with the content you send out. The model is fully out of the box, but you have relatively wide opportunities for using it in your unique marketing scenario. Based on the engagement score assigned to subscribers, they are segmented into one of four groups:
Loyalists: The best kind of subscribers. They frequently open your emails and click on the links.Window Shoppers: These subscribers open emails but have low click engagement. Selective Subscribers: Choosy subscribers, have a low open rate, but if they open, they often also click through. Winback/Dormant: Subscribers with both a low open rate as well as a low click engagement.You can use these groups for specially targeted promotions with all your favorite Marketing Cloud tools. In particular, you can use these personas with the Einstein Split mechanism in Journey Builder to send different types of subscribers on different customer journeys automatically.
Einstein Recommendations is a feature that helps you by suggesting the most relevant next bit of content to share with a customer either through email or on the web. The feature automatically analyzes behavioral and affinity data related to customers and feeds this to a recommendation engine that you can use to produce personalized recommendations.
It relies on product or catalog data within Marketing Cloud, a prerequisite that not all users will have in place. It is also somewhat more heavyweight in configuration terms than most Einstein features we will be looking at. Once set up, however, it can be used directly within the Marketing Cloud Personalization Builder or Content Builder by using the pre-built recommendations component. That makes it very easy to deploy once the configuration has been completed.
When using Einstein Content Selection, email marketers can automatically customize their emails using configured business rules to maximize the click-to-open rate. Content is dynamically selected from a preexisting pool based on the underlying machine learning model's predictions and automatically tested using A/B testing to optimize even more. This allows email marketers to include the relevant component in an email template and have the AI do the rest.
Fundamentally, content selection works based on three factors:
Customer profileBusiness rulesContent poolThat is to say, given preconfigured business rules, a set of subscribers to send to, and a pool of content to choose from, Einstein Content Selection will try to optimally pick the most relevant piece of content on a subscriber basis. The business rules give a relatively strong element of configurability to this feature. However, as with most of the pre-built Einstein features, you have no control over the underlying model.
Einstein Splits allows you to tailor your user journeys based on AI-generated personas and other factors to give truly customized experiences for your users. Various kinds of splits can be configured to tailor the path taken by particular kinds of users, selected by machine learning models based on their underlying characteristics.
Einstein Messaging Insights gives you insights automatically generated based on the characteristics of your email sends, such as an unusually high or low response rate. They appear as notifications and allow you to drill into the details.
By contrast, Copy Insights uses the same underlying information to predict what subject lines will be more effective than others. That way, you can more easily craft the right message for your audience.