Chapter 12. Using Artificial Intelligence to derive Product Recommendations

Table of Contents

Steps Required
Steps Required - Zucchetti AI service
Steps Required - Internal KonaKart service
Custom Fields

The Enterprise version of KonaKart contains functionality to support the generation of product recommendations using an Artificial Intelligence engine. The AI engine used is the Zucchetti AI Engine which is available as an optional extra to KonaKart.

The Enterprise version of KonaKart also contains functionality to support the generation of product recommendations using a configurable internal algorithm that does not use AI techniques. This can be used when there is no AI Engine present or there is insufficient data (at least 10 products ordered by 100 or more customers) for the AI Engine to work effectively.

The objective in both cases is to calculate the set of products most likely to be of interest to customers to improve online sales.

Steps Required

In order to derive the product recommendations the following steps are required to be undertaken. The steps are different depending on whether you use the Zucchetti AI service or the internal KonaKart service.

Steps Required - Zucchetti AI service

In order to derive the product recommendations using the Zucchetti AI Engine the following steps are required to be undertaken. A Quartz batch job is provided to complete all steps (except the first).

  • Execute the AI service in the background using Docker.
  • Data Export - Data collected by KonaKart is extracted and sent to the AI service
  • AI processing - The AI service processes the data provided by KonaKart in order to come up with its product recommendations
  • Data Import - The product recommendation suggestions data is loaded into the KonaKart database where it can be accessed using KonaKart APIs.

Steps Required - Internal KonaKart service

In order to derive the product recommendations using the Internal KonaKart Service the following steps are required to be undertaken. A Quartz batch job is provided to complete all steps.

  • Product Suggestion processing - The KonaKart service processes the data already in the KonaKart database in order to come up with its product recommendations. The algorithm can be configured by setting the "weighting" on any of the CustomerTags. This weighting should be a number between 0 and 999. The higher the number the higher the overall score that is calculated and the higher the confidence in the product suggestion. Therefore, it is suggested that a high weighting be specified for a product in the PRODUCTS_TIME_IN_WISHLIST tag as this is highly-likely to be a product of interest to the customer.
  • Data Import - The product recommendation data is loaded into the KonaKart database where it can be accessed using KonaKart APIs.

In KonaKart these "Product Recommendations" are known as "Suggestions". There are two types of suggestions produced. There are suggestions for products to buy based on a previously-bought product and there are suggestions created for each individual customer.

Batch jobs are provided to export the required data from KonaKart and to import the results back into KonaKart. These can be run using the included Quartz Scheduler.

Product recommendation suggestions have version numbers which allow data to be loaded for a new version of the data at the same time as the data is being used for a previous version. At a convenient time (once the data for the new version is loaded) the "current" version can be switched over by updating the AI_SUGGESTIONS_VERSION configuration variable. This versioning feature is implemented because the complete data import can take a considerable amount of time and prevents the new data from being used before it is ready to be used..

Custom Fields

In order to provide data specific to a customer's own requirements (relevant to their own business) it is possible to send custom field values to the AI engine.

For products, the following fields are sent: custom1, custom2, custom3, custom4 and custom5.

For customers, it is possible to map any of the Customer customer fields or any Customer Tag to the 5 custom field values sent to the AI engine. As one of the parameters to the CreateProductSuggestions batch job (see konakartadmin/WEB-INF/classes/konakart_jobs.xml) you specify the source for the 5 custom fields used for the Customer export as a comma-separated set of 5 values. Custom fields (custom1, custom2, custom3, custom4, custom5) on the Customer record are identified with "#1,#2" (for custom1, custom2 etc.). CustomerTag records are identified by the CustomerTag name.

An example is: "#1,IS_MALE,#3,FAVOURITE_COLOUR,FAVOURITE_CITY,#4