All Products
Search
Document Center

:Recall configuration

Last Updated:May 15, 2026

The retrieval configuration maps to RecallConfs on the configuration overview.

Configuration

The PAI-Rec engine supports built-in recall templates, including collaborative filtering (UserCollaborativeFilterRecall), vector recall (HologresVectorRecall), and U2I recall (UserCustomRecall), as well as data sources such as Hologres, PAI-FeatureStore, and Tablestore.

Common recall configurations

Each recall configuration uses a subset of the common configuration. This section explains these common settings to avoid repeating them in the documentation for each specific recall configuration.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "collaborative_filter",
            "RecallType": "UserCollaborativeFilterRecall",
            "RecallCount": 1000,
            "RecallAlgo": "",
            "ItemType": "",
            "CacheAdapter": "",
            "CacheConfig": "",
            "CachePrefix": "",
            "CacheTime": 0
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall configuration, referenced in SceneConfs.

RecallType

string

Yes

The built-in recall type. Supported values include:

  • UserCollaborativeFilterRecall

  • UserTopicRecall

  • VectorRecall

  • UserCustomRecall

  • HologresVectorRecall

  • ItemCollaborativeFilterRecall

  • UserGroupHotRecall

  • UserGlobalHotRecall

  • I2IVectorRecall

  • ColdStartRecall

  • MilvusVectorRecall

  • RealTimeU2IRecall

  • OnlineHologresVectorRecall

  • OnlineVectorRecall

  • GraphRecall

  • MockRecall

RecallCount

string

Yes

The number of items to recall.

RecallAlgo

string

No

For real-time vector recall only. Specifies the name of the vector model to use, which must be pre-configured in AlgoConfs.

ItemType

string

No

The type of item to recommend.

CacheAdapter

string

No

Specifies the adapter for caching recall results. Supported values:

  • Redis

  • localCache

CacheConfig

string

No

The configuration settings for the cache.

Example for Redis: "{\"host\":\"xxx.redis.rds.aliyuncs.com\", \"port\":6379,\"maxIdle\":10, \"password\":\"xxxx\"}"

Example for localCache: "{\"defaultExpiration\":600, \"cleanupInterval\":600}"

CachePrefix

string

No

A prefix prepended to the cache key for recall results.

This parameter is required when caching is enabled to prevent key collisions between different recall configurations. For example,

"group_hot_" can be used for results from a group-based hot item recall.

CacheTime

string

No

The cache duration in seconds. The default value is 1800.

Collaborative filtering (UserCollaborativeFilterRecall)

Hologres

Collaborative filtering requires two tables with fixed schemas: a u2i table to retrieve an item list based on a user_id, and an i2i table to retrieve similar items.

In addition to retrieving similar items directly from an i2i table (the u2i2i method), you can also retrieve them indirectly by using an i2x table and an x2i table (the u2i2x2i method). In this approach, 'x' represents an item attribute, such as a category, brand, or city. The process first retrieves the 'x' attribute of an item (for example, the category field) and then uses the x2i table to fetch popular items that share this attribute value for recommendation.

u2i table

Parameter

Type

Description

user_id

string

The user ID. This value must be unique.

item_ids

string

A list of item IDs that the user has browsed. Supported formats: item_id1,item_id2,item_id3...

or item_id1:score1,item_id2:score2,item_id3:score3...

i2i table (required only for u2i2i)

Parameter

Type

Description

item_id

string

The item ID. This value must be unique.

similar_item_ids

string

A list of items similar to item_id. Supported format: item_id1:score1,item_id2:score2,item_id3:score3...

i2x table (required only for u2i2x2i)

Parameter

Type

Description

item_id

string

The item ID. This value must be unique.

x

string

An item attribute. The column name is customizable and must be specified in the engine configuration.

x2i table (required only for u2i2x2i)

Parameter

Type

Description

x

string

An item attribute. The column name is customizable and must be specified in the engine configuration.

item_id

string

The item ID. Use a comma (,) to separate multiple values.

u2i2i configuration example:

{
    "RecallConfs": [
        {
            "Name": "collaborative_filter",
            "RecallType": "UserCollaborativeFilterRecall",
            "RecallCount": 1000,
            "UserCollaborativeDaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "User2ItemTable": "u2i_table",
                "Item2ItemTable": "i2i_table",
                "Normalization": "on"
            }
        }
    ]
}

u2i2x2i configuration example:

{
    "RecallConfs": [
        {
            "Name": "collaborative_filter",
            "RecallType": "UserCollaborativeFilterRecall",
            "RecallCount": 1000,
            "UserCollaborativeDaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "User2ItemTable": "u2i_table",
                "Item2XTable": "i2x_table",
                "X2ItemTable": "x2i_table",
                "XKey": "category",
                "XDelimiter": ",",
                "Normalization": "on"
            }
        }
    ]
}

UserCollaborativeDaoConfig

Parameter

Type

Required

Description

AdapterType

string

Yes

Fixed value: hologres.

HologresName

string

Yes

The name of the Hologres instance, as defined in the data source configuration (HologresConfs). For example, holo_info.

User2ItemTable

string

Yes

The name of the u2i table.

Item2ItemTable

string

No

The name of the i2i table. This parameter is required for the u2i2i method.

Item2XTable

string

No

The name of the i2x table. This parameter is required for the u2i2x2i method.

X2ItemTable

string

No

The name of the x2i table. This parameter is required for the u2i2x2i method.

XKey

string

No

The name of the attribute column (x) in the i2x and x2i tables. This parameter is required for the u2i2x2i method.

XDelimiter

string

No

The delimiter for 'x' values. By default, 'x' values are not split.

Normalization

string

No

Specifies whether to normalize recalled items. Valid values: on and off. Default value: on.

PAI-FeatureStore

Collaborative filtering requires two tables with fixed schemas: a u2i table to retrieve an item list based on a user_id, and an i2i table to retrieve similar items.

The data for both tables is generated in MaxCompute and must be registered with PAI-FeatureStore as offline views. The required MaxCompute table schema is described below.

u2i table

Parameter

Type

Description

user_id

string

The user ID. This value must be unique.

item_ids

string

A list of item IDs that the user has browsed. Supported formats: item_id1,item_id2,item_id3...

or item_id1:score1,item_id2:score2,item_id3:score3...

ds

string

The MaxCompute table partition field.

The following example shows how to register data with PAI-FeatureStore:

i2i table

Parameter

Type

Description

item_id

string

The item ID. This value must be unique.

similar_item_ids

string

A list of items similar to item_id. Supported format: item_id1:score1,item_id2:score2,item_id3:score3...

dt

string

