Recommendations

Composite Recommendation

Composite Recommendation returns both a source entity (e.g., an Item or Item Segment) and a list of related recommendations in a single response.

It is ideal for use cases such as personalized homepage sections (Articles from <category>), Because You Watched <movie>, or Artists Related to Your Favorite Artist <artist>.

See detailed examples and configuration guidance in the Composite Scenarios documentation.

Structure

The endpoint operates in two stages:

  1. Recommends the source (e.g., an Item Segment or item) to the user.
  2. Recommends results (items or Item Segments) related to that source.

For example, Articles from <category> can be decomposed into:

Since the first step uses Recommend Item Segments To User, you must include the userId parameter in the Composite Recommendation request.

Each Composite Recommendation counts as a single recommendation API request for billing.

Stage-specific Parameters

Additional parameters can be supplied via sourceSettings and resultSettings. In the example above:

See this example for more details.

post/{databaseId}/recomms/composite/

Path parameters

databaseIdstring required

ID of your database.

Request body

scenariostring required

Scenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".

You can set various settings to the scenario in the Admin UI. You can also see the performance of each scenario in the Admin UI separately, so you can check how well each application performs.

The AI that optimizes models to get the best results may optimize different scenarios separately or even use different models in each of the scenarios.

countinteger required

Number of items to be recommended (N for the top-N recommendation).

itemIdstring

ID of the item for which the recommendations are to be generated.

userIdstring

ID of the user for which the recommendations are to be generated.

segmentIdstring

ID of the segment from contextSegmentationId for which the recommendations are to be generated.

searchQuerystring

Search query provided by the user. It is used for the full-text search. Only applicable if the scenario corresponds to a search scenario.

cascadeCreateboolean

If the entity for the source recommendation does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that entity, as the entity will be already known to the system.

sourceSettingsobject

Parameters applied for recommending the Source stage. The accepted parameters correspond with the recommendation sub-endpoint used to recommend the Source.

resultSettingsobject

Parameters applied for recommending the Result stage. The accepted parameters correspond with the recommendation sub-endpoint used to recommend the Result.

expertSettingsobject

Dictionary of custom options.

Response

Successful operation.

recommIdstring required

Id of the composite recommendation request

numberNextRecommsCallsinteger

How many times Recommend Next Items have been called for this recommId

Changes

No recorded changes to this endpoint across all 1 revision of this API.