Skip to main content

Overview

Computed values let you define formulas on offer categories that are evaluated dynamically for each customer during a Decision Flow. This enables personalization like custom pricing, dynamic discounts, and tailored messaging.

How It Works

  1. Define computed fields on a category with a formula and output type
  2. Configure enrichment in a Decision Flow to load customer data from schema tables
  3. Add a compute stage to evaluate formulas per candidate offer
  4. Access results in the Recommend API response under the personalization field

Formula Syntax

The formula engine supports:
FeatureExample
Arithmeticbase_rate * 1.05
Comparisonamount > 1000
Ternarytier == "gold" ? 0.15 : 0.10
Functionsmin(rate, 0.25), max(amount, 100)
Roundinground(price, 2)
Null handlingcoalesce(custom_rate, default_rate)
String concatconcat(first_name, " ", last_name)

Variable Namespaces

PrefixSourceExample
(none)Other custom fields on the offerbase_rate
customer.*Enriched data from schema tablescustomer.loan_amount
attributes.*Request-time attributes from Recommend APIattributes.tier
The formula engine uses a tokenizer and recursive-descent parser — it does not use dynamic code execution. All formulas are safely interpreted from an AST.

Example

A “Personal Loan” category with a computed field:
Field: personalized_rate
Formula: base_rate * (1 - customer.loyalty_score * 0.01)
Output Type: decimal
When the Recommend API runs, KaireonAI calculates each loan offer’s personalized_rate using the customer’s enriched loyalty_score and the offer’s base_rate.

Next Steps

Formula Reference

Complete list of operators, functions, and variable namespaces.

Decision Flows

See how computed values are evaluated in the Compute stage.

API Tutorial

Learn how computed values appear in the Recommend API response.