The MaxCompute table partition field.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "collaborative_filter",
            "RecallType": "UserCollaborativeFilterRecall",
            "RecallCount": 1000,
            "UserCollaborativeDaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "User2ItemFeatureViewName": "u2i_recall",
                "Item2ItemFeatureViewName": "i2i_collaborative",
                "Normalization": "on"
            }
        }
    ]
}

UserCollaborativeDaoConfig

Parameter

Type

Required

Description

AdapterType

string

Yes

Fixed value: featurestore.

FeatureStoreName

string

Yes

The name of the PAI-FeatureStore instance, as defined in the data source configuration (FeatureStoreConfs). For example, fs_pairec.

User2ItemFeatureViewName

string

Yes

The name of the view that corresponds to the u2i table.

Item2ItemFeatureViewName

string

Yes

The name of the view that corresponds to the i2i table.

Normalization

string

No

Specifies whether to normalize recalled items. Valid values: on and off. Default value: on.

Tablestore

Collaborative filtering requires two tables with fixed schemas: a u2i table to retrieve an item list based on a user_id, and an i2i table to retrieve similar items.

u2i table

Parameter

Type

Description

user_id

string

The user ID. This value must be unique.

item_ids

string

A list of item IDs that the user has browsed. Supported formats: item_id1,item_id2,item_id3...

or item_id1:score1,item_id2:score2,item_id3:score3...

i2i table

Parameter

Type

Description

item_id

string

The item ID. This value must be unique.

similar_item_ids

string

A list of items similar to item_id. Supported format: item_id1:score1,item_id2:score2,item_id3:score3...

{
    "RecallConfs": [
        {
            "Name": "collaborative_filter",
            "RecallType": "UserCollaborativeFilterRecall",
            "RecallCount": 1000,
            "UserCollaborativeDaoConf": {
                "AdapterType": "tablestore",
                "TableStoreName": "tablestore_info",
                "User2ItemTable": "u2i_table",
                "Item2ItemTable": "i2i_table",
                "Normalization": "on"
            }
        }
    ]
}

Parameter

Type

Required

Description

AdapterType

string

Yes

Fixed value: tablestore.

TableStoreName

string

Yes

The name of the Tablestore instance, as defined in the data source configuration (TableStoreConfs). For example, tablestore_info.

User2ItemTable

string

Yes

The name of the u2i table.

Item2ItemTable

string

Yes

The name of the i2i table.

Normalization

string

No

Specifies whether to normalize recalled items. Valid values: on and off. Default value: on.

Redis

The collaborative filtering process for Redis is unique, involving two steps:

  • Construct a key by concatenating the RedisPrefix value with the user ID (uid) to query the u2i list. The result is a string in one of the following formats: item_id1,item_id2,item_id3... or item_id1:score1,item_id2:score2,item_id3:score3....

  • Query the i2i list. Use the MGET command with the item IDs obtained in the previous step. The i2i data is also a string, with the following format: item_id1:score1,item_id2:score2,item_id3:score3....

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "collaborative_filter",
            "RecallType": "UserCollaborativeFilterRecall",
            "RecallCount": 1000,
            "UserCollaborativeDaoConf": {
                "AdapterType": "redis",
                "RedisName": "redis_info",
                "RedisPrefix": "cr_",
                "Normalization": "on"
            }
        }
    ]
}

Parameter

Type

Required

Description

AdapterType

string

Yes

Fixed value: redis.

RedisName

string

Yes

The name of the Redis instance, as defined in the data source configuration (RedisConfs). For example, redis_info.

RedisPrefix

string

No

The prefix for the u2i data key. This prefix is prepended to the user ID (uid) to create the key.

Note

Redis is the only supported data cache.

Real-time U2I2I (RealTimeU2IRecall)

Hologres

This approach retrieves data using the same logic as collaborative filtering, but computes U2I data in real time from a user historical behavior table.

The system updates the user historical behavior table in real time based on logs, enabling real-time recall.

Like collaborative filtering, this method also supports u2i2x2i. First, it retrieves an item's x attribute, and then recalls other items that have the same attribute.

User historical behavior table

Field

Type

Description

user_id

string

The user ID.

item_id

string

The ID of the item that the user browsed.

event

string

The event name.

play_time

float

The duration of the event, such as the watch time of a video. Set to 0 if not applicable.

timestamp

int

The timestamp of the event, in seconds.

i2i table (required only for u2i2i)

Field

Type

Description

item_id

string

The item ID. This value must be unique.

similar_item_ids

string

A list of items similar to item_id. The supported format is: item_id1:score1,item_id2:score2,item_id3:score3...

i2x table (required only for u2i2x2i)

item_id

string

The item ID. This value must be unique.

x

string

An attribute of the item. The column name is customizable and must be specified in the engine configuration.

x2i table (required only for u2i2x2i)

x

string

An attribute of the item. The column name is customizable and must be specified in the engine configuration.

item_id

string

The item ID. Use commas (,) to separate multiple values.

Statement for creating the behavior table:

BEGIN;
CREATE TABLE "sv_rec"."user_behavior_seq" (
  "user_id" text NOT NULL,
  "item_id" text NOT NULL,
  "event" text NOT NULL,
  "play_time" float8  NULL,
  "timestamp" int8 NOT NULL
);
CALL SET_TABLE_PROPERTY('"sv_rec"."user_behavior_seq"', 'orientation', 'column');
call set_table_property('table_name', 'distribution_key', '"user_id"');
CALL SET_TABLE_PROPERTY('"sv_rec"."user_behavior_seq"', 'clustering_key', '"user_id:asc","timestamp:desc"');
CALL SET_TABLE_PROPERTY('"sv_rec"."user_behavior_seq"', 'bitmap_columns', '"user_id","event"');
CALL SET_TABLE_PROPERTY('"sv_rec"."user_behavior_seq"', 'dictionary_encoding_columns', '"user_id:auto","item_id:auto","event"');
CALL SET_TABLE_PROPERTY('"sv_rec"."user_behavior_seq"', 'time_to_live_in_seconds', '2592000');
comment on table "sv_rec"."user_behavior_seq" is 'User real-time behavior sequence';
comment on column "sv_rec"."user_behavior_seq"."user_id" is 'User ID';
comment on column "sv_rec"."user_behavior_seq"."item_id" is 'Item ID';
comment on column "sv_rec"."user_behavior_seq"."event" is 'Event type';
comment on column "sv_rec"."user_behavior_seq"."play_time" is 'Reading or playback duration';
comment on column "sv_rec"."user_behavior_seq"."timestamp" is 'Timestamp, in seconds';
COMMIT;

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "RealTimeEtrecRecall",
            "RecallType": "RealTimeU2IRecall",
            "RecallCount": 200,
            "RealTimeUser2ItemDaoConf": {
                "UserTriggerDaoConf": {
                    "AdapterType": "hologres",
                    "HologresName": "holo_info",
                    "HologresTableName": "user_behavior_table",
                    "WhereClause": "event='xxx'",
                    "Limit": 200,
                    "EventPlayTime": "playback:5000;playvslide:5000",
                    "EventWeight": "playback:1;playvslide:2",
                    "WeightExpression": "exp((-0.2)*((currentTime-eventTime)/3600/24))",
                    "WeightMode": "sum",
                    "NoUsePlayTimeField": false
                },
                "Item2ItemTable": "i2i_table",
                "SimilarItemIdField": "similar_item_ids"
            }
        }
    ]
}

