AI System for Reactivating Inactive Customers

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 System for Reactivating Inactive Customers
Medium
~1-2 weeks
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

80% of reactivation attempts for "dormant" customers fail due to template emails and poor timing. Acquiring a new customer costs 5–7 times more than retaining an existing one, but standard discount campaigns yield only 2–5% response. We develop an AI system that analyzes inactive customer behavior, identifies churn reasons, and generates a personalized offer for each segment — from segmentation to sending.

Why Standard Reactivation Campaigns Fail

The typical mistake is sending identical coupons to the entire database. As a result, 80% of users ignore the emails, and 5% unsubscribe. The problem is that different segments require different approaches: some left due to poor service, some due to high prices, and others simply forgot about the store. Our system identifies 5–7 segments using customer churn analysis and selects a unique strategy for each.

How We Segment Inactive Customers

We use a combination of KMeans clustering and LLM: the model groups customers by numeric attributes (days inactive, total orders, frequency, recency of last purchase), and then the neural network describes each segment and proposes a reactivation strategy. Below is an example implementation in Python using the Anthropic Claude API.

import pandas as pd
import numpy as np
from sklearn.cluster import KMeans
from sklearn.preprocessing import StandardScaler
from anthropic import Anthropic

class InactiveCustomerAnalyzer:
    def __init__(self, inactivity_threshold_days: int = 90):
        self.threshold = inactivity_threshold_days
        self.llm = Anthropic()
        self.scaler = StandardScaler()

    def identify_inactive(self, customers_df: pd.DataFrame,
                           last_activity_col: str = 'last_purchase_date') -> pd.DataFrame:
        """Identify inactive customers"""
        customers_df['days_inactive'] = (
            pd.Timestamp.now() -
            pd.to_datetime(customers_df[last_activity_col])
        ).dt.days

        inactive = customers_df[
            customers_df['days_inactive'] >= self.threshold
        ].copy()

        return inactive

    def segment_inactive(self, inactive_df: pd.DataFrame) -> pd.DataFrame:
        """Cluster inactive customers by behavior pattern"""
        features = pd.DataFrame()

        features['days_inactive'] = inactive_df['days_inactive']
        features['total_orders'] = inactive_df.get('total_orders', 1)
        features['avg_order_value'] = inactive_df.get('avg_order_value', 0)
        features['order_frequency'] = inactive_df.get('order_frequency', 0)
        features['last_order_value'] = inactive_df.get('last_order_value', 0)
        features['support_issues'] = inactive_df.get('support_tickets_total', 0)

        X = self.scaler.fit_transform(features.fillna(0))

        km = KMeans(n_clusters=5, random_state=42, n_init=10)
        inactive_df['segment'] = km.fit_predict(X)

        # Describe segments
        segment_profiles = features.copy()
        segment_profiles['segment'] = inactive_df['segment']
        segment_stats = segment_profiles.groupby('segment').mean()

        # LLM names each segment
        for seg_id in range(5):
            if seg_id not in segment_stats.index:
                continue
            stats = segment_stats.loc[seg_id].to_dict()
            stats_str = ", ".join([f"{k}: {v:.1f}" for k, v in stats.items()])

            response = self.llm.messages.create(
                model="claude-3-5-sonnet-20241022",
                max_tokens=100,
                messages=[{
                    "role": "user",
                    "content": f"""Name this inactive customer segment (3-5 words) and suggest reactivation approach.

Stats: {stats_str}

Return: "Segment Name | 1-sentence strategy" """
                }]
            )
            print(f"Segment {seg_id}: {response.content[0].text}")

        return inactive_df


