Improve AI Quick Start

This guide covers setting up the Improve AI Tracker/Trainer and SDKs to track item interactions and rewards, and train updated models.

For professional integration services, please contact Konrad Wiecko.

Deploy the Tracker/Trainer

The Improve AI Tracker/Trainer is a scalable stack of serverless components that runs on AWS under your full control.

The Tracker/Trainer provides three primary functions:

  • An HTTPS endpoint for tracking item interactions and rewards from client SDKs.
  • A store of logged item interactions and rewards on AWS S3.
  • Scheduling and configuration for one or more trainers to train updated models.

Fork the Repository

The Improve AI Tracker repo is here.

Install the Serverless Framework

$ npm install -g serverless

Install NPM Dependencies

$ npm install

Configure Tracker and Model Training

$ nano config/config.yml

Edit the organization and project name. AWS resource names depend on these values and must be globally unique.

organization: acme
project: demo

Configure the models to train

models:
  offers:
  config:
  feed:
  search-rerank:

Deploy the Tracker/Trainer

Deploy the tracker/trainer stack to a new dev stage in us-east-1

$ serverless deploy --stage dev
Deploying improveai-acme-demo to stage dev (us-east-1)

✔ Service deployed to stack improveai-acme-demo-dev (111s)

endpoint: https://xxxx.lambda-url.us-east-1.on.aws/

The output of the deployment will list the track endpoint URL like https://xxxx.lambda-url.us-east-1.on.aws. The track endpoint URL may be used directly by the client SDKs to track decisions and rewards. Alternately, a CDN or proxy may be configured in front of the track endpoint URL for greater administrative control.

Model Training

The deployment will create a models S3 bucket in the form of improveai-{organization}-{project}-{stage}-models. After each round of training, updated models are automatically uploaded to the models bucket.

The models bucket is private by default. Make the /models/latest/ directory public to serve models directly from S3. Alternatively, a CDN may be configured in front of the models S3 bucket.

Model URLs follow the template of https://{modelsBucket}.s3.amazonaws.com/models/latest/{modelName}.{mlmodel|xgb}.gz. The Android and Python SDKs use .xgb.gz models and the iOS SDK uses .mlmodel.gz models.

Note: Until some decisions have been tracked, model training will fail. This is expected behavior.

Integrate a Client Library

Integrate a client library to make decisions and assign rewards.

See their individual documentation to get started:

Recent Posts

2 minute read

Making Decisions with Ranker

1 minute read

In this tutorial, we’ll walk through how to use the Ranker class to make decisions, specifically choosing a discount to offer from a list of discounts. We’ll...