u2i2x2i configuration example:

{
    "RecallConfs": [
        {
            "Name": "RealTimeU2I2X2IRecall",
            "RecallType": "RealTimeU2IRecall",
            "RecallCount": 200,
            "RealTimeUser2ItemDaoConf": {
                "UserTriggerDaoConf": {
                    "AdapterType": "hologres",
                    "HologresName": "holo_info",
                    "HologresTableName": "user_behavior_table",
                    "WhereClause": "event='xxx'",
                    "Limit": 200,
                    "EventPlayTime": "playback:5000;playvslide:5000",
                    "EventWeight": "playback:1;playvslide:2",
                    "WeightExpression": "exp((-0.2)*((currentTime-eventTime)/3600/24))",
                    "WeightMode": "sum",
                    "NoUsePlayTimeField": false
                },
                "Item2XTable": "i2x_table",
                "X2ItemTable": "x2i_table",
                "XKey": "category",
                "XDelimiter": ","
            }
        }
    ]
}

RealTimeUser2ItemDaoConf:

Field

Type

Required

Description

AdapterType

string

Yes

Fixed value: hologres.

HologresName

string

Yes

The custom name of the Hologres instance, configured in the HologresConfs data source configuration. For example, holo_info.

HologresTableName

string

Yes

The name of the user historical behavior table in Hologres.

WhereClause

string

No

The filter condition, equivalent to an SQL WHERE clause.

Limit

int

No

The query limit, equivalent to an SQL LIMIT clause.

EventPlayTime

string

No

Filters events by play duration. For example, e_sv_func_svplayback:5000 means that for this event type, the play_time value must be greater than 5000. Events that do not meet this condition are filtered out. Use semicolons (;) to separate multiple event filters.

EventWeight

string

No

You can define a weight for each event. The default is 1.

WeightExpression

string

No

An expression for calculating an event's weight based on time decay. currentTime represents the current timestamp, and eventTime represents the timestamp from the behavior table.

WeightMode

string

No

The method for calculating the trigger weight. Valid values are sum and max. The default is sum.

NoUsePlayTimeField

bool

No

Set to true if you do not use the play_time field.

Item2ItemTable

string

No

The name of the i2i table in Hologres. This parameter is required for the u2i2i method.

SimilarItemIdField

string

No

The name of the field in the i2i table in Hologres. Default value: similar_item_ids.

Item2XTable

string

No

The name of the i2x table. This parameter is required for the u2i2x2i method.

X2ItemTable

string

No

The name of the x2i table. This parameter is required for the u2i2x2i method.

XKey

string

No

The x key. Its value is the name of the x column in the i2x and x2i tables. This parameter is required for the u2i2x2i method.

XDelimiter

string

No

The delimiter for x values. By default, x values are not split.

PAI-FeatureStore

This approach retrieves data using the same logic as collaborative filtering, but computes U2I data in real time from a user historical behavior table.

The system updates the user historical behavior table in real time based on logs, enabling real-time recall.

On the PAI-FeatureStore platform, you can use a behavior sequence feature view to store user historical behavior data.

User historical behavior table

Field

Type

Description

user_id

string

The user ID.

item_id

string

The ID of the item that the user browsed.

event

string

The event name.

playtime

float

The duration of the event, such as the watch time of a video. Set to 0 if not applicable.

event_unix_time

int

The timestamp of the event, in seconds.

i2i table

Field

Type

Description

item_id

string

The item ID. This value must be unique.

similar_item_ids

string

A list of items similar to item_id. The supported format is: item_id1:score1,item_id2:score2,item_id3:score3...

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "realtimeu2i",
            "RecallType": "RealTimeU2IRecall",
            "RecallCount": 200,
            "RealTimeUser2ItemDaoConf": {
                "UserTriggerDaoConf": {
                    "AdapterType": "featurestore",
                    "FeatureStoreName": "fs_pairec",
                    "FeatureStoreViewName": "user_behavior_table",
                    "TriggerCount": 100,
                    "EventWeight": "click:1;order:1",
                    "WeightExpression": "exp((-0.2)*((currentTime-eventTime)/3600/24))",
                    "WeightMode": "sum",
                    "NoUsePlayTimeField": false,
                    "ItemIdFieldName": "item_id",
                    "EventFieldName": "event",
                    "PlayTimeFieldName": "playtime",
                    "TimestampFieldName": "event_unix_time"
                },
                "Item2ItemFeatureViewName": "i2i_collaborative",
                "SimilarItemIdField": "similar_item_ids"
            }
        }
    ]
}

RealTimeUser2ItemDaoConf:

Field

Type

Required

Description

UserTriggerDaoConf

  • AdapterType

string

Yes

Fixed value: featurestore.

  • FeatureStoreName

string

Yes

The custom name of the PAI-FeatureStore project, configured in the FeatureStoreConfs data source configuration. For example, fs_pairec.

  • FeatureStoreViewName

string

Yes

The name of the user historical behavior sequence feature view in PAI-FeatureStore.

  • TriggerCount

int

Yes

The number of user behavior triggers.

  • EventPlayTime

string

No

Filters events by play duration. For example, e_sv_func_svplayback:5000 means that for this event type, the play_time value must be greater than 5000. Events that do not meet this condition are filtered out. You can specify multiple event filters, separated by semicolons (;).

  • EventWeight

string

Yes

You can define a weight for each event. The default weight is 1. Use a semicolon (;) to separate configurations for multiple events.

  • WeightExpression

string

Yes

An expression for calculating an event's weight based on time decay. currentTime represents the current timestamp, and eventTime represents the timestamp from the behavior table.

  • WeightMode

string

No

The method for calculating the trigger weight. Valid values are sum and max. The default is sum.

  • NoUsePlayTimeField

bool

No

Set to true if you do not use the play_time field.

  • ItemIdFieldName

string

No

The name of the item_id field in the user behavior sequence. Default value: item_id.

  • EventFieldName

string

No

The name of the event field in the user behavior sequence. Default value: event.

  • PlayTimeFieldName

string

No

