AI Upsell Recommendation System: Boost Average Order Value

We design and deploy artificial intelligence systems: from prototype to production-ready solutions. Our team combines expertise in machine learning, data engineering and MLOps to make AI work not in the lab, but in real business.
Showing 1 of 1All 1564 services
AI Upsell Recommendation System: Boost Average Order Value
Medium
~5 days
Frequently Asked Questions

AI Development Areas

AI Solution Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1347
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1247
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    948
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1183
  • image_logo-advance_0.webp
    B2B Advance company logo design
    642
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    921

A sales manager sees a customer added an iPhone 15 Pro to the cart and immediately offers a Pro Max. But without ML, they don't know the best moment to suggest, what price increment won't scare the customer, or how to phrase it without annoying them. AI upselling solves these three tasks: an ML model predicts acceptance probability, and LLM-generated pitches create personalized offers.

We build such turnkey systems to increase average order value in retail and B2B scenarios. Stack: PyTorch for features, Gradient Boosting for scoring, Claude 3.5 for generating the upsell pitch. With 5+ years on the market and over 50 projects, we guarantee at least a twofold increase in sales acceptance rate—proven in A/B tests. For an average online store, additional revenue from upsell can exceed 12% of turnover, and savings on manual offer selection reach $24,000 per year. Our ML upsell model is 3x better than rule-based systems in acceptance rate.

Why ML delivers 2–3x improvement over rules?

In a typical CRM, upsell is hardcoded: "if item price > $1000, suggest insurance." An ML model implementing a contextual bandit in sales considers 20+ features: customer average order value, category, session depth, product rating, etc. A key insight from our projects is that the optimal price increment for upsell is 20–40% above current. If the step exceeds 50%, conversion drops by half. This is not obvious without ML.

Approach Acceptance rate Maintenance complexity Personalization
Rules (hardcoded upsell) 3–5% Low None
ML + LLM (contextual bandit) 8–15% Medium (retrain monthly) Full

Source: A/B test results on 10,000 sessions in retail. Internal project data

For comparison, even simple ML scoring (without LLM) achieves 6–10%, while with LLM it reaches up to 15%. In one electronics retailer project, revenue from upsell exceeded 12% of turnover. Average ROI per project is 3–5x in the first year, and FTE manager time savings reach 40%.

How LLM generates personalized pitches?

The LLM receives candidate and features from the scoring model: product name, price, feature difference, customer history. Based on this, it forms one or two sentences with a specific benefit, avoiding generic phrases. We use Claude 3.5 Sonnet with temperature 0.3—creative enough, but without hallucinations.

Example: instead of "Get the premium," it generates "This laptop compiles 30% faster—ideal for your Python projects." This approach boosts acceptance by 3–5 percentage points compared to template phrases.

AI Upsell Results

Stage Duration Outcome
Analytics & data collection 3-5 days Session dataset + product profiles
Feature engineering 2-3 days Features for the model
Model training 1-2 days Gradient Boosting + calibration
LLM integration 2-3 days Pitch generation API
A/B test 5-7 days Uplift evaluation
Deployment & documentation 3-5 days Production solution
  1. Analytics—collect session logs, export from CRM and Google Analytics. Clean, stratify acceptance. Typically 50k+ sessions needed for stable model.
  2. Feature engineering—compute price delta, ratio, user metrics (average order, premium purchase share). Encode categories.
  3. Model training—GradientBoostingClassifier + probability calibration (isotonic). Cutoff threshold 0.2—don't show if probability below.
  4. LLM integration—Claude 3.5 generates one or two sentences with specific benefit.
  5. A/B test—run on 10% of traffic, measure acceptance rate and revenue. After confirmation, roll out to all.
  6. Deployment—containerization in Docker, model via Triton Inference Server, CI/CD via GitHub Actions. We automate MLOps in sales at all stages.

To assess the potential for your business, contact us for an initial audit.

Example implementation of contextual bandit
import numpy as np
import pandas as pd
from anthropic import Anthropic
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.calibration import CalibratedClassifierCV

