Product recomendation

I'm absolute beginner in Neo4j (noob). I started to search product that would allow me to build product recommendation service and Internet brought me here. I installed Neo4j base and... I do not know how to go further.
Will somebody be so kind to help me?
I have product purchase history :
customer_no, product_no, product_description, quatity, value

  • How to create such "databasee" in Neo4j that will handle this list (90thousands of articles)?
  • How to create such rows in Neo4j? I will be using Pentaho so I think I need query for one article in a row.

Then I need query that will show me (parameter will be client_no and/or product_no/product_numbers):

  • What are the top 5 products (by quantity or value) that others clients bought and this client did NOT buy?
  • What are the top 5 products (by quantity or value) that other customers have bought and were not bought by our customer where the customer and others have bought same products (same purchase list).


Hi @Gosforth, Welcome to the community :slight_smile:

If you haven't done so yet then is suggest going trough pages
Tons of useful information. The best way to start is by taking an introduction course at GrapAcademy.

If you are already done that - then when you start your project.
Start with creating a model. There is a great site, that allows you easily draw your graph model - also a picture of this model can be helpful when u ask questions on community site - visualizing your data/model allows people to get to the same page with you in the seconds.

Like so

You can also export/import markup to share with others:

<ul class="graph-diagram-markup" data-internal-scale="1" data-external-scale="1">
  <li class="node" data-node-id="0" data-x="144.9724578857422" data-y="-915.5915303230286">
    <span class="caption">Product</span><dl class="properties"><dt>product_no</dt><dd>'10010'</dd><dt>description</dt><dd>'some description'</dd><dt>quantity</dt><dd>'2'</dd><dt>value</dt><dd>'101'</dd></dl></li>
  <li class="node" data-node-id="4" data-x="-558.7125917673111" data-y="-915.5915303230286">
    <span class="caption">Customer</span><dl class="properties"><dt>customer_no</dt><dd>'1231'</dd></dl></li>
  <li class="relationship" data-from="4" data-to="0">
    <span class="type">has_bought</span>

What are the top 5 products (by quantity or value) that other clients bought and this client did NOT buy?

//Maybe this query would do: 
//Find top 5 products bought by other Customers & not this_client
WITH '1010' as this_client 
MATCH (c:Customer)-[:has_bought]->(p:Product) 
	WHERE NOT c.customer_no = this_client
RETURN p.product_no, sum(p.value) as valueSum
ORDER by valueSum DESC 

It will be easier to test and create your queries once you create some test data (that you can also share here) - so people could quickly input it and play with queries.

Also on the Recomendation engine - check out this thread, play with that movie graph sample - that can give you ideas for your own project.


Thank you very much for your help! I will play with your recommendation.
Have a great day!