Recommendation Engine — with a twist of flavour
By: Navdeep Singh
Tags: AI, Foodtech, Data Science, Recommendation System, UI

Written by Niladri Banerjee

Introduction

Food, such a wonderful delight!

Food, such a delightful sight!

Food that makes an imagination take flight,

Food that lightens up the day bright!

Our lives are all about food. Good, timely, nutritious food is vital not only to us as humans for survival, but it is also essential for our well-being! Here at LMK Group, food is what we do! On a daily basis!

And not just provide food. That many people and indeed businesses worldwide are involved in.

Our mission, however, is to make everyday lives simpler. By making it easier to plan, obtain and cook delicious meals loved by everyone in the family while at the same time making sustainable production a non-negotiable priority.

It is precisely for these reasons developing an AI-driven recommendation engine for our customers was no mean task! There is no plug-n’-play system out there that considers the unique business model of our meal kit system and is ready to deploy out of the box!

So, in this blog, we will go through some of the salient features of our recommendation engine that make it so unique and that helps fulfil our goal of making everybody’s daily lives, a little bit simpler and enjoyable!

P.S If a general introduction to recommendation engines is what you are looking for, there are plenty of great resources, e.g., check out here, here and here

Materials & methods

Like many recommendation engines out there, the first and foremost priority is to ‘know thy customer’. Because indeed we wanted to make personalisation a top priority- to recommend dishes and meals based on what we personally like and prefer! So how did we go about it?

Well, we did this by making a taste profile for every active customer based on past orders. This involved a fair amount of data munging and wrangling.

There were complex business rules to adhere to, intricate JOINS to perform and a good measure of Pythonic magic to whip into shape the data that forms the base for our recommendation engine.

The real matrix is what you are staring at…

While the business rules might be boring to write much about, they actually acted as useful constraints. Talk about making lemonade out of lemons!

We at LMK Group are all about sustainability and planning. Thus, our weekly menus take into account the seasonal fresh produce, availability of ingredients and various logistics measures to minimise food wastage. Additionally, there are rules pertaining to the specific variety of dishes to provide for the customer each week. Thus, our recommendation engine deviates from the classic e-commerce-based recommendation engines.

At its core however, the overall principle follows a content-based approach to recommending dishes to each customer for each week using past orders data, ingredients and taxonomies of each dish in addition to the seasonal recipes available. The end result is not that different than chopping, cutting and grinding the raw materials needed to make a lip-smacking dish!

Without going into too much technical details, the overall flow of steps can be summarised into the following steps:

From a distance…everything looks so simple!

Thus, every week each of our customers get 8 dishes to choose from. Why this number one may ask? Well again it comes down to business rules such as basket sizes and a trade-off between drowning a customer with a flood of options, in which case it would not be personalised at all or the other extreme- giving way too few options!

The above flow chart however is just on the model side, which consists of many matrix operations. Getting the recommendations out to the customer while he/she browses on the website/app is a whole different ball game. That is where the dark art of productionising machine-learning models comes into the picture! Speaking of pictures, take a look below to get a bird’s eye view of the various steps and interconnected pathways involved in serving the recommendations!

The flow

As we can see, delivering a machine-learning end product to the masses, i.e., the ‘consumable’ requires an orchestration of considerable number of processes across various systems in both backend and frontend infrastructures. And this will vary from company to company and use-case to use-case of course!

In our case, the broad route basically involves delivering the recommendations to the customer on the website through Segment, which is a customer data platform that is a pretty powerful tool for coordinating the final display of items to the customer. This data is pumped from a PostgreSQL database that obtains its data in a JSON format from our Azure SQL Database. All of this coordinated through pipelines and stored procedures triggered from Azure Data Factory.

Workform

The way we like to work with Data & AI products in LMK Group is to “Nail it, then scale it”. Get the minimum viable product to production as fast as possible and learn. When you are sewing data components in a data product together is when one really exposes the faults in the solution. This pushes the platform team to orchestrate everything with precision, the frontend team to make smooth customer facing UI and it forces the digital experience team to think about UX from the customers perspective. Especially for recommendation engine products the UI really influences the results of the data product.

This approach is one of many approaches we have tried and tested. We also work with person-based approaches, association rules, ML ++. We also have different types of products we can recommend spread across 4 brands in 3 countries. In other words, this blogpost highlights a small amount of work we are doing across our company, but also a very nice introduction of our ways of work.

Results

Okay, enough talk about the technical implementation, does our recommendation engine work? Does it help push the needle when it comes to tempting customers with dishes customised to each and every one of them? Preliminary analysis says YES!

The following is a graph from one of the cohorts we tested the recommendation engine on, and we were quite pleased that customers receiving the personalised recommendations not only purchased more recommendations, but more customers were purchasing! This was a very welcome news from the viewpoint of customer engagement and satisfaction!

Some very interesting results!

Discussion & Conclusion

So, what can we conclude about the recommendation engine? Well for starters, the good news is that it is working! The plan going forward would then be to expand to all the companies under the umbrella of LMK Group.

The other big advantage is that this application supports our chefs. With the recommendation engine, one part of their workload gets automated leaving them free to focus on doing what they know best….making delicious lip-smacking dishes for all of us to savour upon!