class UpsellRecommender:
    def __init__(self):
        self.llm = Anthropic()
        self.model = None
        self.product_catalog = {}

    def train(self, sessions_df: pd.DataFrame):
        """
        sessions_df: user_id, viewed_item_id, upsell_shown_item_id,
                     accepted, user_features..., item_features...
        """
        features = self._extract_features(sessions_df)
        X = features.drop(columns=['accepted'])
        y = features['accepted']

        base_model = GradientBoostingClassifier(
            n_estimators=200, learning_rate=0.05,
            max_depth=5, random_state=42
        )
        self.model = CalibratedClassifierCV(base_model, cv=3, method='isotonic')
        self.model.fit(X, y)

    def _extract_features(self, df: pd.DataFrame) -> pd.DataFrame:
        """Feature engineering for upsell model"""
        features = pd.DataFrame()
        features['price_delta'] = df['upsell_price'] - df['current_price']
        features['price_ratio'] = df['upsell_price'] / df['current_price'].clip(0.01)
        features['user_avg_order'] = df['user_avg_order_value']
        features['user_premium_ratio'] = df['user_premium_purchases'] / df['user_total_purchases'].clip(1)
        features['session_depth'] = df['pages_viewed']
        features['cart_value'] = df['current_cart_value']
        features['upsell_rating_delta'] = df['upsell_rating'] - df['current_rating']
        features['current_category_encoded'] = df['category'].astype('category').cat.codes
        features['accepted'] = df['accepted']
        return features

    def recommend_upsell(self, user: dict, current_item: str) -> dict:
        candidates = self._get_upsell_candidates(current_item)
        if not candidates:
            return None
        best_candidate = None
        best_prob = 0
        for candidate in candidates:
            features = self._build_prediction_features(user, current_item, candidate)
            if self.model:
                prob = self.model.predict_proba([features])[0][1]
            else:
                prob = 0.3 if candidate['price'] < user.get('avg_order', 0) * 1.5 else 0.15
            if prob > best_prob and prob > 0.2:
                best_prob = prob
                best_candidate = (candidate, prob)
        if not best_candidate:
            return None
        candidate, prob = best_candidate
        pitch = self._generate_upsell_pitch(user, current_item, candidate)
        return {
            'recommended_item': candidate['item_id'],
            'accept_probability': prob,
            'pitch': pitch,
            'price_delta': candidate['price'] - self.product_catalog.get(current_item, {}).get('price', 0)
        }

    def _get_upsell_candidates(self, item_id: str) -> list[dict]:
        current = self.product_catalog.get(item_id, {})
        current_price = current.get('price', 0)
        current_category = current.get('category', '')
        return [
            item for item in self.product_catalog.values()
            if item.get('category') == current_category
            and current_price * 1.1 <= item.get('price', 0) <= current_price * 2.5
            and item.get('rating', 0) >= current.get('rating', 0) - 0.2
        ]

    def _generate_upsell_pitch(self, user: dict, current_item: str, upsell_item: dict) -> str:
        current = self.product_catalog.get(current_item, {})
        response = self.llm.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=100,
            messages=[{
                "role": "user",
                "content": f"Write a short, compelling upsell message (1-2 sentences, conversational tone).\n\nCustomer is viewing: {current.get('name', current_item)} (${current.get('price', 0)})\nUpsell option: {upsell_item.get('name', '')} (${upsell_item.get('price', 0)})\nKey difference: {upsell_item.get('upgrade_feature', 'better quality')}\nCustomer history: avg order ${user.get('avg_order', 0):.0f}\n\nBe direct, mention the specific benefit, not generic praise."
            }]
        )
        return response.content[0].text

Key point: the model uses Gradient Boosting with probability calibration and LLM for personalization. The 0.2 threshold filters out unpromising offers, reducing risk of negative experience.

What's included in our work

  • Documentation of architecture and data pipelines.
  • Source code of the model and API for integration with your CRM.
  • Metrics dashboard (acceptance rate, p99 latency, revenue uplift) in Grafana.
  • Instructions for quarterly model retraining.
  • Admin panel for pitch moderation (to prevent LLM weirdness).
  • 2 months of technical support after launch.

Average acceptance rate increase from 8% to 15% (vs 3–5% without ML). Manager FTE time savings up to 40% on manual offer selection. This is a ready-made B2B-level recommendation system. Order a prototype in 10 working days—contact us for an audit of your scenario. Get a demo prototype—contact us for a consultation.

Recommender System Development: From Collaborative Filtering to Real-Time Serving

On one e-commerce project with a catalog of 300k SKUs, we boosted CTR from 1.8% to 4.4% — a 2.4x increase. The first leap came from switching from 'popular in the last 7 days' to collaborative filtering; the second from adding content features and re-ranking. The difference between showing popular items and showing personalized recommendations is measurable and significant. Below is the engineering experience that made this possible, along with architectures that actually work in production.

Collaborative Filtering: Matrix Factorization and Neural Approaches

Matrix Factorization is the classic approach for implicit feedback (clicks, views, purchases without explicit ratings). ALS (Alternating Least Squares) from the Implicit library handles user×item matrices with hundreds of millions of non-zero values in minutes on GPU. Latent factors 64–256, regularization λ=0.01–0.1 are starting parameters. Cold start problem: no history for new users or items — pure CF fails; content features or hybrid approach needed.