The name of the play time field in the user behavior sequence. Default value: play_time.

  • TimestampFieldName

string

No

The name of the timestamp field in the user behavior sequence. Default value: timestamp.

Item2ItemFeatureViewName

string

No

The name of the i2i table's feature view in PAI-FeatureStore. This parameter is required for the u2i2i method.

SimilarItemIdField

string

No

The name of the i2i table's field in PAI-FeatureStore. Default value: similar_item_ids.

MergeMode

string

No

Controls how to merge items recalled by triggerId. By default, recalled items are combined, sorted, and deduplicated. The 'snake' value merges the recalled item lists by interleaving them.

I2ICacheSize

int

No

If this value is greater than 0, caching is enabled. The triggerId is used as the cache key, and the list of items recalled from the i2i table is the cached value.

I2ICacheTime

int

No

If caching is enabled, this parameter sets the cache duration in seconds.

Hologres vector recall

Vector recall supports only Hologres as a data source. All vector data must be stored in Hologres tables.

Example configuration:

{
    "RecallConfs": [
        {
            "Name": "vector_recall",
            "RecallType": "HologresVectorRecall",
            "RecallCount": 100,
            "VectorDaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "HologresTableName": "user_embedding_table",
                "KeyField": "user_id",
                "EmbeddingField": "emb"
            },
            "HologresVectorConf": {
                "VectorTable": "item_embedding_table",
                "VectorEmbeddingField": "emb",
                "VectorKeyField": "item_id"
            }
        }
    ]
}

VectorDaoConf:

Parameter

Type

Required

Description

AdapterType

string

Yes

The data source type. Must be hologres.

HologresName

string

Yes

The custom name for the Hologres data source, as defined in the HologresConfs section. For example: holo_info.

HologresTableName

string

Yes

The name of the vector table in Hologres.

KeyField

string

Yes

The primary key field in the vector table.

EmbeddingField

string

Yes

The field that stores vector embeddings.

HologresVectorConf:

Parameter

Type

Required

Description

VectorTable

string

Yes

The item vector table in Hologres.

VectorEmbeddingField

string

Yes

The field in the item vector table that stores vectors.

VectorKeyField

string

Yes

The primary key field in the item vector table.

The VectorDaoConf object defines the user vector table. The table is defined as follows:

BEGIN;
CREATE TABLE "public"."graphsage_user_embedding" (
 "user_id" text NOT NULL,
 "emb" float4[] NOT NULL,
 "dt" text,
PRIMARY KEY ("user_id")
);
CALL SET_TABLE_PROPERTY('"public"."graphsage_user_embedding"', 'orientation', 'row');
CALL SET_TABLE_PROPERTY('"public"."graphsage_user_embedding"', 'clustering_key', '"user_id:asc"');
CALL SET_TABLE_PROPERTY('"public"."graphsage_user_embedding"', 'time_to_live_in_seconds', '3153600000');
comment on column "public"."graphsage_user_embedding"."user_id" is 'User ID';
comment on column "public"."graphsage_user_embedding"."emb" is 'User feature vector';
comment on column "public"."graphsage_user_embedding"."dt" is 'Date in yyyyMMdd format';
COMMIT;

The HologresVectorConf table stores item vectors:

BEGIN;
CREATE TABLE "public"."graphsage_item_embedding" (
 "item_id" text NOT NULL,
 "emb" float4[] NOT NULL,
PRIMARY KEY ("item_id")
);
CALL SET_TABLE_PROPERTY('"public"."graphsage_item_embedding"', 'orientation', 'column');
CALL SET_TABLE_PROPERTY('"public"."graphsage_item_embedding"', 'bitmap_columns', '"item_id"');
CALL SET_TABLE_PROPERTY('"public"."graphsage_item_embedding"', 'time_to_live_in_seconds', '3153600000');
comment on column "public"."graphsage_item_embedding"."item_id" is 'item ID';
comment on column "public"."graphsage_item_embedding"."emb" is 'item feature vector';
COMMIT;

Real-time Hologres vector recall (OnlineHologresVectorRecall)

Real-time vector recall is similar to standard vector recall, as both use data from a Hologres table. The key difference is that the user vector is generated in real time by a model, not retrieved from a table. This vector then queries the item vector table. The process has three main steps:

  • Retrieve user features by querying a data table.

  • Generate the user vector by calling the vector model deployed on Elastic Algorithm Service (EAS).

  • Similarly, query the item vector table to retrieve item vectors.

Example configuration:

