The Science Behind Cortex: Prediction-Powered Marketing Automation [RS Labs]

Cortex is the industry’s first marketing platform powered by Artificial Intelligence (A.I.). It makes decisions based on our deep predictions about where a customer is in their journey, the types of items he or she likes, and the most appropriate discounts for that user.

For example, when we predict that a customer might be leaning toward leaving the business (i.e. churning), Cortex will fire an email to try and persuade the customer to stay. When a product flagged as a recommended item for a particular customer has a price drop, or if a customer just needs an extra push to convert, Cortex will send those messages too. Its goal is to send the right message, to the right customer, at the right time; in other words, highly personalized lifecycle marketing, delivered by true automation, powered by A.I.

This is a lofty goal, but not an impossible one. Within this post we will touch on a number of ways we employ Machine Learning here at Retention Science to make all of this marketing magic happen. Hopefully, at the end of it you’ll see that it’s not magic at all — just some extremely cool (data) science.

Adapting to the Customer Journey

In the classical sense-and-act problem in Artificial Intelligence, a robot “senses” its surrounding environment (say by using cameras), and then makes a decision (turning left or right) based on that data.

Cortex also uses A.I. to sense what we call customer states, and then takes the appropriate action based on that data.

For instance, it might realize that person just registered with a retailer, but hasn’t purchased yet. So it sends some enticing product recommendations and discounts. Or, Cortex deduces that a person may be churning because she appears to be purchasing fewer items than before, and less frequently. Or, a new product is back in stock that would be perfect for a user, based on the other items he has browsed and purchased in the past.

Each of the above situations is a customer state, and each state represents some stop on the customer’s journey.

Each state, in turn, is tied to an action that Cortex can take to help the customer be a happier, and more loyal, customer.


Figure 1: Cortex uses A.I. to determine what state each customer is in, and then takes the corresponding appropriate action(s)

The key, then, is for Cortex to be able to sense the customer states, after which it will make the best-fitting corresponding decision. Cortex’s ability to sense customer states sits atop our prediction engine, which estimates a number of different states along the customer journey, personalized for each customer. The states can represent whether a person will remain a customer or not, what type of customer he/she will be (big spender or not), the customized recommendations for that user, the types of discounts that user prefers, whether that user needs some additional encouragement, and so on.


Figure 2: Total Ordering of Customer States Along the Customer Journey

Cortex also has a notion of total ordering on the states that customers can be in along their journey. Just as in traditional “planning” in Artificial Intelligence (think a rover on a planet), when Cortex comes to multiple paths it can take (for instance, a user in both an “at risk of churn” state and “happy birthday” state), it will choose the preferred path based on the total ordering.

For example, Cortex might come across a customer at both an “At Risk of Churn” state and “Happy Birthday” state. In this instance, Cortex will prefer to take action to rectify “At Risk of Churn” over sending a birthday message, because it outranks the latter in urgency. Figure 2 above shows an example ordering for a theoretical client (we note the ordering depends on specific metrics, and may change per client).

Adapting to the Customer

Cortex effectively adapts to the customer journey, taking different actions based on different customer states. But perhaps more interestingly, it also adapts to each customer on an individual level.

When Cortex interacts with a customer by sending a recommendation, a discount, or even a “brand bite” of content, the user’s actions are logged and interpreted as feedback that, in turn, change Cortex’s behavior. If it learns that someone prefers recommendations for new items they haven’t seen before — we call this item discovery —  then it will send more diverse items that may be less related to that user’s past behavior.

This is in contrast to someone who is more interested in items recommended because they relate directly to his or her previous purchases (e.g., if you bought dog food, we recommend a dog bone). Of course, all of our recommendation and incentive optimization can be customized for each client’s specific business logic, as we’ve covered in a previous post.

3 (1)

Figure 3: Cortex sends recommendations based on what speaks to each customer on an individual level.

Similarly, if someone’s discounts aren’t enough to drive that conversion, Cortex will offer deeper discounts, but only deep enough to help that user make the move to spend. Just like with the recommendations, the feedback from each individual customer will drive Cortex’s behavior.

Cortex can optimize incentives to maximize conversion, which drives more revenue; or to preserve margin, which drives only the minimum discounts it takes to get people to spend.


In this way, Cortex adapts to individual customers and where they are in the customer journey, effectively adapting to each business over time, and automatically adjusting accordingly.

Inherent to this adaptability is the software’s ability to scale as the business scales. As each client’s business grows, Cortex learns more, and therefore adapts more. In this sense, it literally grows and changes in step with each client. For instance, if your business doubles its catalog of products, Cortex will learn how to recommend those different items as well.  It literally scales and adapts to the evolution of your business, not just the actions of your customers.


We believe Cortex represents the future of marketing automation: truly autonomous software that touches customers at the appropriate points in their customer journey. This frees marketers to focus on strategy and content, rather than delivery and segmentation.


About the Author

Matthew Michelson is the Director of Data Science at Retention Science. He focuses on making data science actionable, from his time in investment management to the start-ups he has helped found and advises. He received his MS and Ph.D. in Computer Science from USC and his BS in Computer Science from Johns Hopkins University.