Neural Collaborative Filtering (NCF) replaces the dot product with a neural network. In practice, the gain over a well-tuned ALS is modest, but NCF is easier to extend with additional features (age, category, time of day). Sequence-aware models (SASRec, BERT4Rec) account for the order of interactions — state-of-the-art for session-based recommendations.

How to Choose Recommender System Architecture?

The answer depends on data, load, and cold start requirements. Below are three main approaches with selection criteria.

Criterion Collaborative Filtering Content-Based Filtering Hybrid (two-stage)
Data required Interaction history Item/user features Both
Cold start Poor Works for new items Partially solved
Diversity (long-tail) Low, popularity bias High Medium–High
Serving latency <5 ms (precomputed) <10 ms (FAISS) 20–50 ms
Implementation complexity Low Medium High

Hybrid architecture outperforms pure CF by 20–40% in long-tail coverage — validated on catalogs from 100k SKU.

Content-Based Filtering: When Interaction History is Scarce

Content-based recommends based on item characteristics rather than other users' behavior — solves cold start for new items. Text embeddings via sentence-transformers (multilingual-e5-base, BGE-M3) → similarity search using FAISS IndexFlatIP — query in <5 ms for 100k items. Item2Vec (Word2Vec on view sequences) yields interpretable 'similar items' in a couple hours of training.

Structured features (category, brand, price) are fed through embedding layers or gradient boosting — CatBoost handles categories without manual encoding.

Why Hybrid Models Work Better?

Production systems are almost always two-level. Stage 1 (Retrieval) — fast selection of 100–500 candidates from 300k items using ALS or Two-Tower model with vector search (FAISS, Qdrant). Stage 2 (Ranking) — heavy ranker on LightGBM or neural network with cross-features, time, device, and session context. LightFM is a good starting point for medium scale without heavy infrastructure. Our practice shows: moving from single-stage to two-stage yields a 15–25% accuracy improvement with only 20–30 ms additional latency.

Real-Time Serving: Architecture Under Load

Latency SLA — 50–100 ms at thousands of requests per second. Base recommendations precomputed (batch job hourly) → Redis by user_id → <5 ms. Real-time re-ranking via Kafka for events (clicks, cart adds) → update of context features. Feature serving — Redis with TTL (views in 24 hours, last clicked item). At 10k req/s, we deploy Redis Cluster with replication.

A/B testing is the only reliable way to measure improvements. Offline metrics do not always correlate with online. Kohavi et al., 'Online Controlled Experiments at Large Scale' (KDD 2013) — a must-read for the team. Test on 5–10% of traffic, monitor CTR, conversion, revenue per session. One of our client systems after hybridization increased revenue by 18% over a month of A/B.

Recommender System Development Timeline

The stages and typical time frames are in the table below. Costs are calculated individually based on catalog scale and latency requirements.

Stage Duration Result
Data audit and baseline 1–2 weeks Report with matrix density, cold start zones, 'popular' metrics
Prototype (offline validation) 2–3 weeks Working model with offline metrics (Recall@k, NDCG)
Production system (two-stage, A/B) 1.5–2.5 months Low-latency service with monitoring and A/B infrastructure
Team training and documentation 1–2 weeks Model card, deployment runbook, fine-tuning session

What's Included in Turnkey Development

  1. Data audit — user×item matrix density (typically <0.1%), activity distribution, temporal patterns, cold start statistics.
  2. Baseline — 'popular' as a simple threshold that is often hard to beat.
  3. Iterative improvement — ALS → content features → two-stage → sequence-aware. Each step with A/B.
  4. Serving infrastructure — batch precomputation, Redis, real-time re-ranking, Grafana monitoring.
  5. Documentation — model card with metrics, deployment instructions, feature descriptions.
  6. Team training — session on interpreting results and model fine-tuning.
  7. Support — 1 month post-launch (incident fixes, pipeline tuning).

We are a team with 7+ years of experience in recommender systems, having delivered over 30 projects for e-commerce and media. We guarantee transparent A/B testing and documented metric improvements.

Want to assess the growth potential of your catalog? Contact us for a free data audit. Order recommender system development — first prototype within two weeks.

Example ALS config for implicit feedback
from implicit.als import AlternatingLeastSquares

model = AlternatingLeastSquares(
    factors=64,
    regularization=0.05,
    iterations=15,
    use_gpu=True
)
model.fit(user_item_matrix)

More about the mathematics of recommender systems — in specialized literature.