Use the Recommendations API when you want to show related or connected items outside the main autocomplete flow.

Two families of endpoints:

  • Graph recommendations (/v1/graph/...) use the product knowledge graph: series, application, specs, entity connections, and co-clicks.
  • Behavior recommendations (/v1/recommendations/behavior/...) use item embeddings trained on click sessions.

What it does

These endpoints return products or documents that are related through structure, shared series, application fit, specs, user preference signals, or behavioral relationships such as co-click patterns.

They are a strong fit for:

  • related products modules
  • product detail page suggestions
  • accessory and compatibility flows
  • discovery rails and next-best-item experiences

Graph recommendations

Requirements

Requirement Applies to
Paid plan (403 on free plans) All graph routes, including user-preferences
Knowledge graph enabled in the index schema All graph routes except user-preferences

user-preferences takes no index and does not check the knowledge graph setting.

Common parameters

  • index (query, required): index ID.
  • product_id (query, required): product external ID. document_id is accepted as an alias. If neither is supplied, the response is 422.

GET /v1/graph/recommendations/structural

Combines series, application, and spec matches for one product.

Parameter Type Default Range
index string required
product_id / document_id string required
include_series bool true
include_application bool true
include_specs bool true
limit_per_type int 5 1–50

Response:

{
  "product_id": "SG729PT",
  "recommendations": ["SG730PT", "SG731PT", "OTHER_PUMP"],
  "counts": {"total": 3, "series": 2, "application": 4, "specs": 1}
}

counts.total is the length of recommendations. The other keys are the number of matches found for each type.

GET /v1/graph/recommendations/series

Products in the same series.

Parameter Type Default Range
index string required
product_id / document_id string required
limit int 10 1–50

Response:

{"product_id": "SG729PT", "series_products": ["SG730PT", "SG731PT"]}

GET /v1/graph/recommendations/application

Products for the same application.

Parameter Type Default Range
index string required
product_id / document_id string required
limit int 10 1–50

Response:

{"product_id": "SG729PT", "application_products": ["OTHER_PUMP", "SG730PT"]}

GET /v1/graph/recommendations/specs

Products with overlapping technical specs.

Parameter Type Default Range
index string required
product_id / document_id string required
min_matching_specs int 1 1 or more
limit int 10 1–50

Response:

{"product_id": "SG729PT", "similar_specs_products": ["SG730PT"]}

POST /v1/graph/connected

Products connected to one or more entity nodes.

Query: index (required).

Request body:

{
  "entity_keys": ["brand:LMI", "spec:diaphragm:PTFE"],
  "rel_types": ["MADE_BY", "HAS_SPEC"]
}
  • entity_keys (required, at least one): entity node keys. seed_ids is accepted as an alias.
  • rel_types (optional): restrict to these relationship types.

Response:

{
  "entity_keys": ["brand:LMI", "spec:diaphragm:PTFE"],
  "products": ["SG729PT", "SG730PT", "OTHER_PUMP"]
}

GET /v1/graph/user-preferences

Entities a user has shown preference for, with weights. Paid plan only.

Parameter Type Default Range
user_id string required
limit int 50 1–100

Response:

{
  "user_id": "user123",
  "preferences": {"brand:LMI": 5.0, "application:Chemical Metering": 3.0}
}

GET /v1/graph/co-clicked

Products frequently viewed together with the given product.

Parameter Type Default Range
index string required
product_id / document_id string required
limit int 10 1–50

Response:

{"product_id": "SG729PT", "co_clicked_products": ["SG730PT", "OTHER_PUMP"]}

Graph errors

Status Meaning
400 Knowledge graph is not enabled for the index. Enable it in the index schema.
403 Tenant is on a free plan.
404 Index not found or not owned by the tenant.
422 product_id (or document_id) is missing, or a request body fails validation.

Behavior recommendations

Behavior recommendations require behavior_recommendations.enabled in the index schema. They are served from embeddings trained on click sessions. Each request also requires a paid plan.

Behavior errors

Status Meaning
400 Behavior recommendations are not enabled for the index.
403 Tenant is on a free plan.
404 Index not found or not owned by the tenant.

GET /v1/recommendations/behavior/similar

Items similar to a seed product.

Parameter Type Default Range
index string required
product_id string required
limit int 10 1–50

Response:

{
  "product_id": "SG729PT",
  "items": [
    {"external_id": "SG730PT", "score": 0.91, "source": "behavior"},
    {"external_id": "OTHER_PUMP", "score": 0.74, "source": "content"}
  ],
  "model_version": "2026-11-01",
  "fallback_used": false
}

source is behavior when the item comes from click-session embeddings, or content when it falls back to content embeddings. fallback_used is true when the first item is a content match.

GET /v1/recommendations/behavior/next

Items users tend to click next after a product.

Parameter Type Default Range
index string required
product_id string required
limit int 10 1–50

Response:

{
  "product_id": "SG729PT",
  "items": [
    {"external_id": "SG730PT", "probability": 0.22, "rank": 1},
    {"external_id": "OTHER_PUMP", "probability": 0.11, "rank": 2}
  ],
  "model_version": "2026-11-01"
}

POST /v1/recommendations/behavior/for-user

Recommendations for a shopper based on recent clicks. Items in recent_external_ids are excluded from the results.

Request body:

{
  "index": "ecommerce",
  "recent_external_ids": ["SG729PT", "OTHER_PUMP"],
  "limit": 10
}
  • index (required)
  • recent_external_ids (required, 1–100 items)
  • limit (optional, default 10, range 1–50)

Response:

{
  "items": [
    {"external_id": "SG730PT", "score": 0.88, "source": "behavior"}
  ],
  "model_version": "2026-11-01",
  "seed_count": 2
}

When to use it

Use recommendations when you want to answer questions like:

  • what should this shopper see next?
  • what products are similar or compatible?
  • what do users often click together?