tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Graph RAG > Building a Product Catalog Knowledge Graph for ShopMax India

Building a Product Catalog Knowledge Graph for ShopMax India

Author: Venkata Sudhakar

ShopMax India sells thousands of electronics products across categories like TVs, smartphones, appliances, and accessories. Customers frequently ask 'Which headphones work with my OnePlus phone?' or 'What accessories are compatible with this Samsung TV?' A relational database handles these queries with multi-table joins, but as compatibility rules grow - brand partnerships, technical specs, accessory bundles - the join complexity explodes. Neo4j models products, categories, brands, and compatibility as a property graph, turning complex compatibility queries into simple Cypher traversals.

The product graph uses four node labels: Product (name, price, sku), Category (name), Brand (name), and Tag (value for specs like '4K' or 'Bluetooth 5.0'). Relationships include BELONGS_TO (product to category), MADE_BY (product to brand), COMPATIBLE_WITH (product to product), and HAS_TAG (product to tag). To find accessories for a product, traverse COMPATIBLE_WITH. To find all 4K TVs under Rs 50000, match products with a HAS_TAG '4K' edge and filter by price property.

The example below creates ShopMax India catalog with 6 products across 3 categories, adds compatibility links between products and accessories, then runs three catalog queries: find compatible accessories, find products by spec tag, and find cross-brand compatible pairs.


It gives the following output,

Accessories for Samsung 65 QLED:
  Samsung Wall Bracket - Rs 2500
  Sony 8K HDMI Cable - Rs 1200

All 4K products:
  Sony Bravia 55 - Rs 62000
  Samsung 65 QLED - Rs 85000

In production, add a weight property to COMPATIBLE_WITH relationships to rank accessories by popularity or margin. Use ALSO_BOUGHT relationships derived from order history to power 'frequently bought together' recommendations on the ShopMax India product page. Index Product.sku and Product.price for fast lookups. For the recommendation engine, combine graph traversal (COMPATIBLE_WITH, ALSO_BOUGHT) with vector similarity on product embeddings to handle cases where compatibility data is incomplete - the graph gives precise matches and vectors fill gaps with semantic similarity.


 
  


  
bl  br