class ReactivationCampaign:
    """Reactivation campaign with personalization"""

    def __init__(self):
        self.llm = Anthropic()
        self.reactivation_offers = {
            0: {'discount': 20, 'message_theme': 'we_miss_you'},
            1: {'discount': 15, 'message_theme': 'best_of_what_they_liked'},
            2: {'discount': 10, 'free_shipping': True, 'message_theme': 'new_arrivals'},
            3: {'special_access': True, 'message_theme': 'exclusive_comeback'},
            4: {'survey': True, 'small_incentive': True, 'message_theme': 'help_us_improve'},
        }

    def create_reactivation_email(self, user: dict, segment: int) -> dict:
        """Personalized reactivation email"""
        offer = self.reactivation_offers.get(segment, {'discount': 10})
        days_inactive = user.get('days_inactive', 90)
        past_categories = user.get('top_categories', ['products'])

        response = self.llm.messages.create(
            model="claude-3-5-sonnet-20241022",
            max_tokens=300,
            messages=[{
                "role": "user",
                "content": f"""Write a reactivation email for an inactive customer.

Customer: {user.get('first_name', 'Customer')}
Inactive for: {days_inactive} days
Past purchases: {', '.join(past_categories[:3])}
Offer: {offer}

Requirements:
- Subject line (engaging, personal, 50 chars max)
- Body (150 words max, warm tone, mention specific past interest)
- Clear CTA

Return JSON: {{"subject": "...", "body": "...", "cta": "..."}}"""
            }]
        )

        try:
            import json
            return json.loads(response.content[0].text)
        except Exception:
            return {'subject': f"We miss you, {user.get('first_name', '')}!",
                    'body': response.content[0].text[:400], 'cta': 'Come Back'}

    def predict_reactivation_probability(self, user: dict,
                                          offer: dict) -> float:
        """Probability of reactivation with given offer"""
        # Simplified heuristic (in reality, a trained model)
        base_prob = 0.05  # Base probability

        # Factors that increase probability
        if user.get('total_orders', 0) > 5:
            base_prob += 0.05  # Loyal customer
        if user.get('days_inactive', 999) < 180:
            base_prob += 0.08  # Recently left
        if offer.get('discount', 0) >= 20:
            base_prob += 0.06  # Good discount
        if user.get('email_open_rate', 0) > 0.3:
            base_prob += 0.04  # Opens emails

        return min(base_prob, 0.4)

Conversion Table by Time Windows

Inactivity Period Average CRR Recommended Offer
0–90 days 15–20% Reminder + exclusive content
90–180 days 10–15% Personalized discount 15–20%
180–365 days 5–10% Strong offer (25%+ discount or free shipping)
> 365 days 2–5% Survey + small incentive (5% discount)

What LLM Brings to Reactivation

LLMs (Large Language Models) generate personalized texts that consider each customer's purchase history and preferences. Instead of a generic "We miss you," the model creates an email mentioning a specific product or category the customer previously bought. This increases open rates (OR) by 20–40% and conversion rates (CRR) by 2–3 times compared to mass mailings. Additionally, LLMs interpret segments — automatically giving them names like "Price Skeptics" or "Forgotten Shoppers" — which simplifies strategy setup.

Comparison: Traditional vs AI Approach

Criteria Traditional Approach AI Approach with LLM and ML
Segmentation Single attribute (recency) Multidimensional clustering + interpretation
Personalization Template emails Unique text generation per customer
Discount targeting Uniform discount Differentiated offer by segment
Setup time 1–2 days 2–3 weeks (initial), then automated
CRR on test sample 3–5% 12–20%

Case Study: 12% Reactivation in One Month

One project involved an electronics e-commerce store with a database of 50,000 inactive customers. We implemented the described system, segmented customers into 6 groups, and generated personalized emails via the Claude API. Result: 12% returned within a month, with an average repeat purchase value of 3,500 rubles. Conversion was 3 times higher than in the previous campaign using template emails.

What's Included

  • Database audit: analyze current data, identify gaps, recommend missing fields.
  • Segmentation model development: feature selection, clustering, segment interpretation via LLM.
  • Personalized email generator: integration with Anthropic/OpenAI, templates for different segments, A/B headline testing.
  • Monitoring dashboard: metrics for CRR, ROI, CTR, OR. Automated reports.
  • CRM integration: module to export segments and generated offers via REST/SOAP API.
  • Team training: 2-hour session on campaign management and trigger setup.
  • Result guarantee: first 3 months of support plus model adjustment to your data.

Timeline and Pricing

A basic version with one campaign can be launched in 2–3 weeks. Full turnkey implementation with multiple segments and integration takes 1 to 2 months. Pricing is calculated individually depending on database size and integration complexity. We'll evaluate your project within 1 day — just reach out.

Our track record: 5+ years of AI/ML experience, 20+ projects successfully deployed in e-commerce and retail. Certified specialists in Hugging Face, LangChain, Anthropic. We don't just launch a model — we guarantee metric improvement and provide full documentation.

Ready to test the system on your database? Request a demo — we'll show how segmentation works on your data. Get a consultation for your project — write to us.

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.