Five logical systems make up SK Upsell. Here is how each module triggers, evaluates, and logs recommendation events.
Recommendations are generated by offline AI derivations, compiling static draft templates for safe, human-approved publishing.
AI runs in the background analyzing transaction history to detect complementary products. It proposes rule candidates to the dashboard as drafts. Real managers approve, reject, or edit rules before activation. Once live, every edit creates a rule revision log—no accidental overrides, total history transparency.
Rule drafts (`upsell_rule_proposal` database records) compile offline. Test them before they hit checkout flows.
Every change yields a new revision record (`upsell_rule_revision`). Restore any historical configuration state instantly.
Toggling rules triggers live database updates. Matches update in real-time with zero backend service retraining.
Trigger evaluation is strict, parsing logical trees based on cart contents, demographics, and active time zones.
Triggers compile into structured AST JSON arrays validated against Zod schemas. The matcher evaluates constraints—such as minimal item count, customer segment level, specific time slots, and store IDs—in under a millisecond, skipping heavy search tasks.
Set rules by timezone and hour blocks. Recommend breakfast items during mornings and lounge bookings at night.
Target specific CRM client segments like high-value VIPs, first-time check-ins, or regular business visitors.
Limit recommendation logic to exclude specific categories or item types. Don't pitch main dishes to side order baskets.
Matches are sorted using a margin-tilted expected value metric, maximizing real profit rather than volume.
Pitches are sorted using the formula `EV = Attach Rate × (Price - Cost)`. An item with a lower conversion rate but a massive profit margin will outrank a high-frequency item that adds no real net income. Stable sort tie-breakers prevent jittery listings.
Calculates unit profit (`price - cost`) in real-time by reading base costs directly from the inventory ledger.
Continuously aggregates acceptance outcomes from the ledger to adjust item weights based on real customer conversions.
Enforces predictable sorting order (priority → score → attach rate) to prevent layout shifting on checkout updates.
Safety bounds prevent overwhelming customers with irrelevant or disproportionately expensive items.
Upselling works only when suggestions are reasonable and proportional to the cart. If a customer declines 3 recommended pitches in a session, all triggers shut off. Price delta ratios block items costing more than a configured percentage of the baseline total.
Limits suggested item values relative to active carts, preventing mismatched recommendations.
Shuts off the recommendation engine immediately for the rest of a session if a user declines 3 suggestions.
Suppresses candidates whose expected value score drops below a strict minimum quality threshold.
Database transaction safety guards statistics reporting, rendering recommendation outcomes tamper-proof.
All offered recommendations, clicks, accepts, and declines are recorded into a PostgreSQL transaction table. Database triggers intercept and drop any attempts to UPDATE or DELETE logs. Occurred dates are set automatically by the database server, blocking back-dated records.
PostgreSQL triggers block row edits at the database driver layer, securing raw trace records from manipulation.
Enforces standard database server clock variables on insertion, blocking back-dated records from polluting metrics.
Scrub customer PII details automatically once data retention limits expire, maintaining DPDP compliance.
Our 1,000 free monthly conversations plan includes full access to all recommendation features.
Start free For developers →