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.
Create Ranking Collection
Create a caller-owned collection for ranking and recommendation primitives.
curl -X POST https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"name":"example"}'
{ "status": "ok" }
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.
name requireddescriptionstrategy_defaultbehavioral, semantic, hybridembedding_modelmetadata_schemaList Ranking Collections
List ranking collections for the active project.
curl https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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 one ranking collection definition.
curl https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id} \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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
collection_id requiredUpdate Ranking Collection
Update mutable ranking collection fields.
curl -X PATCH https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id} \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{}'
{ "status": "ok" }
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
collection_id requirednamedescriptionstrategy_defaultbehavioral, semantic, hybridembedding_modelmetadata_schemaDelete Ranking Collection
Delete a ranking collection and its stored items and signals.
curl -X DELETE https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id} \
-H "Authorization: Bearer sk_live_..."
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
collection_id requiredUpsert Ranking Items
Upsert caller-owned items into a ranking collection, with optional auto-embedding from item text.
curl -X POST https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id}/items/upsert \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"items":[]}'
{ "status": "ok" }
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.
collection_id requiredauto_embedtrueitems requiredList Ranking Items
List caller-owned items stored in a ranking collection.
curl https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id}/items \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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
collection_id requiredGet Ranking Item
Get one caller-owned item stored in a ranking collection.
curl https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id}/items/{item_id} \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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
collection_id requireditem_id requiredDelete Ranking Item
Delete one item from a ranking collection.
curl -X DELETE https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id}/items/{item_id} \
-H "Authorization: Bearer sk_live_..."
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
collection_id requireditem_id requiredIngest Ranking Signals
Record caller-owned subject-item signals for ranking and related-item queries.
curl -X POST https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id}/signals/batch \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"signals":[]}'
{ "status": "ok" }
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.
collection_id requiredsignals requiredRank Items
Rank caller-owned candidate items for one subject using behavioral, semantic, or hybrid strategy.
curl -X POST https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id}/rank \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"subject_id":"..."}'
{ "status": "ok" }
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.
collection_id requiredsubject_id requiredstrategybehavioral, semantic, hybridlimit10candidate_idsexclude_item_idsGet Ranking Stats
Get counts for items, signals, and unique subjects in a ranking collection.
curl https://api.saasignal.saastemly.com/infra/decisioning/ranking/collections/{collection_id}/stats \
-H "Authorization: Bearer sk_live_..."
{ "status": "ok" }
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.
collection_id required