{
    "RecallConfs": [
        {
            "Name": "online_vector_recall",
            "RecallType": "OnlineHologresVectorRecall",
            "RecallCount": 500,
            "UserFeatureConfs": [
                {
                    "FeatureDaoConf": {
                        "AdapterType": "hologres",
                        "HologresName": "holo_info",
                        "FeatureKey": "user:uid",
                        "UserFeatureKeyName": "userid",
                        "HologresTableName": "user_all_feature_table",
                        "UserSelectFields": "*",
                        "FeatureStore": "user"
                    },
                    "Features": []
                }
            ],
            "RecallAlgo": "sv_v2_mind",
            "HologresVectorConf": {
                "HologresName": "holo_info",
                "VectorTable": "item_embedding_table",
                "VectorEmbeddingField": "item_emb",
                "VectorKeyField": "item_id"
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

Specifies the custom recall name.

RecallType

string

Yes

Specifies the recall type. The value must be OnlineHologresVectorRecall.

RecallCount

int

Yes

Specifies the recall count.

RecallAlgo

string

Yes

Specifies the name of the vector model to use, which must be configured in AlgoConfs as specified in the re-ranking configuration.

UserFeatureConfs:

Parameter

Type

Required

Description

AdapterType

string

Yes

The type of the data source. Must be hologres.

HologresName

string

Yes

The name of the Hologres data source, as defined in HologresConfs. For example: holo_info.

FeatureKey

string

Yes

Specifies the source of the user_id for the engine. For example, user:uid represents the user's uid feature.

UserFeatureKeyName

string

Yes

The primary key field in the user feature table.

HologresTableName

string

Yes

The name of the user feature table.

UserSelectFields

string

Yes

Specifies the features to select. Use * to select all features or a comma-separated list of feature names, such as f1,f2,....

FeatureStore

string

Yes

Specifies where to store the features in the engine. Valid values: user and item.

HologresVectorConf:

Parameter

Type

Required

Description

HologresName

string

Yes

The name of the Hologres data source, defined in HologresConfs. For example: holo_info.

VectorTable

string

Yes

The name of the item vector table in Hologres.

VectorEmbeddingField

string

Yes

The field in the item vector table that stores vector embeddings.

VectorKeyField

string

Yes

The primary key field in the item vector table.

The sv_v2_mind model is defined in AlgoConfs as follows:

{
    "AlgoConfs": [
        {
            "Name": "sv_v2_mind",
            "Type": "EAS",
            "EasConf": {
                "Processor": "EasyRec",
                "Timeout": 100,
                "ResponseFuncName": "easyrecUserEmbResponseFunc",
                "Url": "http://xxx.vpc.cn-beijing.pai-eas.aliyuncs.com/api/predict/sv_v2_mind",
                "Auth": "xxx"
            }
        }
    ]
}

The configuration is the same as a ranking model's, except that the ResponseFuncName parameter must be set to easyrecUserEmbResponseFunc.

FAISS online vector recall

The OnlineVectorRecall component connects to an online vector recall service implemented with the TorchEasyRec Processor. Unlike OnlineHologresVectorRecall, OnlineVectorRecall does not rely on a Hologres item vector table for online retrieval. Instead, it performs feature encoding, User Tower inference, and FAISS TopK retrieval within the PAI-EAS service and directly returns a list of recalled items.

The online request process:

  • The PAI-Rec engine sends a request with the raw user features.

  • The TorchEasyRec Processor internally performs feature encoding for the FG module, which is consistent with the offline process.

  • The User Tower generates the user embedding via online inference.

  • The user embedding is used to retrieve the top-K similar items from the FAISS index.

  • A list of item IDs and their corresponding distance scores is returned for fine-ranking.

Example configuration file for a recommendation engine:

{
    "RecallConfs": [{
        "Name": "{model_name}",
        "RecallType": "OnlineVectorRecall",
        "RecallCount": 200,
        "RecallAlgo": "{model_name}",
        "VectorAlgoType": "torchrec_vector"
    }],
    "AlgoConfs": [{
        "Name": "{model_name}",
        "Type": "EAS",
        "EasConf": {
            "Processor": "EasyRec",
            "ResponseFuncName": "torchrecEmbeddingItemsResponseFunc",
            "Url": "http://{aliyun_id}.vpc.{region}.pai-eas.aliyuncs.com/api/predict/{model_name}",
            "EndpointType": "DIRECT",
            "Auth": "{eas_token}"
        }
    }]
}

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall, which can be referenced in SceneConfs.

RecallType

string

Yes

The type of recall. The value must be OnlineVectorRecall.

RecallCount

int

Yes

The number of items to recall.

RecallAlgo

string

Yes

The name of the online model to invoke. This model must be configured in AlgoConfs.

VectorAlgoType

string

Yes

The algorithm for online vector recall. The value must be torchrec_vector.

EasConf Configuration Parameters

Parameter

Type

Required

Description

Processor

string

Yes

Set to EasyRec.

ResponseFuncName

string

Yes

Set to torchrecEmbeddingItemsResponseFunc. This function parses the item list and scores that are returned by the online service.

Url

string

Yes

The service endpoint of EAS.

EndpointType

string

No

The access mode. Example: DIRECT.

Auth

string

Yes

The credentials that are used to access the EAS service.

Note

  • RecallAlgo must match AlgoConfs.Name.

  • OnlineVectorRecall uses the EasyRec Processor online service for recall and requires no separate Hologres item vector table.

  • In the current reference configuration, VectorAlgoType is torchrec_vector.

  • ResponseFuncName must be torchrecEmbeddingItemsResponseFunc.

  • The online service internally performs FG encoding, User Tower inference, and FAISS search, then directly returns the recall results.

Differences from OnlineHologresVectorRecall

  • OnlineVectorRecall: Computes the user embedding, performs internal FAISS retrieval, and returns a list of items.

  • OnlineHologresVectorRecall: Returns only the user embedding, allowing PAI-Rec to perform recall using the Hologres item vector table.

U2I recall (UserCustomRecall)

Hologres

Retrieves a list of items based on a user ID. The table uses a predefined schema.

U2I table

Parameter

Type

Description

user_id

string

The user ID.

item_ids

string

A list of item IDs. Supported formats: item_id1,item_id2,item_id3....., item_id1:recall_id1,item_id2:recall_id2....., or item_id1:recall_id1:score1,item_id2:recall_id2:score2......

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "user2item_recall",
            "RecallType": "UserCustomRecall",
            "RecallCount": 500,
            "DaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "HologresTableName": "user_item_table"
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

The custom name for the recall.

RecallType

string

Yes

The recall type. Set this to UserCustomRecall.

RecallCount

int

Yes

The number of items to recall.

DaoConf

json object

Yes

The DAO configuration.

AdapterType

string

Yes

The data source type. Set this to hologres.

HologresName

string

The custom name of the Hologres data source, as configured in HologresConfs. For example, holo_info.

HologresTableName

string

Yes

The name of the U2I table in Hologres.

PAI-FeatureStore

Retrieves a list of items based on a user ID. The table uses a predefined schema.

The data for this table is generated in MaxCompute and must be registered as an offline feature view in PAI-FeatureStore. The MaxCompute table must use the following schema.

U2I table

Parameter

Type

Description

user_id

string

The user ID.

item_ids

string

A list of item IDs. Supported formats: item_id1,item_id2,item_id3....., item_id1:recall_id1,item_id2:recall_id2....., or item_id1:recall_id1:score1,item_id2:recall_id2:score2......

ds

string

The partition field of the MaxCompute table. This field name is customizable.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "user2item_recall",
            "RecallType": "UserCustomRecall",
            "RecallCount": 500,
            "DaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "FeatureStoreViewName": "u2i_recall"
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

The custom name for the recall.

RecallType

string

Yes

The recall type. Set this to UserCustomRecall.

RecallCount

int

Yes

The number of items to recall.

DaoConf

json object

Yes

The DAO configuration.

AdapterType

string

Yes

The data source type. Set this to featurestore.

FeatureStoreName

string

The custom name of the PAI-FeatureStore data source, as configured in FeatureStoreConfs. For example, fs_pairec.

FeatureStoreViewName

string

Yes

The name of the feature view for the U2I table.

Tablestore

Retrieves a list of items based on a user ID. The table uses a predefined schema.

U2I table

Parameter

Type

Description

user_id

string

The user ID.

item_ids

string

A list of item IDs. Supported formats: item_id1,item_id2,item_id3....., item_id1:recall_id1,item_id2:recall_id2....., or item_id1:recall_id1:score1,item_id2:recall_id2:score2......

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "user2item_recall",
            "RecallType": "UserCustomRecall",
            "RecallCount": 500,
            "DaoConf": {
                "AdapterType": "tablestore",
                "TableStoreName": "ots_info",
                "TableStoreTableName": "user_item_table"
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

The custom name for the recall.

RecallType

string

Yes

The recall type. Set this to UserCustomRecall.

RecallCount

int

Yes

The number of items to recall.

DaoConf

json object

Yes

The DAO configuration.

AdapterType

string

Yes

The data source type. Set this to tablestore.

TableStoreName

string

The custom name of the Tablestore data source, as configured in TableStoreConfs. For example, ots_info.

TableStoreTableName

string

Yes

The name of the U2I table in Tablestore.

Redis

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "user2item_recall",
            "RecallType": "UserCustomRecall",
            "RecallCount": 500,
            "DaoConf": {
                "AdapterType": "redis",
                "RedisName": "redis_info",
                "RedisPrefix": ""
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

The custom name for the recall.

RecallType

string

Yes

The recall type. Set this to UserCustomRecall.

RecallCount

int

Yes

The number of items to recall.

DaoConf

json object

Yes

The DAO configuration.

AdapterType

string

Yes

The data source type. Set this to redis.

RedisName

string

The custom name of the Redis data source, as configured in RedisConfs. For example, redis_info.

RedisPrefix

string

Yes

The prefix for the U2I data key. The full key is constructed by concatenating this prefix with the user ID. The value can be a string in one of the following formats: item_id1,item_id2,item_id3....., item_id1:recall_id1,item_id2:recall_id2....., or item_id1:recall_id1:score1,item_id2:recall_id2:score2......

GraphRecall

Graph retrieval, a type of U2I retrieval, uses the GraphCompute graph database.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "graph_recall",
            "RecallType": "GraphRecall",
            "RecallCount": 500,
            "GraphConf": {
                "GraphName": "graph_test",
                "ItemId": "item_id",
                "QueryString": "g(\"test\").V(\"$1\").hasLabel(\"user\").outE().inV()",
                "Params": [
                    "user.uid"
                ]
            }
        }
    ]
}

GraphConf:

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall.

RecallType

string

Yes

The recall type. The value must be GraphRecall.

RecallCount

int

Yes

The number of items to recall.

GraphName

string

Yes

The name of the graph defined in the GraphConfs data source configuration. For example, graph_info.

ItemId

string

Yes

The primary key of an item in the graph query results.

QueryString

string

Yes

The Gremlin query string for graph recall. It supports placeholders, such as $1, that are populated by values from the Params parameter.

Params

string

Yes

The source of the values used to populate placeholders in the QueryString. The supported formats are as follows:

  • user.xxx: The value of the xxx user feature.

  • context.xxx: The value of the xxx feature from the request context.

  • context.features.xxx: The value of the xxx feature in the request's features field.

User group hot recall (UserGroupHotRecall)

Hologres

The user group hot recall table has a predefined schema.

group_hot_table

Field

Type

Description

trigger_id

string

An ID constructed from the values of multiple features.

item_ids

string

A list of item IDs. Supported formats: item_id1,item_id2,item_id3..., item_id1:recall_id1,item_id2:recall_id2..., or item_id1:recall_id1:score1,item_id2:recall_id2:score2....

The trigger_id combines user features and contextual information, such as region and OS.

  • Concatenate the feature values in order with an underscore (_) to form the trigger_id.

  • If a feature value is empty, use the string "NULL".

  • Features that include a Boundaries parameter must be discretized into left-open, right-closed intervals. For example, for age boundaries of [20, 30, 40, 50], the resulting trigger values are <=20, 20-30, 30-40, 40-50, and >50.

A user age of 23 corresponds to "20-30".

An empty user age corresponds to "NULL".

A user age of 60 corresponds to ">50".

A user age of 19 corresponds to "<=20".

Hologres table example:

This example uses three features: gender, age, and OS.

trigger_id

item_ids

Male_<=20_IOS

item_id1::score1,item_id2::score2...

Female_20-30_Android

item_id4::score4,item_id5::score5...

...

...

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "user_group_hot_recall",
            "RecallType": "UserGroupHotRecall",
            "RecallCount": 500,
            "Triggers": [
                {
                    "TriggerKey": "gender"
                },
                {
                    "TriggerKey": "age",
                    "Boundaries": [20,30,40,50]
                },
                {
                    "TriggerKey": "os"
                }
            ],
            "DaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "HologresTableName": "group_hotness_table"
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall configuration.

RecallType

string

Yes

The recall type. Set this to UserGroupHotRecall.

RecallCount

int

Yes

The number of items to recall.

Triggers

json array

Yes

Defines the features used to construct the trigger_id.

  • TriggerKey

string

Yes

The key that retrieves the trigger value from user features.

  • Boundaries

json int array

No

An array of boundary values for discretizing a numerical feature.

DaoConf

json object

Yes

The data access object (DAO) definition.

  • AdapterType

string

Yes

The data source type. Set this to hologres.

  • HologresName

string

Yes

The custom name of the Hologres data source, as configured in HologresConfs. For example, holo_info.

  • HologresTableName

string

Yes

The name of the Hologres data table.

PAI-FeatureStore

The user group hot recall table has a predefined schema.

You prepare the data for this table in MaxCompute. You must register the table with PAI-FeatureStore as an offline feature view. The MaxCompute table requires the following schema.

group_hot_table

Field

Type

Description

trigger_id

string

An ID constructed from the values of multiple features.

item_ids

string

A list of item IDs. Supported formats: item_id1,item_id2,item_id3..., item_id1:recall_id1,item_id2:recall_id2..., or item_id1:recall_id1:score1,item_id2:recall_id2:score2....

ds

string

The partition field for the MaxCompute table. The field name is customizable.

The trigger_id combines user features and contextual information, such as region and OS.

  • Concatenate the feature values in order with an underscore (_) to form the trigger_id.

  • If a feature value is empty, use the string "NULL".

  • Features that include a Boundaries parameter must be discretized into left-open, right-closed intervals. For example, for age boundaries of [20, 30, 40, 50], the resulting trigger values are <=20, 20-30, 30-40, 40-50, and >50.

A user age of 23 corresponds to "20-30".

An empty user age corresponds to "NULL".

A user age of 60 corresponds to ">50".

A user age of 19 corresponds to "<=20".

MaxCompute table example:

This example uses three features: gender, age, and OS.

trigger_id

item_ids

Male_<=20_IOS

item_id1::score1,item_id2::score2...

Female_20-30_Android

item_id4::score4,item_id5::score5...

...

...

This configuration uses a trigger feature entity.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "user_group_hot_recall",
            "RecallType": "UserGroupHotRecall",
            "RecallCount": 500,
            "Triggers": [
                {
                    "TriggerKey": "gender"
                },
                {
                    "TriggerKey": "age",
                    "Boundaries": [20,30,40,50]
                },
                {
                    "TriggerKey": "os"
                }
            ],
            "DaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "FeatureStoreViewName": "group_hot_recall"
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall configuration.

RecallType

string

Yes

The recall type. Set this to UserGroupHotRecall.

RecallCount

int

Yes

The number of items to recall.

Triggers

json array

Yes

Defines the features used to construct the trigger_id.

  • TriggerKey

string

Yes

The key that retrieves the trigger value from user features.

  • Boundaries

json int array

No

An array of boundary values for discretizing a numerical feature.

DaoConf

json object

Yes

The data access object (DAO) definition.

  • AdapterType

string

Yes

The data source type. Set this to featurestore.

  • FeatureStoreName

string

Yes

The custom name of the PAI-FeatureStore data source, as configured in FeatureStoreConfs. For example, fs_pairec.

  • FeatureStoreViewName

string

Yes

The name of the feature view for the hot recall table.

Important

If the hot recall count for a grouping is consistently 0, ensure the concatenation order of Triggers in the engine configuration matches the order in the recall table.

Global hot recall (UserGlobalHotRecall)

Hologres

The table schema for global hot recall is the same as that for group recall, except that the global hot recall table contains only one record, and its trigger_id is -1.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "UserGlobalHotRecall",
            "RecallType": "UserGlobalHotRecall",
            "RecallCount": 500,
            "DaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "HologresTableName": "global_hotness_table"
            }
        }
    ]
}

