Objective
Co-purchase recommendations are great for "people who bought X also bought Y" but fail on cold-
start: a brand-new SKU has no purchase history yet. Embedding-based similarity solves cold-start
by recommending products whose descriptions mean the same thing — even if no one has ever bought
them together. The wow moment: one Cypher pattern that reads (:Product {name: "..."})-[:SIMILAR_TO > 0.85]->(other)
returns the right answers, no separate vector-DB call.
Step 1: Set up a small catalog with embeddings
// Embedding values are 5-dim demo vectors; in production these come from EMBED('description').
MERGE (h1:Product {sku: "USB-301", name: "USB-C 4-port hub",
description: "Compact aluminum USB-C hub with 4 data ports for laptops",
price: 39.99, embedding: [0.81, 0.04, 0.12, -0.05, 0.21]})
MERGE (h2:Product {sku: "USB-307", name: "USB-C charging hub",
description: "USB-C hub with 3 data ports plus 65W passthrough charging",
price: 54.99, embedding: [0.79, 0.06, 0.10, -0.04, 0.23]})
MERGE (h3:Product {sku: "USB-410", name: "Thunderbolt 4 dock",
description: "Thunderbolt 4 docking station with dual 4K display output",
price: 249.0, embedding: [0.77, 0.02, 0.15, -0.07, 0.25]})
MERGE (k1:Product {sku: "KBD-100", name: "Mechanical keyboard 75%",
description: "Hot-swap mechanical keyboard, 75% layout, RGB backlight",
price: 129.0, embedding: [-0.34, 0.58, 0.21, 0.04, 0.12]})
MERGE (k2:Product {sku: "KBD-105", name: "Wireless mechanical keyboard",
description: "Bluetooth mechanical keyboard with hot-swap switches",
price: 159.0, embedding: [-0.32, 0.60, 0.19, 0.06, 0.11]})
MERGE (m1:Product {sku: "MIC-220", name: "USB condenser microphone",
description: "Cardioid USB condenser mic for podcasting and streaming",
price: 99.0, embedding: [0.07, -0.41, 0.66, 0.10, -0.18]})
MERGE (m2:Product {sku: "MIC-225", name: "XLR studio microphone",
description: "Large-diaphragm XLR studio condenser microphone",
price: 219.0, embedding: [0.09, -0.43, 0.64, 0.08, -0.16]})
MERGE (b1:Product {sku: "BAG-501", name: "Tech messenger bag",
description: "Padded laptop messenger bag with cable organizer",
price: 79.0, embedding: [-0.10, 0.18, -0.55, 0.42, 0.30]});