Concept Overview

PULSE

Programmatic Unified Loyalty Statistical Engine

Meet PULSE: an autonomous agent that takes loyalty opportunities from raw concept to monetization through a simple conversation.

This document is the companion to the prototype: the problem it goes after, the strategy behind it, how it is built, and the calls made along the way. It follows the agent from a behavioral signal through to a launch-ready campaign with governance built in.

01
Section 01
Problem Statement

Retailers hold rich customer intelligence, but turning it into measurable partner revenue can be slow and complex. Real-time incrementality insights could help unlock opportunities faster and identify which campaigns create new demand and margin.

The Solve

Detect behavioral shifts in real time, apply dynamic reward caps with holdout baselines to prove net lift, and automatically package zero-PII clean-room payloads for instant brand partner co-funding. PULSE packages that work as a repeatable product, replacing manual cohort pulls with an autonomous, launch-ready agent.

02
Section 02
Strategy

Core Strategic Shifts

From Late Reports to Instant Action

Act on slipping customers the moment purchase cadence changes, rather than reviewing churn weeks later in post-mortem reports.

From Wasted Discounts to Protected Margins

Deploy targeted behavioral cues with deterministic budget ceilings attached, eliminating unbudgeted promotional point liability.

From Guesswork to Causal Proof

Every campaign initiates an automated synthetic holdout group, giving Finance and CPG partners verified incremental sales lift.

From Analyst Backlogs to Agentic Workflows

Enable marketers to design, power-check, and launch safe experiments guided by PULSE, removing weeks of custom engineering tickets.

Strategic Considerations

  • Data Foundation & Architecture. AI models are only as effective as the underlying data feeds. In MarTech, timing and context are everything.
  • Separate Conversational Intent from Automated Execution. Let the model read what the marketer wants. Let deterministic code decide what gets spent: rules, budget caps, and privacy policies are enforced outside the model, before any reward is triggered.
  • Decouple Event Triggering from Impact Measurement. Trigger in real time. Measure on the category's own purchase cycle, which runs far slower.
  • Build on Zero-Copy Data Foundations. Queries execute directly against the core data foundation, eliminating redundant pipelines, data drift, and synchronization failures.
  • Design for Governed Clean-Room Collaboration. Settle on one privacy-safe way to share, so a brand partner can co-fund a campaign without raw customer data ever leaving the warehouse.
  • Interoperability & Workflow Integration. AI capabilities are worthless if marketers cannot easily activate them within their daily workflows.
03
Section 03
The Solution

How it runs

All you have to do is check your Loyalty program's PULSE.

PULSE Agentic Parser

Turns the request into a tool call

The marketer's prompt is read for intent and routed to the first tool, query_behavioral_cohort.

Loyalty Data Engine

Queries the panoramic profiles

DuckDB runs the query across transaction, behavioral, and zero-party attributes. Returns high-risk trends.

Cue Rule & Experimentation Engine

Sets the reward and holds back a control

configure_cue_experiment applies the point-liability cap and splits the audience 80/20, holding back a synthetic control when needed so lift can be measured.

Monetization · Clean Room Transformer

Packages a privacy-safe audience

export_clean_room_payload applies differential-privacy noise and hashed tokens, drops raw PII, and suppresses the export entirely if the cohort falls below the k-anonymity threshold.

Dual delivery

Chat reply and on-screen metrics

The result comes back as a plain-English answer in the conversation and as the prediction panel, with every projection tagged FORECAST.

Signal Detection (stage 1)

Autonomous opportunity discovery

The signal engine continuously monitors the member base and compiles an Opportunity Feed of ranked, high-impact behavioral segments. Opportunity cards highlight critical segments (such as premium brand switchers or lapsed category buyers) with pre-computed cohort metrics, allowing marketers to immediately evaluate and launch targeted experiments without manual discovery.

The agent (stage 2)

The agent and its tools

Six deterministic business tools, orchestrated by an AgentRunner:

ToolPurpose
query_behavioral_cohortSize a group by category / risk / stated preference
query_widened_cohortBroaden a group to grow the treated audience
check_experiment_powerIs the group big enough to measure reliably?
configure_cue_experimentSet reward, 80/20 split, liability, forecasts
evaluate_experiment_governanceApply the autonomy policy
export_clean_room_payloadPackage a privacy-safe, aggregated audience

Governed autonomy

Act on the small calls, escalate the big ones

Before anything runs, the agent checks the play against the governance policy:

Pattern A

Handled automatically

Too small but low cost → it adds a look-alike comparison group itself.

Pattern B

Needs your decision

Small group → it pauses and offers one-click actions: add a comparison group, widen the audience, or skip the test.

Pattern C

Good to go

Group is big enough. Proceed with a normal hold-back comparison group.

Pattern D

Test skipped

Direct send, no comparison group, no readout. The trade-off is stated plainly.

The principle: decide the low-risk calls, escalate the consequential ones for a Human to act.

Statistical Integrity

Forecasting, precision, and design-time validity

