Test Driving AI + Data + CRM: Cross Sell Recommendations & Churn Prediction in 4 Simple Steps

AI + Data + CRM is the talk of the town and it is all set to define future of business in the days to come. With so much AI + Data + CRM action in the Salesforce ecosystem, our team at Aethereus Studio also couldn’t wait to roll up their sleeves and experience it themselves. To test the waters, we selected customer churn prediction and cross sell recommendations as our use cases. The process of creating AI models using the shiny new setup of Data Cloud & SageMaker was really exciting for our team and in this article we have outlined how AI + Data + CRM can be brought to life in 4 simple steps:


The below technical flow provides a high level setup of the components that were needed for carrying out the end to end process and can be used as a reference for building custom AI with Data Cloud. It is important to include the additional AWS components like Lambda Functions and API Gateway while defining the technical landscape as these are critical for making the models easy to consume.

Step 1 - Ingest & Harmonize Data in Data Cloud

The data we needed for AI modelling was gathered from multiple sources into Salesforce Data Cloud where the data was harmonized and synced with objects for consumption by the AI model. For our experiment, we imported customer’s sales data from Sales Cloud, browsing and web engagement data using Interaction Studio, customer’s complaints were imported from Service Cloud and purchase history was brought in from ERP data.

The data was imported into Data Cloud using Data Streams and Data Cloud Harmonization process was used to map the data elements to the standard and custom objects in Data cloud. We were now ready with more structured and unified data for use in the AI models.

Step 2 - Connect Data Cloud with Amazon SageMaker

While connecting Data Cloud with SageMaker you may encounter a road block inside Data Wrangler as the direct connector is available only in specific regions. So the best way to navigate around it is to improvise and proceed with another route that accesses data from Data Cloud using the Python salesforce-cdp-connector. This is a read-only Data Cloud client for Python and a connection is established with Data Cloud using a connected app inside Salesforce. After the connection was established, data was read with the help of a simple SOQL(Salesforce Object Query Language) query and stored inside a pandas dataframe.

Note: We created the above process by writing Python script inside a notebook instance of Amazon Sagemaker.

Step 3 - Build & Train model

Once we had the data inside a pandas dataframe, the process of data pre-processing was carried out. We covered two possible use cases when the processed data was ready for building & training the models:

  1. Cross Sell: Product recommendations based on the customer’s prior purchases, web engagement and browsing history
  2. Churn Prediction: Predicting the probability of a customer’s churn based on the customer’s data related to complaints, purchases, phone calls and engagement.

Use Case 1 – Cross Sell

Our cross-sell model dataset consisted of the following columns: product_id (unique identification for each product), user_id (unique identification for each customer), and rating (out of 5) which told how much the user liked the product.

To recommend customers products that they might be interested in, a collaborative filtering approach with clustering was used. Our approach was as follows:
If customer 1 has bought products A, B and C; and customer 2 has bought products A and B, then it is likely that customer 2 will also buy product C (also explained in the diagram below). For this, we needed to find products close to each other. This can be done by dividing the dataset into clusters and assigning products to each of those clusters.

To make the dataset usable, it was transposed into a matrix with rows denoting products and columns denoting customers. The value of a cell is equal to the rating that the product has received from a customer else it is 0.

Below is a scatter plot of the number of products that are rated by each user:

Most of the users had rated either one or two products only. This is because our dataset contained the ratings of only a single year.

Sagemaker has a plethora of built-in models that can be used for machine learning / AI and for this use case, the KMeans model was used and deployed to an endpoint.

Use Case 2 – Churn Prediction

Churn prediction is one of the most important parameters for any organization. Organizations need to understand how many of their customers stay with them and how many will leave. This helps organizations understand the areas of improvement and prevent their customers from leaving.

To build the machine learning model, we used the in-built xgboost algorithm that comes with Sagemaker out of the box. Some of the hyperparameters were defined which were specific to the model we were building. Once we had our model and parameters in place we started the training. After training the model, it was stored in the output path previously defined and the model was saved as a tar.gz file.

Step 4 - Deploy the models

In this step we deployed the SageMaker model to an external API that can be consumed by Salesforce CRM or any application using REST protocol.

The model deployment process involved deployment of the SageMaker models to an endpoint, the created endpoint was then called in Amazon Lambda which contained a single function. The purpose of the function is to take a JSON containing the customer’s data as input and returns the recommended product as a JSON. While the outputs are input and outputs are JSON, the lambda function transforms the request to a model acceptable format and then formats the output back to JSON.

To expose this function to Salesforce CRM and other external apps, a REST API was created in Amazon API Gateway, which was integrated with the lambda function created above. Below are sample outputs for the corss-sell & churn models:

Output – Cross Sell Recommendations

After the endpoint was deployed, it was possible to obtain the closest cluster of each product and its distance from the cluster by invoking the endpoint. The result looks as follows:

We then grouped this table by cluster number and sorted it by distance. This enabled us to create a function that takes product_id as input and produced an output of other products in the same cluster and thereby leading to a list of recommended products for the customer.

Output – Churn Probability

Once we deployed the model, an endpoint was created, customer attributes were passed to the model through an API call and it returned the probability of customer’s churn.


The process of building an AI model with Data Cloud and SageMaker brought in a lot simplicity and advantages when compared to the traditional machine learning & AI process:

  • The quality of input data was much better as the data from multiple sources could be combined and pre-processed easily in Data Cloud.
  • Data was seamlessly available in SageMaker using standard libraries for model creation and training.
  • The model creation & deployment process were accelerated with pre-built models and tools available in SageMaker
  • With the bring your own model framework we were able to develop highly personalized recommendations very quickly thanks to the Customer 360 data in Data Cloud.

