Feeds — Explain
"Why did this item rank here?" The explain endpoint returns the per-scorer
math for a single record — raw value, weight, weighted contribution, final
composite score, and page rank.
Because it leaks the exact ranking arithmetic, it's sk-only. Public keys
get a 403. Put it behind your backend and expose a redacted form to end
users if you want.
The response shape
finalScore = Σ weightedValue + Σ boosts. diversify appears with
weightedValue: 0 — it reorders, it doesn't score.
Call it
CLI
Fast iteration loop:
Output:
Use --json for a machine-readable form. --api-key must start with sk_ —
public keys are rejected before the request hits the wire.
In-app "why?" overlay
The explain endpoint is sk-only, so the public-facing "why is this at the top?" widget needs a small proxy on your backend. Shape:
What explain doesn't tell you
- It doesn't explain candidate selection. If a row never made it into the
candidates.limitpool, explain doesn't know why. That's a different question ("show me everything that matched the pre-filter"), served by the upcomingcandidatesdebug endpoint. - It doesn't explain dedup. A record excluded by
within: 'session'orexcludeIdsreturnsrank: null. The page didn't drop it for scoring reasons. - Returned values are pre-clamp. Individual scorers clamp
valueto[0, 1], butrawValueshows the computed number before clamping — useful for tuning similarity thresholds.
Explain is the feedback loop for your weights. When a feed underperforms, run it on a few example records and watch where the contributions land.