Guides / Algolia recommend

Algolia Recommend lets you display recommendations on your website. Recommendations encourage users to expand their search and browse more broadly. If an item isn’t exactly what users are looking for, they can quickly jump to similar or complementing items.

How Recommend works

Under the hood, recommendations rely on supervised machine learning models and the Algolia foundation.

There are two different flavors of recommendation algorithms.

Collaborative filtering works by analyzing user events. First, the user events from the last 30 days are collected. Recommend builds a table with userToken as columns and objectID as rows. Each cell represents the number of interactions between a userToken and an objectID. Then, Recommend analyzes the table with a collaborative filtering algorithm. For each item, the algorithm finds other items that share similar buying patterns across users. Items are considered similar if the same set of users interacted with them. Items would be considered bought together if the same set of users bought them.

Content-based filtering analyzes key attributes of items, such as their titles or descriptions, to find similarities.

Recommend models

Algolia Recommend builds models from your index and user events, based on supervised machine learning algorithms. Given an objectID, the trained model recommends other objectIDs that are related, based on the characteristic model.

Frequently Bought Together

Frequently Bought Together recommends items that are often bought together. To find such items, Recommend looks at conversion events, which are events towards a goal, for example, a purchase. Two or more items are considered bought together if the same user performs conversions with these items on the same day.

You need to collect at least 1,000 conversion events with two or more items within the last 30 days.

The Frequently Bought Together model recommends up to 3 items.

The Related Products model is a hybrid model for recommending items that are related to each other based on:

If you want to train your Related Products model with only click and conversion events, you need to collect at least 10,000 within the last 30 days.

The Related Product model recommends up to 30 related items.

Content-based filtering is a beta feature.

Content-based filtering creates even more relevant recommendations compared to just relying on collaborative filtering, and also allow you to show recommendations when you didn’t collect enough user events yet. With content-based filtering you can maximize your catalog exposure, so that your users get relevant recommendations even on items that aren’t popular.

Migrating from the Recommend beta

Since June 30, 2021, Algolia Recommend is generally available. You can migrate your beta indices and update your user interface.

Storage and format

In the beta, recommendations were stored in an Algolia index with the following naming convention: ai_recommend_${modelName}_${indexName}.

For example:

  • ai_recommend_bought-together_mysourceindex
  • ai_recommend_related-products_mysourceindex

These beta indices don’t receive any updates since August 30, 2021.

After migrating your recommendations, you can delete the indices from the Recommend beta.

Updating your user interface

If you used the Recommendations React component in the beta, see the upgrade guide for more information about updating to the latest Recommend UI library.

If you developed a custom component to show recommendations in your front end, see the Recommend API reference for more information about the returned response.

Did you find this page helpful?