PAI-FeatureStore

The table schema for global hot recall is the same as that for group recall, except that the global hot recall table contains only one record, and its trigger_id is -1.

The table data is generated in MaxCompute. You must register the table in Feature Store by using an offline FeatureView. The schema for the MaxCompute table is as follows.

Field

Type

Description

trigger_id

string

The table contains only one row, and the value of this field is -1.

item_ids

string

A list of item IDs. Supported formats: item_id1,item_id2,item_id3..., item_id1:recall_id1,item_id2:recall_id2..., or item_id1:recall_id1:score1,item_id2:recall_id2:score2....

ds

string

The partition field for the MaxCompute table. The field name is customizable.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "UserGlobalHotRecall",
            "RecallType": "UserGlobalHotRecall",
            "RecallCount": 500,
            "DaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "FeatureStoreViewName": "global_hot_recall"
            }
        }
    ]
}

Tablestore

The table schema for global hot recall is the same as that for group recall, except that the global hot recall table contains only one record, and its trigger_id is -1.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "UserGlobalHotRecall",
            "RecallType": "UserGlobalHotRecall",
            "RecallCount": 500,
            "DaoConf": {
                "AdapterType": "tablestore",
                "TableStoreName": "ots_info",
                "TableStoreTableName": "global_hotness_recall"
            }
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall configuration.

