Implementation of AI in Decision Tables

Creating AI Model-Based Decision Tables in Higson Studio#

Higson Studio allows the creation of decision tables utilizing artificial intelligence (AI) models. In this approach, the AI model serves as the matrix of the decision table. The definition and levels are configured similarly to standard decision tables; however, the matrix is represented by the ONNX file. Higson Studio does not perform model training – it is assumed that the model has been previously prepared in an external environment and converted to the ONNX format.

Use Case#

Use a trained AI model (in ONNX format) to predict a client’s monthly insurance premium based on their demographic and lifestyle data. Below is a description of the process for configuring and deploying such a table using an AI model in the ONNX format.

To get started, create a new decision table in Higson Studio. Navigate to the Decision tables tab and select the Add decision table action.

  1. Assign a name to your decision table and click Next to proceed to the next step.

  2. In the second step, under the Definition section, set AI Model Source as the data source for decision-making. Then, click Next to continue.

  3. In step 3, similar to standard decision tables, you need to define:

  • Input levels (in) – the input data passed to the AI model.
  • Output levels (out) – the expected responses generated by the AI model.

Please note, that for decision tables with an AI model data source, only decimal data type is available.

  1. In step 4 of the configuration wizard:
  • You need to upload a onnx file containing the trained AI model.
  • During upload, the file is automatically validated for correct format and model structure.

The onnx file added in this way serves as the matrix of our decision table.

Once the decision table is correctly configured and saved, it can be invoked through Higson Runtime REST. At this stage, the ONNX file logic is validated.

Enabling AI Model Source in Higson Runtime#

Evaluating AI-model decision tables relies on the ONNX Runtime library. To keep the runtime lightweight for deployments that do not use AI models, this library is optional and the feature is disabled by default.

To run AI-model decision tables in your own application you have to do two things:

  1. Add the ONNX Runtime dependency to your application’s classpath. It is declared with provided scope in higson-runtime, so it is not pulled in transitively and must be added explicitly:

    <dependency>
        <groupId>com.microsoft.onnxruntime</groupId>
        <artifactId>onnxruntime</artifactId>
        <version>1.20.0</version>
    </dependency>
    

    Supported version: Higson is tested and verified against onnxruntime 1.20.0. Using any other version of the library is not guaranteed to work correctly and is not supported.

    The pre-built Higson Runtime REST application already ships with this dependency, so no change is required when you use it.

  2. Enable the feature switch so the runtime initializes the ONNX environment on startup:

    higson:
      runtime:
        ai-model:
          enabled: true
    

    When using the HigsonEngineFactory directly (without the Spring Boot starter), call factory.setAiModelEnabled(true) before factory.create().

The effective value is printed in the runtime configuration banner on startup as AI model source enabled.

Note: If a decision table backed by an AI model is evaluated while the feature is disabled, the runtime throws an AiModelSourceDisabledException naming the affected parameter and reminding you to set higson.runtime.ai-model.enabled=true and add the onnxruntime dependency.