Item-to-Item Recommendation
Item-to-Item Recommendation
Overview
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 (for example, recommending cereal when someone buys milk instead of just different types of milk). It balances purchase, view, and interaction signals to go beyond simple text matching.
Data Requirements and Schema
To train an item-to-item recommendation model, you 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 (for example, 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 (for example, 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:
Using Embeddings for Similarity Scores
Instead of retrieving static predictions, you 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 trades off latency against freshness.
Building Models with the Kumo Fine-Tune SDK
1. Initialize the Kumo Fine-Tune SDK
2. Create a Connector for Data Storage
3. Select Tables
4. Create Graph Schema
5. Train the Model