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.
Tutorial: Churn Prevention
This tutorial walks through building a churn-prevention flow from a blank tenant. By the end you’ll have a working flow that scores customers by churn risk, qualifies the right retention offer, suppresses outreach for already-contacted customers, and improves with every recorded outcome. Business scenario: a telecom or SaaS provider wants to reduce monthly churn. The marketing team has three retention offers — a free month, a service upgrade, and a personal call. Each offer has different eligibility, different cost, and different effectiveness depending on the customer’s risk profile and tenure. The system has 24 hours to decide who gets which offer, and the contact policy says no customer may be touched more than once a week. What you’ll build:- A Customer schema with the fields the flow needs to score
- 3 retention offers with different qualification rules and business impact
- A decision flow that combines propensity scoring, qualification gates, and a 7-day contact policy
- An end-to-end test through
/recommendand/respond - A view into how the model learns from recorded outcomes
curl or any HTTP client.
Time: 25–30 minutes.
1. Define the customer schema
The flow needs four fields to make a churn-aware decision: tenure (months), monthly spend, support tickets in the last 90 days, and current plan tier.ds_customer) you can populate via the Data → Schemas UI, a /api/v1/customers bulk insert, or a pipeline from any of the 80 connectors.
2. Define the three retention offers
Each offer represents a different retention play. Thepriority field encodes business preference when scores tie, and budget lets the platform respect spend caps later.
3. Add the 7-day contact policy
The most common churn-prevention failure mode is over-messaging. A contact policy of “no retention contact within 7 days” prevents the platform from following a free-month offer with an upgrade nudge the next day.Retention category, so transactional messages and other categories are unaffected.
4. Wire the decision flow
The flow stitches everything together:- Inventory — load active retention offers.
- Enrich — pull
tenureMonths,monthlySpend,ticketsLast90d,planTierfrom the Customer schema. - Qualify — apply each offer’s eligibility rules; filter out non-qualifying candidates.
- Contact Policy — suppress any candidate the customer has already received in the last 7 days.
- Score — propensity-based scoring on a feature vector of (tenure, spend, tickets, tier).
- Rank — PRIE composite blending propensity, channel relevance, impact, and emphasis.
- Response — return the top offer.
POST /api/v1/decision-flows/{id}/publish to make it live.
5. Run the recommendation
For a customer who has a long tenure, high spend, and recent support friction — the kind of customer worth saving:6. Record the outcome
When the customer accepts (or doesn’t), record the result so the model improves:/respond. Within minutes the platform updates the scoped posterior for (scope=offer, scopeId=off_personal_call) — and the next decision for a similar customer sees a slightly tighter, higher confidence-interval lower-bound on the personal-call propensity.
7. Watch the model learn
The Model Health dashboard shows the Wilson confidence interval for each scoped adaptation. Initially, the interval is wide andexposureProbability is below 1.0 (the maturity ramp gates immature offers). After 30–50 outcomes the interval tightens, the offer becomes mature, and exposure goes to 1.0.
For a deep-dive on the math (Wilson 1927 closed form, the 0.20 width threshold, the cold-start floor decay), see Maturity Ramp (BCB-MR).
8. What’s next
- Add an uplift signal. Configure the T-learner / X-learner endpoint to estimate causal CATE per customer. The
Uterm in PRIE-U then suppresses “sure thing” offers that would have converted anyway and boosts “persuadable” customers where the offer actually moves the needle. - Multi-channel routing. Add a
channel_selectorupstream of the flow to pick email vs. SMS vs. push based on customer preference and recent engagement. - Frequency optimization at the customer level. Add a
customer_total_capcontact policy (max 3 contacts per customer per week across all categories) so retention doesn’t crowd out billing or service messages. - Experiment with a holdout group. Set up an A/B with a 10% holdout that gets no retention contact. Use the platform’s z-test uplift calculation to prove the program’s incremental revenue.
See Industry Templates for ready-made starter kits, Starbucks NBA pipeline for a full retail walkthrough, or the API Reference for endpoint-by-endpoint details.