Item-to-Item Recommendation
Solution Background and Business Value
Item-to-item recommendations help users discover products similar to what they are currently viewing or have purchased. This technique powers features like “You might also like” and “Frequently bought together” on e-commerce platforms. These recommendations:
-
Increase customer engagement by surfacing relevant products.
-
Boost conversion rates by promoting co-purchased or similar items.
-
Enhance personalization by learning from user behavior patterns.
Kumo AI can generate rich item embeddings optimized for co-purchases, not just semantic similarity (e.g., recommending cereal when someone buys milk instead of just different types of milk). It balances signals from purchases, views, and interactions to improve recommendations beyond simple text matching.
Data Requirements and Schema
To train an item-to-item recommendation model, we need structured data that captures relationships between items based on user behavior.
Core Tables
-
Purchase Item Pairs Table
-
Captures item co-occurrence based on user behavior (e.g., items bought in the same order or session).
-
Key attributes:
-
item_id_lhs
: The primary item (left-hand side). -
item_id_rhs
: The similar/co-purchased item (right-hand side). -
Optional: Purchase session, timestamps, user interactions.
-
-
-
Items Table (LHS & RHS)
-
Represents unique items in the dataset (even if LHS and RHS contain the same data, Kumo requires them as separate tables).
-
Key attributes:
-
item_id
: Unique product identifier. -
Optional: Category, price, brand, description, image embeddings.
-
-
-
Users Table (Optional)
-
Stores customer details that can improve recommendations.
-
Key attributes:
-
user_id
: Unique identifier. -
Optional: Location, demographics, past purchase patterns.
-
-
Entity Relationship Diagram (ERD)
Predictive Queries
The following predictive query ranks the top 20 most relevant items for each product:
Time-Based Ranking
If you want to factor in temporal dynamics (e.g., trends over the last N days):
Handling Cold-Start Items
For businesses where new items frequently appear, consider enabling Kumo’s cold-start handling in the model plan:
This ensures the model learns from item attributes when no purchase history exists.
Deployment Strategy
Batch Recommendations in a Key-Value Store
A common way to serve item recommendations is to precompute them and store them in a key-value store for low-latency retrieval:
At runtime, the application retrieves recommendations instantly for a given product.
Using Embeddings for Similarity Scores
Instead of retrieving static predictions, we can use dot product similarity between embeddings to dynamically compute item similarity scores. This enables:
-
Personalized recommendations based on the user’s session.
-
Real-time filtering to exclude items already viewed by the user.
Example workflow:
-
Cache top-10 recommendations for each item in a key-value store.
-
Store LHS and RHS embeddings in a vector database.
-
During a session:
-
Show cached recommendations first.
-
If the user exhausts cached items, backfill recommendations dynamically using dot product similarity.
-
This hybrid approach balances speed and flexibility.
Building models in Kumo SDK
1. Initialize the Kumo SDK
2. Create a Connector for Data Storage
3. Select tables
4. Create graph schema
5. Train the Model