RecallType

string

Yes

The recall type. Must be UserGlobalHotRecall.

RecallCount

int

Yes

The number of items to recall.

DaoConf

json object

Yes

Specifies the Data Access Object (DAO) configuration.

AdapterType

string

Yes

The data source type. Must be tablestore.

TableStoreName

string

The name of the Tablestore instance, as defined in TableStoreConfs. For example, tablestore_info.

TableStoreTableName

string

Yes

The name of the data table in the Tablestore instance.

Cold start recall

An item table is provided and filtered based on conditions or time to query for a candidate set that meets specified rules.

Hologres

{
    "RecallConfs": [
        {
            "Name": "AllLiveItemRecall",
            "RecallType": "ColdStartRecall",
            "RecallCount": 3000,
            "ColdStartDaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "HologresTableName": "item_status_table",
                "WhereClause": "islist_status=1",
                "PrimaryKey": "\"item_id\"",
                "TimeInterval": 0
            }
        }
    ]
}

ColdStartDaoConf:

Parameter

Type

Required

Description

Name

string

Yes

Custom recall name

RecallType

string

Yes

The recall type. The value must be ColdStartRecall.

RecallCount

int

Yes

The number of items to recall.

ColdStartDaoConf

json object

Yes

The configuration for cold start data.

AdapterType

string

Yes

The type of the data source, such as Hologres.

HologresName

string

Yes

The custom name of the Hologres instance, as configured in HologresConfs. For example, holo_info.

HologresTableName

string

Yes

The name of the cold start recall table in Hologres.

WhereClause

string

No

A filter condition. To filter by time, use the ${time} placeholder. For example, to filter based on creation time, you can use create_time > ${time}.

PrimaryKey

string

Yes

The primary key of the table.

TimeInterval

int

No

The time offset for calculating the ${time} variable.

The ${time} variable is calculated as: current time - TimeInterval.

You can use WhereClause to filter the candidate set based on features from the API request or user features. For example, to filter the candidate set by language and the user's city, you can set WhereClause to:

"language=${context.features.language} AND city=${user.city}"

In this example, language comes from the features field of the API request, and city is a user feature.

Parameter sources follow these formats:

  • user.xxx: Retrieves the value of the user feature named xxx.

  • context.features.xxx: Retrieves the value of the feature named xxx from the features field of the API request.

PAI-FeatureStore

Warning

This feature supports only FeatureViews that use FeatureDB as the online data source.

This feature randomly recalls a batch of item IDs from a FeatureView that uses the item ID as its primary key.

{
    "RecallConfs": [
        {
            "Name": "item_cold_start_recall",
            "RecallType": "ColdStartRecall",
            "RecallCount": 200,
            "ColdStartDaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "FeatureStoreViewName": "rec_sln_demo_item_table_preprocess_all_feature_v1"
            },
            "FilterParams": [
            ]
        }
    ]
}

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall.

RecallType

string

Yes

The recall type. The value must be ColdStartRecall.

RecallCount

int

Yes

The number of items to recall.

ColdStartDaoConf

json object

Yes

The configuration for cold start data.

AdapterType

string

Yes

The type of the data source. The value must be featurestore.

FeatureStoreName

string

Yes

The custom name of the PAI-FeatureStore instance, as configured in FeatureStoreConfs.

FeatureStoreViewName

string

Yes

The name of the FeatureView for cold start recall.

FilterParams

string

No

The filter conditions for cold start recall.

The FeatureView specified by FeatureStoreViewName can be an offline or a real-time FeatureView. If you use a real-time FeatureView, this configuration also enables real-time recall of newly added item IDs.

If FilterParams is empty, no filter conditions are applied, and item IDs are recalled randomly. Use FilterParams to filter for specific item IDs.

{
            "Name": "item_cold_start_recall",
            "RecallType": "ColdStartRecall",
            "RecallCount": 200,
            "ColdStartDaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "FeatureStoreViewName": "rec_sln_demo_item_table_preprocess_all_feature_v1"
            },
            "FilterParams": [
                {
                    "Name": "click_count",
                    "Type": "int",
                    "Operator": "greater",
                    "Value": "15"
                },
                {
                    "Name": "category",
                    "Type": "string",
                    "Operator": "in",
                    "Value": "user.category"
                }
            ]
        }

