Background

Dynamic AI Personas: Recency-Weighted E-Commerce Intelligence

How HeyDiscount automated individualized shopping personas and category recommendations across millions of users using asynchronous Python ETL pipelines, affinity equations, and prompt-cached LLM clustering.

Background

High-volume e-commerce deal platforms like HeyDiscount and CouponNinja connect millions of shoppers with promotions across thousands of retailers. Historically, platforms delivered generic, one-size-fits-all category pages and blanket email blasts, resulting in declining user engagement and high unsubscribe rates.

We partnered with HeyDiscount to engineer an Algorithmic Affinity Engine & Dynamic LLM Persona Generator. By combining recency-weighted mathematical scoring with asynchronous large language model clustering, the system automatically translates fragmented browsing histories into bespoke shopping personas, adjacent category recommendations, and personalized editorial copy.

The E-Commerce Personalization Bottleneck

Delivering real-time, individual-level shopping intelligence at scale requires overcoming massive data aggregation and inference hurdles:

Generic Blast Disengagement

Blast promotional newsletters treating all subscribers identically resulted in customer unsubscribes and diminishing promotional returns.

Noisy Browsing Signals

Users browse casually across disparate stores, making it difficult to distinguish casual clicks from genuine, high-intent purchasing interests.

Astronomical LLM Token Costs

Running unoptimized, per-user generation prompts across hundreds of thousands of daily active users risked overwhelming API operational budgets.

Sparse Data Cold Starts

New shoppers with under five historical store interactions lacked sufficient history for traditional collaborative filtering engines.

The Solution: Algorithmic Affinity & Prompt-Cached LLMs

We coupled an asynchronous Python data ingestion pipeline with tiered large language model inference and 24-hour prompt caching.

Phase 1: Recency-Weighted Affinity & Adjacent Discovery

An asynchronous batch scoring engine aggregates browsing history across three distinct time horizons to model true purchase intent.

  • Three-Tier Temporal Weighting: Weights user activity across recent store visits (immediate interest), 180 day history (seasonal preferences), and all-time engagement (core brand affinities).
  • Bordering Taxonomy Discovery: Graph mapping identifies 3 to 6 adjacent subcategories providing natural upgrade paths (e.g. coffee beans -> espresso machine accessories).
  • Smart Cold-Start Fallbacks: Automatically falls back to regional trending taxonomy clusters when user browsing signals are sparse.

Phase 2: LLM Persona Synthesis & Editorial Copywriting

Generates cohesive humanized customer profiles and warm editorial copy injected directly into personalized newsletters.

  • Dynamic Persona Clustering: LLMs generate a punchy 2-to-5 word persona title (e.g. "Eco-Conscious Outdoor Adventurer") and an empathetic 1-sentence descriptor.
  • 24-Hour Prompt Caching: Utilizing OpenAI and Vertex AI prompt cache retention reduces API token overhead by over 80% while sustaining rapid nightly batch throughput.
HD
"Personalization in e-commerce usually means spamming users with the last product they looked at. Kaprin built an affinity engine that actually understands context. Our personalized newsletter click-through rates increased by 40%, and our cost-per-inference is practically negligible."
- VP of Growth & Product, HeyDiscount
HeyDiscount Logo

The Outcome: Operational Velocity

40% Higher Click-Through Rates

Tailored persona-specific recommendations and warm editorial copy dramatically boosted newsletter and dashboard click engagement.

85% LLM Cost Reduction

Aggressive 24-hour prompt caching and schema-constrained JSON inference drastically reduced per-user token expenditure.

Temporal Purchase Intent Scoring

Mathematical decay equations accurately balance current browsing intent against historical seasonal preferences.

Zero-Touch Nightly Execution

Asynchronous Python connection pools process and update hundreds of thousands of shopper profiles seamlessly each night.

Dynamic Cross-Category Discovery

Taxonomy graph traversal introduces shoppers to adjacent products, increasing average order value and retailer discovery.