As we were building our 2 uses cases and dived deeper, the team was able to come up with a number of other creative industry use cases that are going to be built next using the power of AI + Data + CRM. While we are at it, if you have any exciting AI use cases that you want to try out for your organization and are looking for help on how to use AI + Data + CRM to create magic for your users then reach out to us on our website or LinkedIn page.

Bridging educational gaps for underprivileged children

Aethereus as a part of its CSR initiative joins UPAY as a partner and makes a commitment to provide UPAY with certain learning equipment that aim to educate the underprivileged


children through Reach & Teach initiative. We strongly support this mission and envisions on removing disparities in the field of education and provide each child access to quality education by supporting the operations of UPAY learning center in Pune.

Welfare and Education initiatives to empower children affected by Farmer suicides

Aethereus partnered with Snehwan an NGO who works for children who lost their parents to farmer’s suicide. Aethereus supported SNEHWAN to build classrooms & to work for the welfare of SNEHWAN children to make them self-sufficient in their lives and help them upskill for their future career roles.

Empowering Acid Attack Survivors

The Brave Souls Foundation is a non-profit organisation established and led by acid attack survivors to prevent acid attacks, combat gender-based violence, and improve the welfare of survivors.

Aethereus has made a significant impact by supporting survivors through comprehensive assistance, offering vital resources such as medical, psychological, educational, financial, and legal support. This compassionate initiative encompasses a wide range of needs, including rehabilitation, access to food, essential medications, and secure shelter for these resilient survivors.

Empowering underpriviledge kids with Diwali workshops

Tara Mobile Creche (TMC), a non-profit organization, focuses on addressing the health and educational needs of children whose parents work on construction sites in Pune. Through the 'Aethereus Community Outreach' program, #TeamAethereus dedicated the day to candle making workshops, teaching sessions, and sharing goodies with the kids on the occasion of Diwali. Interacting with the remarkably talented kids, sharing experiences, listening to their stories, and witnessing the dreams in their eyes was a rewarding experience.

Blood donation drive on India’s 74 th republic day

Aethereus ringed in 74th Republic Day celebrations by organizing a blood donation camp to commemorate the sacrifice of our freedom fighters. More than 100+ participated in this drive collecting 250 units of blood, which used to help kids suffering from Thalassemia disease.

#TeamAethereus salutes all the rockstars who donated blood and impacted many lives to celebrate this festival. More power to you!

Paying way for a digital educational future

Aethereus has partnered with SOCH to make a meaningful impact on the lives of underprivileged children, ensuring they receive the necessary knowledge and education. Together, we've positively influenced the education of 200 children in Ghaziabad, by transforming Prathmik Vidyalaya first government school in Ghaziabad with fully digital classrooms. This marks a significant milestone in demonstrating how technology and education can collaboratively shape a brighter future for students in need.

Celebrating stories of 'Grit & Guts' with Pragati Foundation on Women’s Day

Aethereus 2023 Women’s Day theme was about celebrating the stories of ‘Grit & Guts’ from Pragati Foundation, a non-profit organization working to provide dignity to women from underprivileged communities. As a part of the Aethereus Outreach Program, it was humbling to listen to inspiring stories of their real struggles, their ‘Grit & Guts’ to march on and shine brilliantly with help from Pragati Foundation.  

Spreading Diwali joy with elderly at Silver home

Aethereus believes in fostering a sense of community and giving back, especially during times of celebration. In the spirit of Diwali, #TeamAethereus spent quality time with the old age people at Silver Homes, sharing smiles, laughter, and heartfelt conversations. We distributed delightful snacks and traditional diyas, illuminating not just their surroundings but also their spirits.

Cards and Payment company based in USA

The Need
Unify data across Marketing, Sales, Service and legacy systems for AI powered Customer attrition prediction

Conduct Data cloud discovery and define integration architecture for creating C360 view. Foundation for cognitive churn prediction analysis

Expected Outcomes
Predict customers at risk – via smart AI predictions – based on their engagements history. Reduce attrition by 15% improved campaign outcomes

A professional services firm based in USA

The Need
Unified B2B Marketing journeys and insights across 12+ marketing channels


Leverage Data Cloud + Pardot + Datorama for AI powered segmentation and marketing channel optimization dashboards

Expected Outcomes
Identify unknown customers visiting website leveraging data from multiple sources and target them with AI powered lead scoring – leading to 50% improved campaign outcomes

A global commercial vehicle manufacturer

The Need
reate Customer 360 view across 50+ data sources to enable AI powered segmentation with data cloud

Aethereus leveraged Data Cloud for data profiling and harmonization across 50+ sources

Expected Outcomes
Unified view of customer journey across Marketing, Sales and Journey. AI powered campaign journeys leading to 2X improvement in targeting

Fleet Management Company in US

The Need
Improve agent productivity with AI powered suggestions and auto-responses

Aethereus leveraged Einstein Next Best Action and Einstein for Service to leverage AI-powered case classification, next best actions and cognitive service replies

Expected Outcomes
24% improved CSAT due to ‘first time right’ responses, 32% improvement in agent productivity

Privacy Preferences
When you visit our website, it may store information through your browser from specific services, usually in form of cookies. Here you can change your privacy preferences. Please note that blocking some types of cookies may impact your experience on our website and the services we offer.