Hyp.

Article

Architecting a realtime intent-scoring engine for e-commerce from scratch

By Ed Brocklebank

Best for medium to large e-commerce stores.

Architecting realtime intent scoring

Following on from my recent musings about CRM and growing e-commerce businesses, I thought I'd throw out a concrete example I've been experimenting with.

Imagine a system that monitors every shopper as they navigate around an e-commerce store. It records behaviours as events (standard, all modern CRM systems do this), but I've added a couple of twists to improve how personalised an experience everyone gets.

Lambda IEI and Intent Scoring.

Lambda IEI?

What is Lambda IEI, I hear you cry?

  • IEI = Intent Event Interval.
  • Lambda = Rate of change.

IEI measures a user's natural cadence of shopping. Some people like to take their time browsing slowly, others are in a hurry.

The Lambda bit makes it a rate so it's comparable across shoppers.

Lambda IEI fluctuates constantly throughout each shopper's session as they speed up or slow down.

Intent scoring

In addition to Lambda IEI, the system also computes an intent score per user.

This intent score uses some fancy maths, but to keep it simple, think of it as a sum of different event scores over time, with each event score being decayed based on how long ago it happened.

For example, a product view 10 minutes ago is not worth as much as a cart view 5 minutes ago, or a search 1 minute ago.

(The intent score also takes into account Lambda IEI, so naturally slow shoppers are not penalised).

The system calculates this score in realtime as well as tracking the peaks, troughs, and rate of acceleration or deceleration in short time windows.

Here's an example of my intent score during a browsing session over the past 15 minutes. Each dot on the chart is an intent event recorded by the system. The height of the dot represents intent.

Hyp intent scoring graph

Taking action

The peaks, troughs, and rate of change of this intent score give clear signals when you might want to intervene to guide the shopper, or even save the sale.

But that's not all.

Intent score only gives you an indication of what someone is doing in THIS session. It doesn't tell you what products, brands, and categories they like or buy. It doesn't tell you their persona, or relationship to your store (are they a prospect, one time buyer, researcher, considerer, etc).

That's where the slower-moving affinity scores and shopper-state axes I mention in another article come into play.

See below for an example of the kind of micro-clusters and journey-state data that can be identified.

Hyp Audience Map

These are warm (hourly computed) and cold (nightly computed) attributes which provide additional context and inform what action you should take.

Slap all this behind an API and you get the beginnings of a realtime decision engine, capable of knowing your user at an individual level and intervening far better than a static rules-based system ever could.

This API can be called by any system just to get useful information about the user in the moment:

"state": {
    "liveIntentLevel": "low",
    "smoothedScore": 85,
    "effectiveIntentScore": 63,
    "liveMomentum": "flat",
    "liveActivity": "active",
    "liveCartPresence": "has_items",
    "liveCartRecency": "stale",
    "liveCartProgress": "evaluating_after_cart",
    "livePeakContext": "none",
    "lastUpdated": "2026-06-02T17:20:30.587Z",
    "brandAffinities": ["Murphy's Magic", "TCC Magic"],
    "categoryAffinities": ["Mentalism", "Card Magic", "Dice"]
}

Or, taken a step further, it can return exactly what to do next:

"decisions": {
    "inline_slot_1": {
        "show": true,
        "intervention": {
            "id": "discount_inline_v1",
            "type": "inline",
            "slotId": "inline_slot_1",
            "templateId": "discount_inline_v1",
            "templateVersion": 1,
            "templateKind": "discount"
        },
        "content": {
            "eyebrow": "Limited time",
            "heading": "Save 10% on this order",
            "body": "Use code SAVE10 before you leave the store.",
            "cta": {
                "label": "Shop now",
                "href": "/basket"
            }
        }
    }
}

Here's an example of a discount banner being injected onto a PLP page:

Hyp Intervention Example

Rule-based vs Self-directed on-site personalisation

What’s different about this compared to normal on-site personalisation?

Regular on-site personalisation

  • Based on static rules, not individual shoppers
  • Hand-built by marketer
  • Limited number of interventions
  • All matching shoppers get the same experience
  • No taking into account personas or realtime intent

This approach

  • Some rules, some AI
  • Takes into account each user's unique journey
  • Thousands of intervention variants
  • Deployed by AI
  • Shows interventions tailored to the user’s affinities and persona

What’s next?

I’m continuing to improve the algorithms that go into making these realtime decisions for shoppers, as well as building out contextual bandits and reports to monitor performance, plus the AI agents sitting on top of everything deciding what interventions with what content should be served based on the intent scores it is seeing.