In the preceding example, the user. prefix in the Value field specifies that the value is retrieved from a user feature. For instance, user.category retrieves the value from the user's category feature.

For more information about how to use the Operator parameter, see the appendix.

Contextual item recall

You can also use the item_list parameter to pass custom recalled items to the engine API. For details on the engine API, see API testing.

Use ContextItemRecall, the engine's built-in recall name, directly in RecallNames as follows:

{
    "SceneConfs": {
        "${scene_name}": {
            "default": {
                "RecallNames": [
                    "ContextItemRecall"
                ]
            }
        }
    }
}

I2I recall (ItemCollaborativeFilterRecall)

Hologres

I2I recall is used for similarity recommendation. To retrieve similar items, you must pass the item_id of a source item. For the API definition, see API testing.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "I2IRecall",
            "RecallType": "ItemCollaborativeFilterRecall",
            "RecallCount": 500,
            "ItemCollaborativeDaoConf": {
                "AdapterType": "hologres",
                "HologresName": "holo_info",
                "Item2ItemTable": "item_collaborative_list"
            }
        }
    ]
}

The following table describes the configuration parameters.

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall.

RecallType

string

Yes

The recall type. This value must be ItemCollaborativeFilterRecall.

RecallCount

int

Yes

The number of similar items to retrieve.

ItemCollaborativeDaoConf

json object

Yes

The configuration for the I2I data table.

  • AdapterType

string

Yes

The type of the data source. Must be set to hologres.

  • HologresName

string

Yes

The custom name of the Hologres instance, as configured in HologresConfs. Example: holo_info.

  • Item2ItemTable

string

Yes

The name of the I2I data table.

The Item2ItemTable table is defined as follows:

Parameter

Type

Description

item_id

string

The source item ID.

item_ids

string

A string that contains a list of similar item IDs. Supported formats: item_id1,item_id2,item_id3..., item_id1:recall_id1,item_id2:recall_id2..., or item_id1:recall_id1:score1,item_id2:recall_id2:score2....

PAI-FeatureStore

I2I recall is used for similarity recommendation. To retrieve similar items, you must pass the item_id of a source item. For the API definition, see API testing.

The Item2ItemTable table is defined as follows:

Parameter

Type

Description

item_id

string

The source item ID.

item_ids

string

A string that contains a list of similar item IDs. Supported formats: item_id1,item_id2,item_id3..., item_id1:recall_id1,item_id2:recall_id2..., or item_id1:recall_id1:score1,item_id2:recall_id2:score2....

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "I2IRecall",
            "RecallType": "ItemCollaborativeFilterRecall",
            "RecallCount": 200,
            "ItemCollaborativeDaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "FeatureStoreViewName": "i2i_recall"
            }
        }
    ]
}

The following table describes the configuration parameters.

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall.

RecallType

string

Yes

The recall type. This value must be ItemCollaborativeFilterRecall.

RecallCount

int

Yes

The number of similar items to retrieve.

ItemCollaborativeDaoConf

json object

Yes

The configuration for the I2I data table.

  • AdapterType

string

Yes

The type of the data source. Must be set to featurestore.

  • FeatureStoreName

string

Yes

The custom name of the PAI-FeatureStore instance, as configured in FeatureStoreConfs. Example: fs_pairec.

  • FeatureStoreViewName

string

Yes

The name of the data table view for I2I.

EnableMultipleItemId

bool

No

Specifies whether the item_id parameter contains multiple values.

MultipleItemIdDelimiter

string

No

The delimiter for multiple item IDs when EnableMultipleItemId is true. The default value is ,.

If the item_id passed to the API is in a multi-value format and is delimited by ,, you can refer to the following configuration:

{
    "RecallConfs": [
        {
            "Name": "I2IRecall",
            "RecallType": "ItemCollaborativeFilterRecall",
            "RecallCount": 200,
            "ItemCollaborativeDaoConf": {
                "AdapterType": "featurestore",
                "FeatureStoreName": "fs_pairec",
                "FeatureStoreViewName": "i2i_recall"
            },
            "EnableMultipleItemId": true,
            "MultipleItemIdDelimiter": ","
        }
    ]
}
Note

For Redis or a local cache, the cache key is item_id.

For I2I recall, set the item_id field in your API request.

OpenSearch recall

Call the OpenSearch service to retrieve a recall list. For details, refer to the documentation for the Industry Algorithm Edition.

Configuration example:

{
    "RecallConfs": [
        {
            "Name": "OpenSearchRecall",
            "RecallType": "OpenSearchRecall",
            "OpenSearchConf": {
                "OpenSearchName": "OpenSearch",
                "AppName": "test_search",
                "ItemId": "log_id",
                "RequestParams": {
                    "query": "query=result:'$1'&&config=start:0,hit:10,format:fulljson&&sort=-log_id&&filter=request_time>1703952000000",
                    "format": "fulljson",
                    "second_rank_type": "expression",
                    "fetch_fields": "log_id;result_data"
                },
                "Params": [
                    "context.features.topic"
                ]
            }
        }
    ]
}

The example above shows a query on the result index, where the query term is obtained from the topic field of features in the API request's context.

OpenSearchConf configuration fields:

Parameter

Type

Required

Description

Name

string

Yes

A custom name for the recall.

RecallType

string

Yes

The recall type. The value must be OpenSearchRecall.

RecallCount

int

Yes

The number of items to recall.

OpenSearchName

string

Yes

The custom name for the OpenSearch instance, as specified in OpenSearchConfs.

AppName

string

Yes

The name of the OpenSearch application.

ItemId

string

Yes

The primary key field for items in the OpenSearch results.

RequestParams

map[string]interface{}

Yes

The OpenSearch query statement. Placeholders, such as $1, take their values from Params. For syntax details, see the developer guide.

Params

string

Yes

The source of values for query placeholders. The following formats are supported:

  • user.xxx: Populates a placeholder, such as $N, with the value of the xxx feature from user features.

  • context.xxx: Populates a placeholder, such as $N, with the value of the xxx feature from the API request.

  • context.features.xxx: Populates a placeholder with the value of the xxx feature from the features field in the API request.

Usage

You can configure recall settings under SceneConfs in the Configuration Overview. SceneConfs is a Map[string]object that allows you to apply different recall configurations for each scene. The configuration is as follows:

"SceneConfs": {
  "${scene_name}": {
    "default": {
      "RecallNames": [
        "collaborative_filter"
      ]
    }
  }
}
  • Replace ${scene_name} with your scene name.

  • default is a directory. You can keep the default.

  • RecallNames is a []string specifying custom recall names from your recall configuration.