Skip to content

Enum Resolver

The enum resolver maps a categorical string value to a radial embedding. It is designed for fields that take one of a fixed set of values (e.g. a colour, a country, a status).

How It Works

Each enum value is assigned a unique angle within a radial group. The output vector contains pairs of (cos θ, sin θ) coordinates, scaled by an optional multiplier. This gives each value a distinct direction in embedding space while keeping all embeddings on the same scale.

When the number of values exceeds maxValuesPerRadial, additional radial groups are created automatically.

Settings

Setting Type Default Description
values array of strings (required) The set of valid enum values. Values must be unique.
multiplier number 1.0 Scaling factor applied to the embedding. Increase to give this aspect more weight.
maxValuesPerRadial integer 5 Maximum number of values encoded per radial group before a new group is created.

Embedding Size

The number of dimensions produced by the enum resolver is:

dims = ceil(len(values) / maxValuesPerRadial) × 2

Each radial group contributes two dimensions (cos and sin).

Example

{
  "name": "colour",
  "type": "enum",
  "path": "$.colour",
  "settings": {
    "values": [
      "red",
      "green",
      "blue",
      "yellow"
    ],
    "multiplier": 1.0
  }
}

With four values and the default maxValuesPerRadial of 5, this produces 2 dimensions.