Skip to content

Repository files navigation

Recommendation Engine

A recommendation engine is a system that suggests items, products, or content to users based on their preferences, behavior, or past interactions, Think of it as the smart technology behind the "You might also like" sections you see on your favorite websites. Learning from past choices and comparing them with others, it creates a tailored experience that feels almost like magic, helping businesses engage users better while making life a little easier for everyone

Searching for Similarity

Similarity search is a technique used to find items that are "close" to a given item, based on certain characteristics. To do this, mathematical methods like Euclidean distance and cosine similarity are used

Euclidean Distance

Imagine a flat surface, like a piece of paper. If you place two dots on it, the Euclidean distance is the straight-line distance between them. It's like finding the shortest path between two points on a map. In an e-commerce recommendation system, if two products are plotted close together in this space, they likely share many features. (representing data points) , it means they are more similar. For example, in a e-commerce recommendation system.

Cosine Similarity

Now, think about those same two dots, but instead of looking at their distance, consider the angle between the lines connecting each dot to the origin point (the center). Cosine similarity measures the cosine of this angle. If two vectors point in a similar direction, their cosine similarity will be close to 1 (meaning they are very similar). If they point in opposite directions, it will be -1 (very different).

image

Architecture

  • Product Service: Adds a product to an SQL database and sends a product creation event to RabbitMQ.
  • Event Consumer: Receives the data, sends it to a large language model to convert it into a vector, saves the converted vector into a vector database and into SQL for each product.
  • Order Service: Places an order for the chosen product.
  • Suggest Service: Based on the last order, searches the vector database for similar products and returns the most similar ones.

Recommendation Engine drawio

About

Recommendation engine

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages