Search code examples
neo4jgraph-databasesrecommendation-engine

Building a product recommendation system, collaborative filtering and graph database


When I'm reading about building recommendation systems with collaborative filtering and they generally don't talk about graph databases like neo4j. Are graph databases enough to implement the best recommendation systems?

It seems like they can implement realtime recommendations easier than the methods mentioned here: https://eugeneyan.com/writing/real-time-recommendations/

Any weaknesses I should be aware of or is something like neo4j perfectly suited to the task and nothing else is required?


Solution

  • Neo4j is perfectly suited for this problem. What you must realize is that it makes sense to have a batch process to calculate similarity between users or items when you scale to millions of users and store it to Neo4j. Then you can provide very fast response times. If you want to calculate similarity between millions of users at every step, that might not be the most effective process. So it is a trade-off between precalculated similarities and doing on the fly similarity calculations. For example, you can pre-calculate similarities between items every day and take a window of x days of purchase as your "training" data. Then you can easily provide "Users also bought this" recommendations. There are also options to use more advanced techniques like GNN to provide recommendations. For example look at this project: https://github.com/AliciaFrame/GDS_Retail_Demo

    So all in all, Neo4j is completely suitable for recommendations, there have been books written just about recommendations and graphs (Neo4j).