nashtech-garage / yas

YAS: Yet Another Shop, a sample microservices project in Java
MIT License
1.5k stars 392 forks source link

Add product recommendation (AI powered) #982

Open thiennn opened 2 weeks ago

minhtridn2001 commented 6 days ago

Hi @thiennn, and Team, I’ve researched different recommendation types and outlined the options below. Please review these findings, and let’s discuss the best approach for our cases.


1. Different types of recommendations

Below are the main types of recommendations, along with common use cases for each.

1.1 Content-Based Filtering

Content-based filtering recommends products by analyzing the attributes of the items a user has interacted with (bought, viewed, liked) and suggesting similar products with similar attributes.

Common use cases:

1.2 Collaborative Filtering

Collaborative filtering recommends products by analyzing patterns of user behavior. It looks at users with similar purchasing or browsing histories and suggests products those similar users liked or purchased.

Common use cases:

1.3 Knowledge-Based Filtering

Knowledge-based Filtering uses structured knowledge, such as rules or product facts, to recommend products. These systems rely on user preferences and explicit information about the products.

Common use cases:

Real-world recommendation systems are typically a hybrid of these three approaches and are combined into a machine learning pipeline.


2. Steps to build and integrate a Recommendation service

To enhance our shop with an AI-powered recommendation service, we will need these steps:

2.1 Defining our use cases

Decide whether content-based filtering (attribute-focused), collaborative filtering (user behavior-focused), or a hybrid approach fits our use case better.

2.2 Data preparation

Collect product data and user behavior data for feeding the Model based on our use cases.

2.3 Recommendation Model Selection

2.4 Integration

Build a new microservice to expose the recommendation model and integrate it with the front-end. It should be extensible and flexible to switch to different implementations/service providers with minimal changes.