Overview
Built an AI-driven bundle recommendation engine for the Shopify ecosystem that analyzes store data to generate optimized product bundle configurations. The system processes order history, product relationships, and pricing data to deliver actionable recommendations that increase average order value.
Challenge
Shopify merchants were creating product bundles based on intuition rather than data. Common problems included:
- Arbitrary discount tiers that didn't match customer price sensitivity
- Wrong product combinations that ignored natural purchasing patterns
- Static configurations that never adapted to changing buying behavior
- No feedback loop between bundle performance and bundle configuration
Analysis of 500+ stores showed that 73% of bundle configurations had at least one tier that generated less than 5% of total bundle revenue — effectively wasted real estate.
Solution
Recommendation Engine Architecture
The system analyzes seven distinct signals to generate recommendations:
# Core detection pipeline
class BundleOpportunityDetectorService
DETECTORS = [
:cross_sell_product_addition,
:price_optimization,
:declining_bundle,
:tier_restructure,
:winning_bundle_cloning,
:discount_ladder_rebuild,
:add_premium_tier
].freeze
def detect(shop)
DETECTORS.flat_map { |detector| send(detector, shop) }
.reject(&:nil?)
.sort_by(&:priority)
end
endData Pipeline
Each recommendation type has specific data requirements and confidence thresholds:
| Signal | Min Orders | Trigger | |--------|-----------|---------| | Cross-sell | 30 | Attach rate > 20% | | Price optimization | 40 | RPI variance > 10% | | Declining bundle | 30 | 40%+ order decline | | Tier restructure | 50 | Middle tiers < 10% |
One-Click Apply
Every recommendation generates a complete execution plan. Merchants review projected ROI and apply changes with a single click — no manual configuration needed.
Technical Decisions
Why Ruby on Rails: The Shopify ecosystem is Rails-native. Using the same stack as the platform reduced integration friction and let us leverage Shopify's official gems directly.
Why Redis + Sidekiq: Recommendation generation is compute-intensive. Background processing with Redis-backed queues let us process 10K+ recommendations daily without impacting the main application's response times.
Why PostgreSQL: The analytical queries for recommendation detection (window functions, CTEs, aggregate comparisons) would have been significantly more complex in a NoSQL database.
Results
After 12 months in production across 500+ stores:
- $2.4M ARR for the product itself
- +34% AOV average across stores using recommendations
- +23% upsell rate from entry to premium tiers
- 10K+ recommendations generated and applied daily