> ## 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.

# Sample Data

> Pre-built dataset to explore the platform without manual setup.

KaireonAI ships with a curated dataset pack sourced from a well-known public dataset. The pack creates a complete, working decisioning environment -- categories, offers, channels, creatives, schemas, models, decisioning gates, contact policies, a decision flow, interaction history, and more -- so you can start exploring immediately.

## Available Dataset

| Dataset            | Source                              | Focus                                                                                   |
| ------------------ | ----------------------------------- | --------------------------------------------------------------------------------------- |
| **Retail Rewards** | Public retail rewards dataset (CC0) | Full Next-Best-Action (NBA) pipeline, multi-channel delivery, Thompson Bandit, segments |

Only one dataset can be loaded at a time.

## What Gets Created

The retail rewards dataset pack creates the full set of entities needed to run the decisioning pipeline end to end:

* **Categories and sub-categories** -- Top-level groupings (Acquisition, Retention, Engagement) with typed sub-categories beneath them.
* **Offers** -- 10 decision candidates with descriptions, priority scores, eligibility rules, budget caps, and tags. Each offer is assigned to a category and sub-category.
* **Channels** -- 6 delivery channels (web, email, mobile push, social, batch email, manual outreach) with channel type, delivery mode, and impression mode configured.
* **Creatives** -- 60 content variants (10 offers across 6 channels), each with channel-appropriate content (email subject lines, push deep links, web banners, social posts).
* **Schemas with fields** -- 3 entity schemas that create real PostgreSQL tables: a customer table (demographics, tenure, income), an offer portfolio table, and an events table. Each field has a data type, nullability, and display name.
* **Sample data rows** -- 100 synthetic customer rows, generated with deterministic random seeds so results are reproducible.
* **Decisioning gates** -- 5 attribute-based conditions that filter candidates (e.g. minimum age, minimum income, loyalty membership).
* **Contact policies** -- 5 frequency caps and cooldown rules to prevent customer fatigue (e.g. max 3 offers per day, 24-hour cooldown between same-offer deliveries).
* **Algorithm models** -- 3 scoring models (scorecard, Bayesian, Thompson Bandit) trained on the dataset so you can compare approaches.
* **Experiments** -- A champion/challenger experiment splitting traffic between models.
* **Decision flow** -- A fully configured pipeline with inventory selection, qualification filtering, propensity scoring, ranking, and channel targeting.
* **Segments** -- Customer segments defined by filter conditions (e.g. high-income members with 365+ days tenure), materialized as SQL views with customer counts.
* **Interaction history** -- 500 synthetic interaction records (impressions, clicks, accepts, conversions, dismissals) with interaction summaries materialized for dashboard reporting.
* **Outcome types** -- Standard outcome taxonomy (impression, click, accept, convert, dismiss) with classifications.

## How to Load

### From the UI

1. Navigate to **Settings > Sample Data**.
2. The dataset appears as a card showing its name, description, testing focus tags, and entity counts.
3. Click **Load Dataset**. If data is already loaded, the button reads **Replace & Load** and handles removal automatically.
4. Wait for the confirmation toast. Loading takes a few seconds.

### From the API

Send a POST request to load the retail rewards dataset (the seed key `retail-rewards` is the dataset's internal identifier):

```bash theme={null}
curl -X POST https://your-instance/api/v1/seed-dataset/retail-rewards \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Requested-With: XMLHttpRequest"
```

To check which dataset is currently loaded:

```bash theme={null}
curl https://your-instance/api/v1/seed-dataset \
  -H "X-API-Key: YOUR_API_KEY"
```

The response includes entity counts and a `currentlyLoaded` field.

<Note>The seed endpoint requires the **admin** role and is rate-limited to 5 requests per minute.</Note>

## Exploring the Data

Once the dataset is loaded, here are suggested first steps:

1. **Make a Recommend API call** -- Send a request to `POST /api/v1/recommend` with a customer ID from the loaded dataset (e.g. `SBX-000042`). The response shows which offers the pipeline selected, their scores, and personalized creative content.

2. **Browse Offers in Studio** -- Go to **Studio > Offers** to see all 10 offers that were created. Click into one to see its eligibility rules, budget configuration, and linked creatives.

3. **Open the Decision Flow** -- Navigate to **Studio > Decision Flows** to see the pre-built pipeline. It has inventory, qualification, scoring, ranking, and targeting stages already configured.

4. **Check the Operations dashboard** -- Go to **Dashboards > Operations** to see interaction history metrics, delivery counts, and outcome breakdowns populated from the synthetic interaction data.

5. **Explore algorithm models** -- Visit **Algorithms > Models** to see the 3 trained models. Compare the scorecard rules, Bayesian probabilities, and Thompson Bandit arm parameters.

6. **View a customer segment** -- Check segments under the segment builder to see the filter conditions and customer count.

## Resetting

### Remove the dataset

From the UI, click the **Remove** button on the loaded dataset card in **Settings > Sample Data**. Confirm the dialog. This deletes all entities created by the dataset, including schemas (and their PostgreSQL tables), interaction history, models, and experiments.

From the API:

```bash theme={null}
curl -X DELETE https://your-instance/api/v1/seed-dataset/retail-rewards \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "X-Requested-With: XMLHttpRequest"
```

### Full database reset

To drop all tables and start completely fresh:

```bash theme={null}
npm run db:reset
```

<Warning>This drops all tables and recreates them. All data -- not just sample data -- will be lost.</Warning>

## Related

<CardGroup cols={2}>
  <Card title="Platform Walkthrough" icon="play" href="/get-started/walkthrough">
    Build a complete decisioning setup from scratch, step by step.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get the platform running locally in under five minutes.
  </Card>

  <Card title="API Tutorial" icon="code" href="/tutorials/api-tutorial">
    Learn the Recommend and Respond APIs with hands-on examples.
  </Card>

  <Card title="Decisioning Studio" icon="wand-magic-sparkles" href="/studio/overview">
    Explore the Studio components that the sample data created.
  </Card>
</CardGroup>
