KaireonAI models retrain on three different rhythms depending on what kind of model they are and how you configure them. This page explains the mechanisms, the per-algorithm defaults, and the API/UI toggles that change the cadence.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.
TL;DR
| Model type | Default cadence | What learns when | Toggle |
|---|---|---|---|
thompson_bandit | Continuous — every /respond | α / β posteriors per arm | Always on (hardcoded) |
epsilon_greedy | Continuous — every /respond | pulls / totalReward per arm | Always on (hardcoded) |
bayesian | Continuous (if priors set) OR scheduled | predictor priors → posteriors | autoLearn + learnMode |
online_learner | Continuous — every /respond | weight vector | Always on (hardcoded) |
scorecard | Nothing by default | needs scheduled or manual retrain | autoLearn=true, learnMode="scheduled" |
logistic_regression | Nothing by default | needs scheduled or manual retrain | autoLearn=true, learnMode="scheduled" |
gradient_boosted | Nothing by default | needs scheduled or manual retrain | autoLearn=true, learnMode="scheduled" |
neural_cf | Nothing by default | needs scheduled or manual retrain | autoLearn=true, learnMode="scheduled" |
external_endpoint | Out of scope | The platform doesn’t train external models | n/a |
Out-of-the-box defaults are conservative. Every new
algorithmModel row starts with autoLearn: false, learnMode: "none", learnSchedule: null — so tabular models won’t retrain unless you explicitly turn it on. Bandits and online learners ignore these toggles and always learn on every respond, because that’s the entire point of those algorithm families.The three retraining mechanisms
1. Continuous (incremental)
For four model types —thompson_bandit, epsilon_greedy, bayesian (when priors are configured), and online_learner — the platform performs an in-place state update on every /respond call that returns a positive or negative outcome. The respond handler reads the current modelState from DB, applies the algorithm-specific update rule, and writes the new state back, all in a single Prisma transaction. Side effects:
algorithmModel.modelStateadvances (e.g. Thompson arm’sα+= 1 on positive,β+= 1 on negative).algorithmModel.trainingSamplesincrements by 1.algorithmModel.lastLearnedAtis set tonow.
2. Scheduled offline retrain
Forscorecard, logistic_regression, gradient_boosted, and neural_cf, learning is a full pass over accumulated training data. The platform runs a periodic cron (/api/v1/cron/scheduled-retrains) that:
- Finds every model with
autoLearn: trueANDlearnMode IN ("scheduled", "both"). - For each, checks
now - lastLearnedAt >= parseScheduleToMs(learnSchedule || "24h"). - If due, enqueues a retrain job that recomputes weights / trees / embeddings from the last N interaction-history rows.
- On completion, writes new
modelState,metrics,metricsHistory[],predictors[].importance, and bumps bothlastTrainedAtandlastLearnedAt.
learnSchedule is null is every 24 hours. Override with any of: "15m", "1h", "6h", "1d", "7d", or a cron expression like "0 3 * * *" (daily at 03:00 UTC).
3. Drift-triggered retrain
Independent of the schedule, the platform runsrunScheduledDriftChecks on every cron tick. For each active model with drift monitoring enabled, it computes a Population Stability Index (PSI) and KL divergence on the predictor features comparing the last 24h vs the training-set baseline. If PSI exceeds the configured threshold (default 0.25, configurable per model), the model is enqueued for retrain immediately — regardless of when it was last trained.
This catches sudden distribution shifts (a deployed pricing change, a new audience segment, a regulatory event) that would otherwise wait for the next nightly window.
Toggling the cadence — API
Every field shown below can be set onPOST /api/v1/algorithm-models (model creation) and PUT /api/v1/algorithm-models/{id} (update):
Field reference
| Field | Type | Default | Description |
|---|---|---|---|
autoLearn | boolean | false | Master switch. When false, scheduled retrains are skipped even if learnMode is set. Bandit / online-learner continuous updates ignore this flag — they always run. |
learnMode | "none" | "incremental" | "scheduled" | "both" | "none" | "scheduled" = nightly retrain only. "incremental" = update on every respond (only meaningful for bayesian; bandits/online-learners do this regardless). "both" = both. "none" disables all auto-learning. |
learnSchedule | string | null | null (→ 24h) | Time interval ("15m", "6h", "24h", "7d") or cron expression ("0 3 * * *"). Only consulted when learnMode includes "scheduled". |
Toggling the cadence — UI
In the Studio at Algorithms → Models → , the model-detail panel has a Learning section with the same three controls: anautoLearn toggle, a learnMode dropdown, and a learnSchedule text field with format hints. Changes save via PUT and take effect on the next cron tick (within 60 seconds in production).
Recommended cadence per use case
This is what we’d reach for if you handed us a fresh tenant tomorrow:- Cold-start with sparse historical data. Pick a
thompson_banditorepsilon_greedy. The continuous-learning behavior means the model is useful from request #1 — no warm-up needed. Move tobayesianafter you have ~10k interactions and want to incorporate predictor features. - Steady-state tabular workload with predictable churn.
scorecardorgradient_boostedwithautoLearn: true, learnMode: "scheduled", learnSchedule: "24h". Nightly is enough for most NBA workloads where the underlying customer behavior doesn’t shift hour-to-hour. - Volatile distribution (pricing tests, seasonal pushes, regulatory changes). Same as above but
"6h"cadence AND configure drift checks. The drift trigger catches the sudden shift; the schedule keeps the model fresh on stable days. - Catalogs with fast turnover (new offers daily). Drop the schedule lower (
"4h") or use drift-triggered exclusively — neural-cf especially benefits from fresh embeddings against the current catalog. - Compliance-sensitive deployments where every retrain needs human review. Set
autoLearn: falseand use the model promotion endpoint (POST /algorithm-models/{id}/promote) to manually advance retrained candidates throughdraft → shadow → challenger → championwith audit-log review at each step.
Common questions
“My scorecard model’smetricsHistory is empty. Did it train?”
Almost certainly not. New models ship with autoLearn: false; the scheduled-retrains cron skips them. Flip autoLearn: true, learnMode: "scheduled" and wait for the next cron tick. Or trigger a one-off retrain via the Studio’s “Retrain now” button (which calls /api/v1/algorithm-models/{id}/train).
“My Thompson bandit’s arms aren’t moving.”
Three possibilities. First, check that /respond calls actually carry outcomeTypeKey — without a classifiable outcome the bandit can’t update. Second, check lastLearnedAt on the model: if it’s null, no incremental update has fired, which usually means the model isn’t wired into the active decision flow’s score node. Third, check modelState.arms — if it’s {} or missing, the model hasn’t been initialized; either re-create the model (its init path will seed arms from the candidate offers) or set arms explicitly via PUT.
“What’s the difference between lastTrainedAt and lastLearnedAt?”
lastTrainedAt is set by full offline retraining (the cron-driven flow). lastLearnedAt is set by either offline retraining OR by any incremental update (every respond for bandits / online learners). So a Thompson bandit will have lastLearnedAt advancing every minute and lastTrainedAt permanently null — that’s correct, because Thompson doesn’t have an offline-train concept. A scheduled gradient_boosted will have both fields advance together every 24h.
“Can I retrain on-demand for testing?”
Yes. POST /api/v1/algorithm-models/{id}/train triggers an immediate offline retrain regardless of schedule. Useful for evaluating data fixture changes before a flow goes live.
See also: Algorithms & Models | Algorithm Models API | Experiments — Shadow vs Champion/Challenger