Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(recommend): add recommended-for-you model #1490

Merged
merged 8 commits into from
Dec 7, 2023

Conversation

raed667
Copy link
Contributor

@raed667 raed667 commented Nov 23, 2023

Description

Add getRecommendedForYou function to recommend.

Test

To test locally you can update playground/browser/index.html with the following content:

<html>
  <head>
    <script src="/playground/browser/recommend.umd.js"></script>

    <script>
      const recommend = window['@algolia/recommend'];
      const client = recommend('betaUASF0EMRRM', '2c80241f06757af6fc4ef4a2d9523b6d');

      client
        .getRecommendedForYou([
          {
            indexName: 'bestbuy',
            queryParameters: {
              userToken: 'user_token_1',
            },
          },
        ])
        .then(({ results }) => {
          console.log(results[0]);
        })
        .catch(err => {
          console.error(err);
        });
    </script>
  </head>
  <body></body>
</html>

marialungu
marialungu previously approved these changes Nov 23, 2023
Copy link
Contributor

@marialungu marialungu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@francoischalifour
Copy link
Member

There are 3 ways of referencing "products" now:

  • Related Products
  • Trending Items
  • Recommended For You (generic, no name)

What's the reasoning behind all these different namings? "Recommended For You" also returns products, right? And in that case, how to explain users the difference between "Recommended For You" and "Related Items" provided with a userToken?

@AlexEven
Copy link

Hey François, will try my best to answer your questions

  • Related products: products that are linked to the source item in a way (either it's an alternative, or it's often be sold together, etc)
  • Trending items: product in your catalog that have recently become popular
  • Recommended for you: a subset of the catalog matching your affinities. E.g. on homepage, pick most relevant items from the full catalog; on a collection page, highlight personalized items from a specific category; on user profile page, show personalized items from best sellers, whatever. Possibilities are endless.

How is this different from Related products with a user token?
This second option is "simply" re-ranking already available recommendations to push the ones matching user affinities in priority. Just like you would apply a rule to boost a certain category, here you'd prioritize personalization.

Hope this helps. Thanks!

@francoischalifour
Copy link
Member

Right, so the main difference with Recommended For You is that there's no reference product. Thanks for the clarification!

(It's unfortunate that there's this divergence between Related Products and Trending Items, while both refer to catalog records.)

@shortcuts
Copy link
Member

Hey, feel free to ping me when I can merge :)

Copy link
Contributor

@marialungu marialungu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@raed667
Copy link
Contributor Author

raed667 commented Dec 7, 2023

@shortcuts this can be merged

@shortcuts shortcuts merged commit 004f033 into master Dec 7, 2023
7 of 8 checks passed
@shortcuts shortcuts deleted the feat-recommended-for-you branch December 7, 2023 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants