AI-Powered Recommendation Systems for E-Commerce
How modern recommendation engines work and how to implement one that drives revenue for your online store.
The Engine Behind “You Might Also Like”
Recommendation systems are among the most commercially impactful applications of AI. Amazon attributes up to 35% of its revenue to its recommendation engine. Netflix estimates that its recommendation system saves the company over $1 billion per year in customer retention.
For Indonesian e-commerce businesses, the opportunity is equally compelling. With a growing online shopper base and increasing catalog sizes, helping customers discover relevant products is no longer optional. It is a revenue driver.
This guide explains how recommendation systems work, which approach fits your business, and how to implement one that delivers measurable results.
How Recommendation Systems Work
Collaborative Filtering
The most intuitive approach. If users A and B have similar purchase histories, items that A bought but B has not seen are good recommendations for B.
User-based collaborative filtering finds similar users and recommends what those users liked.
Item-based collaborative filtering finds items similar to what the user has already interacted with. This approach scales better and is used more widely in production.
import numpy as np
from sklearn.metrics.pairwise import cosine_similarity
# User-item interaction matrix (rows: users, columns: items)
# Values represent ratings or purchase counts
interaction_matrix = np.array([
[5, 3, 0, 1, 0], # User 0
[4, 0, 0, 1, 1], # User 1
[1, 1, 0, 5, 0], # User 2
[0, 0, 5, 4, 4], # User 3
[0, 1, 4, 0, 5], # User 4
])
# Compute item-item similarity
item_similarity = cosine_similarity(interaction_matrix.T)
def recommend_items(user_id: int, n_recommendations: int = 3) -> list:
"""Recommend items based on item-item collaborative filtering."""
user_ratings = interaction_matrix[user_id]
scores = item_similarity.dot(user_ratings)
# Exclude already-rated items
already_rated = np.where(user_ratings > 0)[0]
scores[already_rated] = -1
# Return top N item indices
top_items = np.argsort(scores)[::-1][:n_recommendations]
return top_items.tolist()
# Get recommendations for User 0
recs = recommend_items(user_id=0, n_recommendations=2)
print(f"Recommended items for User 0: {recs}")
Content-Based Filtering
Recommends items similar to what the user has liked before, based on item attributes (category, brand, price range, description text).
This approach works well for new items that lack interaction data (the cold-start problem) because recommendations are based on item features rather than user behavior patterns.
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
# Product descriptions
products = [
{"id": 1, "name": "Batik Shirt", "desc": "Traditional Javanese batik cotton shirt"},
{"id": 2, "name": "Silk Sarong", "desc": "Hand-woven silk sarong Balinese pattern"},
{"id": 3, "name": "Batik Dress", "desc": "Modern batik cotton dress Indonesian design"},
{"id": 4, "name": "Leather Bag", "desc": "Genuine leather crossbody bag handcrafted"},
{"id": 5, "name": "Rattan Basket", "desc": "Traditional woven rattan storage basket"},
]
descriptions = [p["desc"] for p in products]
tfidf = TfidfVectorizer()
tfidf_matrix = tfidf.fit_transform(descriptions)
similarity = linear_kernel(tfidf_matrix, tfidf_matrix)
def get_similar_products(product_idx: int, n: int = 2) -> list:
"""Find products similar to the given product."""
sim_scores = list(enumerate(similarity[product_idx]))
sim_scores = sorted(sim_scores, key=lambda x: x[1], reverse=True)
# Exclude the product itself
return [products[i]["name"] for i, _ in sim_scores[1:n+1]]
# Find products similar to "Batik Shirt"
similar = get_similar_products(0)
print(f"Similar to Batik Shirt: {similar}")
Hybrid Approaches
Production systems almost always combine multiple techniques. A typical hybrid system might use:
- Collaborative filtering for users with sufficient interaction history
- Content-based filtering for new users or new items
- Popularity-based recommendations as a fallback
- Business rules to enforce constraints (inventory levels, margin targets, promotional items)
Deep Learning Approaches
Modern recommendation systems increasingly use deep learning. Neural collaborative filtering, sequence-aware models (treating browsing history as a sequence), and transformer-based architectures capture more complex patterns than traditional methods.
For larger Indonesian e-commerce platforms processing millions of interactions daily, these approaches deliver meaningful accuracy improvements.
Designing Recommendations for Indonesian E-Commerce
Understanding Local Shopping Behavior
Indonesian online shoppers exhibit distinct patterns that your recommendation system should account for:
Price sensitivity. Many shoppers actively compare prices across platforms. Recommendations should consider price range preferences and highlight value propositions.
Flash sale and promotion driven. Indonesian e-commerce is heavily event-driven (Harbolnas, Ramadan sales, payday promotions). Your recommendation system should adapt to these temporal patterns and promote relevant deals.
Social proof matters. Products with more reviews and higher ratings carry significant weight. Incorporate social signals into your recommendation scoring.
Mobile-first browsing. Over 90% of Indonesian e-commerce traffic comes from mobile devices. Recommendation interfaces must work within mobile screen constraints, typically showing 2 to 4 items at a time.
Where to Place Recommendations
| Placement | Strategy | Expected Impact |
|---|---|---|
| Homepage | Personalized picks, trending items | Increase session depth |
| Product page | ”Similar items,” “Frequently bought together” | Increase AOV |
| Cart page | Cross-sell complementary items | Increase AOV 15 to 25% |
| Search results | ”You might also like” alongside results | Reduce bounce rate |
| Post-purchase email | ”Based on your recent purchase” | Drive repeat purchases |
| Empty cart / wishlist | Popular items in browsed categories | Re-engage users |
Handling the Cold-Start Problem
New users and new products have no interaction history. Address this with:
- New users: Use demographic data, referral source, or device type to make initial recommendations. As soon as the user interacts with a few items, switch to personalized recommendations.
- New products: Use content-based features (category, price, description) to place the product alongside similar items. Boost new products in recommendations to gather initial interaction data.
Implementation Roadmap
Phase 1: Quick Wins (Week 1 to 2)
Implement non-personalized recommendations that still drive revenue:
- “Best sellers in this category”
- “Customers who bought this also bought”
- “Recently viewed items”
These require minimal ML infrastructure and provide immediate value.
Phase 2: Basic Personalization (Week 3 to 6)
Implement collaborative filtering using your existing purchase and browsing data. Start with item-based collaborative filtering, which is computationally efficient and effective.
Phase 3: Advanced Personalization (Month 2 to 3)
Add content-based filtering, hybrid scoring, and real-time session-based recommendations. Implement A/B testing infrastructure to measure the impact of each change.
Phase 4: Optimization (Ongoing)
Continuously refine your models based on A/B test results. Explore deep learning approaches, real-time recommendation updates, and multi-objective optimization (balancing relevance, diversity, and business goals).
Measuring Success
Track these metrics from the start:
- Click-through rate (CTR): Percentage of shown recommendations that users click
- Conversion rate: Percentage of recommendation clicks that lead to purchases
- Average order value (AOV): Change in order value attributable to recommendations
- Revenue per session: Overall revenue impact
- Catalog coverage: Percentage of your catalog that appears in recommendations (avoid recommending only popular items)
- Diversity: How varied the recommendations are (avoid showing the same items repeatedly)
A/B test every significant change. Compare your recommendation system against a baseline (random or popularity-based) to quantify the actual business impact.
Technical Considerations
Scalability. If your catalog has 100,000 products and 1 million users, precomputing all recommendations is impractical. Use approximate nearest neighbor algorithms (FAISS, Annoy) for efficient similarity searches at scale.
Real-time updates. User preferences change during a session. Incorporate real-time signals (current session clicks, cart additions) alongside historical data.
Privacy. Be transparent about data usage. Comply with Indonesian data protection regulations (PDP Law). Allow users to control their recommendation preferences.
Getting Started
You do not need a massive dataset or a team of ML researchers to start delivering valuable recommendations. Begin with simple, rule-based approaches, measure their impact, and progressively introduce ML-powered personalization.
Idea Comindo has implemented recommendation systems for Indonesian e-commerce businesses ranging from growing startups to established marketplace platforms. We help you choose the right approach for your catalog size, traffic volume, and business objectives, then build and deploy a system that drives measurable revenue growth.