The scenario modeling engine projects four key metrics: Expected Lift, Expected Extra Value, Cannibalization Risk, and Points Budget Liability. Each projection is explicitly designated as a FORECAST to maintain strict analytical integrity:

Design-Time Power vs. Post-Campaign Significance

Statistical p-values can only be evaluated after campaign data is collected. Presenting significance on pre-campaign simulations is mathematically invalid. PULSE reports statistical power and minimum detectable effect (MDE) at design time to guarantee the experiment can reliably measure true lift once active.

The bigger Picture.

One continuous loyalty-experimentation lifecycle

The prototype builds stages 1–2 of the end to end process.

01
Detect
Surface signals
Built
02
Design & Predict
Test + forecast
Built
StageStatusIn PULSE
Signal DetectionBuiltThe engine scans the member base and surfaces an Opportunity Feed of ranked, plain-English signals.
Conversational DesignBuiltSelecting a signal hands it to the agent, which sizes the group, runs a power check, sets the reward, applies governance, and packages the audience.
Scenario PredictionBuiltDesign-time forecasts (lift, extra value, cannibalization, budget) with power + minimum-detectable-effect, framed as predictions, not results.
ActivationNextTreatment exposure, redemption event stream, live liability-burn tracker.
In-flight monitoringNextLive data collection as the campaign runs.
Measured resultsNextActual lift vs. control, real statistical significance, ROI.

The deliberate choice: stages 1–2 are a forecast; significance and ROI belong to stage 5. PULSE never dresses a prediction up as a result.

Commercial Impact

Platform outcomes & enterprise value

Attach Rate

A Loyalty Data Engine that earns revenue instead of storing history, which gives the wider platform a reason to be bought alongside it.

Incremental Margin

Gross margin lift that is net-new and provable, because every campaign runs against an automated synthetic control holdout rather than a before-and-after guess.

Point Liability

Promotional expense that cannot run away, because budget ceilings and reward caps are enforced before any trigger fires rather than reconciled afterwards.

Zero-Copy Monetization

CPG brand partners co-funding audience campaigns through clean rooms, with no manual ETL and no raw customer data leaving the warehouse.

04
Section 04
The Build

How it was made

From research to running software in four days

The starting point was research rather than code. The public writing of a major enterprise loyalty provider, its published thinking on measuring return on loyalty data and its client results, was analyzed with Gemini to find where an agentic product could earn its place inside an existing platform. That analysis is what produced the problem statement and the concept. Both were then written up as a single detailed prompt and handed to Claude Code as the starting point for the build.

4
days
30+
commits
2,673
lines of Python

Pair-programmed with Claude Code. The loop was simple: describe the intent in plain English, get running code back in the same sitting, then judge the result by using it rather than by reading a description of it.

Prompting a rough prototype into existence is an excellent mechanism for sharpening a definition, and that is most of what happened here. The first version was deliberately rough and running, because a working thing surfaces the real problem in an afternoon where a specification takes a week to do the same job. The building was never the constraint. Deciding what the product should claim, and what it should refuse to claim, took considerably longer than generating it.

What the assistant did, and what it did not

Claude Code wrote nearly all of the code. None of the decisions that make the result defensible came from it.

  • The language kept drifting technical. “Cohort” became “group” and “synthetic control” became “comparison group”, more than once, because the material a model draws on is written by data scientists for data scientists. Every label and every reply had to be pulled back toward how a marketer would actually say it.
  • Most of the work was deciding, not building. What to claim and what to withhold, when the agent should act on its own and when it should stop and ask, which stages to build completely rather than gesture at, how much detail helps a business reader before it starts working against them. A significance figure on a forecast, for instance, would have been generated without objection and would have been wrong. The model had no opinion on any of it, and would have been just as content producing the version that overstated.

Versioning & honesty

What it is, and what it isn't

  • Numbers come from synthetic data, and the statistical formulas are illustrative rather than a production engine.
  • Stages 3–5 of the end-to-end experimentation lifecycle(activation, monitoring, measured results) are not built. The app is careful to never imply otherwise.
  • It's an unofficial concept demo built for a portfolio, kept private and noindex.
  • A password gate activates only when a secret is set: open locally, gated in production.
  • noindex iframe page publishes it under pablocorzo.com/prototypes/pulse/demo: the app runs on Render, the URL lives on the domain. This overview sits one level up, behind its own password.
  • Runs in simulation mode with no API key, ideal for a public, gated demo: no cost, nothing to leak.

Architecture

Four files, one data engine

app.py

Experience layer

Streamlit UI, the brand system, the password gate, and the two-stage router (Opportunity Feed → engaged).

signal_engine.py  ·  agent_tools.py

Detection & the agent

Stage-1 signal detection over the data engine, and the agent: a Claude tool-calling loop (with deterministic mock fallback) over six business tools.

data_generator.py

Loyalty Data Engine

An in-process DuckDB seeded with 1,000 deterministic synthetic members: the ground truth everything queries.