Search docs ⌘K
esc
Type to search across all documentation pages
Ranking

Ranking

Narrow ranking primitives for caller-owned collections, item embeddings, signal logs, ranked results, and related-item lookups. The surface stays intentionally focused on ranking and affinity, not campaign orchestration or merchandising rules.

Scope: This is not a full recommender system product. You still own experiments, promotions, checkout rules, and application-specific ranking policy.

Create Ranking Collection

GET
typescript
const collection = await ss.infra.decisioning.ranking.createCollection({ name: 'products', strategy_default: 'hybrid', embedding_model: 'workers-ai:bge-m3' })
  1. Open Dashboard → Decisioning and select your project
  2. Go to the Ranking workspace
  3. Create the collection from the workspace rail, pick the default ranking strategy, and immediately pin it as the active collection.

List Ranking Collections

GET
typescript
const { collections } = await ss.infra.decisioning.ranking.listCollections()
  1. Open Dashboard → Decisioning and select your project
  2. Go to the Ranking workspace
  3. Use the workspace rail to browse saved collections for the active project and switch the selected collection before running any operators.

Get Ranking Collection

GET
typescript
const collection = await ss.infra.decisioning.ranking.getCollection('rcol_123')
  1. Open Dashboard → API Console and select your project
  2. Choose GET /infra/decisioning/ranking/collections/{collection_id} from the route list
  3. Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console

Update Ranking Collection

GET
typescript
const collection = await ss.infra.decisioning.ranking.updateCollection('rcol_123', { description: 'Product affinity workspace' })
  1. Open Dashboard → API Console and select your project
  2. Choose PATCH /infra/decisioning/ranking/collections/{collection_id} from the route list
  3. Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console

Delete Ranking Collection

GET
typescript
await ss.infra.decisioning.ranking.deleteCollection('rcol_123')
  1. Open Dashboard → API Console and select your project
  2. Choose DELETE /infra/decisioning/ranking/collections/{collection_id} from the route list
  3. Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console

Upsert Ranking Items

GET
typescript
await ss.infra.decisioning.ranking.upsertItems('rcol_123', { auto_embed: true, items: [{ id: 'sku_123', title: 'Trail Jacket', text: 'Waterproof shell with breathable lining', metadata: { brand: 'Northline' } }] })
  1. Open Dashboard → Decisioning and select your project
  2. Go to the Ranking workspace
  3. Select the collection, paste the item-upsert JSON into the seed card, and run it to create or refresh item vectors and metadata.

List Ranking Items

GET
typescript
const { items } = await ss.infra.decisioning.ranking.listItems('rcol_123')
  1. Open Dashboard → API Console and select your project
  2. Choose GET /infra/decisioning/ranking/collections/{collection_id}/items from the route list
  3. Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console

Get Ranking Item

GET
typescript
const item = await ss.infra.decisioning.ranking.getItem('rcol_123', 'sku_123')
  1. Open Dashboard → API Console and select your project
  2. Choose GET /infra/decisioning/ranking/collections/{collection_id}/items/{item_id} from the route list
  3. Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console

Delete Ranking Item

GET
typescript
await ss.infra.decisioning.ranking.deleteItem('rcol_123', 'sku_123')
  1. Open Dashboard → API Console and select your project
  2. Choose DELETE /infra/decisioning/ranking/collections/{collection_id}/items/{item_id} from the route list
  3. Fill in the JSON body or Storage references, then send the request and inspect the response directly in the console

Ingest Ranking Signals

GET
typescript
await ss.infra.decisioning.ranking.ingestSignals('rcol_123', { signals: [{ subject_id: 'user_123', item_id: 'sku_123', event: 'view', weight: 1 }] })
  1. Open Dashboard → Decisioning and select your project
  2. Go to the Ranking workspace
  3. Use the signal replay card to post a batch of subject-item events into the selected collection and watch the stats row update.

Rank Items

GET
typescript
const result = await ss.infra.decisioning.ranking.rank('rcol_123', { subject_id: 'user_123', strategy: 'hybrid', limit: 8 })
  1. Open Dashboard → Decisioning and select your project
  2. Go to the Ranking workspace
  3. Paste the rank request JSON into the rank card to debug strategy choice, candidate filtering, and ranked output.

Get Ranking Stats

GET
typescript
const stats = await ss.infra.decisioning.ranking.stats('rcol_123')
  1. Open Dashboard → Decisioning and select your project
  2. Go to the Ranking workspace
  3. Select a collection and read the stats strip to verify item, signal, and subject counts without leaving the workspace.