Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt

Use this file to discover all available pages before exploring further.

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 the following features. Each example is shown in a code block so it copies cleanly into the editor. Arithmetic
base_rate * 1.05
Comparison
amount > 1000
Ternary
tier == "gold" ? 0.15 : 0.10
Functions — pick the smaller or larger of two values.
min(rate, 0.25)
max(amount, 100)
Rounding — round a number to N decimal places.
round(price, 2)
Null handling — return the first non-null argument.
coalesce(custom_rate, default_rate)
String concatenation — join string fragments.
concat(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.