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' })
- Open Dashboard → Decisioning and select your project
- Go to the Ranking workspace
- 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()
- Open Dashboard → Decisioning and select your project
- Go to the Ranking workspace
- 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')
- Open Dashboard → API Console and select your project
- Choose GET /infra/decisioning/ranking/collections/{collection_id} from the route list
- 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' })
- Open Dashboard → API Console and select your project
- Choose PATCH /infra/decisioning/ranking/collections/{collection_id} from the route list
- 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')
- Open Dashboard → API Console and select your project
- Choose DELETE /infra/decisioning/ranking/collections/{collection_id} from the route list
- 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' } }] })
- Open Dashboard → Decisioning and select your project
- Go to the Ranking workspace
- 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')
- Open Dashboard → API Console and select your project
- Choose GET /infra/decisioning/ranking/collections/{collection_id}/items from the route list
- 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')
- Open Dashboard → API Console and select your project
- Choose GET /infra/decisioning/ranking/collections/{collection_id}/items/{item_id} from the route list
- 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')
- Open Dashboard → API Console and select your project
- Choose DELETE /infra/decisioning/ranking/collections/{collection_id}/items/{item_id} from the route list
- 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 }] })
- Open Dashboard → Decisioning and select your project
- Go to the Ranking workspace
- 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 })
- Open Dashboard → Decisioning and select your project
- Go to the Ranking workspace
- 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')
- Open Dashboard → Decisioning and select your project
- Go to the Ranking workspace
- Select a collection and read the stats strip to verify item, signal, and subject counts without leaving the workspace.