Ranking shows up everywhere: feeds, search results, triage queues, dashboards, recommendations, alert lists, and model routing. Any time a system chooses what someone sees first, ranking has entered the room.
The hard part is not sorting. The hard part is deciding what the score means and what the product will learn from it.
candidates come before scores
A ranking system starts before the ranking function.
Candidate generation decides what can possibly win. If the right item never enters the candidate set, no scoring function can save it.
Candidate sources might include:
- keyword search
- embedding retrieval
- graph neighbors
- subscriptions
- recently updated records
- popularity
- user history
- business rules
- alerts over a threshold
- model routes that are eligible for a task
This matters outside classic recommendations. In RAG, the candidate set is the retrieved chunks. In alerting, it is the events that pass the first filter. In model routing, it is the allowed routes. In an engineering dashboard, it is the list of incidents, PRs, builds, or flaky tests worth showing.
The first ranking bug is often a recall bug. The best result was not ranked low. It was missing.
scoring should name its values
After candidate generation comes scoring.
A simple scoring function might look like this:
score = 0.45 * relevance + 0.20 * freshness + 0.15 * trust + 0.10 * diversity + 0.10 * context
The weights are less important than the discipline of naming the signals.
Relevance to what? Fresh for how long? Trust according to whom? Diversity across which dimension? Context from the current user, team, task, location, query, or device?
These are product decisions hiding inside math.
For a documentation search surface, trust might mean official docs beat forum posts. For incident triage, severity may beat recency. For model routing, policy eligibility may beat quality. For a feed, diversity may prevent one source from flooding the first page.
The score is a compressed argument about what the product values.
ranking teaches the system
Position bias makes top results look better because they were shown first. Freshness can bury durable work. Popularity can create feedback loops. Personalization can narrow the world too far. Diversity constraints can help, but only if the system knows what kind of repetition is bad.
The scary thing is that the system may learn from its own display choices.
If top results get more clicks because they are on top, clicks become a noisy label. If popular items get shown more, they become more popular. If a ranking system hides long-tail documents, the system gets less evidence about whether those documents were useful. If an alert queue always shows one category first, operators may train the system by responding to what it already prioritized.
Ranking systems create feedback loops. That is true for social feeds and also true for internal tools.
The product should know which feedback signals are biased by position, exposure, and UI design.
metrics are useful and incomplete
Offline ranking metrics are worth using.
Recall@K tells you whether relevant items appear in the top results. Precision@K tells you whether the top results are mostly useful. nDCG cares about order and graded relevance. MAP can help with ranked retrieval across many queries.
Those metrics are necessary for repeatable work. They are not the whole product.
Online behavior matters too:
- clicks
- dwell time
- hides
- saves
- conversions
- reformulated queries
- manual overrides
- complaints
- downstream task success
The problem is that online behavior is full of confounders. A click may mean interest, confusion, habit, or a bad title. Dwell time may mean engagement or difficulty. A user may not click the right answer because the snippet already answered the question.
Metrics need interpretation. Ranking is where data science and product judgment constantly annoy each other.
explanations help debugging
I want ranking systems to leave evidence.
For any surprising result, an operator should be able to ask:
- which candidates were considered?
- which candidates were filtered out?
- which signals dominated?
- which rule overrode the score?
- which model version scored it?
- which user or query context mattered?
- what feedback has this item received before?
That does not mean showing all of this to the end user. It means the team can debug the ranking.
I would keep examples where the ranking was surprising. Which signal dominated? Which candidate was missing? Did a business rule override relevance? Did the model learn a proxy for something we do not actually want?
Those examples are more useful than aggregate dashboards alone. They show the system’s taste in concrete form.
ranking in ai systems
AI systems are full of ranking decisions.
Retrieval ranks chunks before generation. A router ranks model paths. An agent ranks tools or next steps. An eval dashboard ranks failures. A threat analytics system ranks alerts. A code review assistant ranks files to inspect. A memory system ranks prior context.
That means ranking quality affects far more than recommendation feeds.
For AI work, I care about whether the ranking system preserves the evidence needed for the next step. The top retrieved chunk should support the answer. The top alert should be actionable. The top model route should satisfy policy and quality. The top tool should be allowed and useful.
Ranking mistakes become downstream reasoning mistakes.
taste encoded as infrastructure
Ranking is taste encoded as infrastructure.
That makes it powerful and annoying. Powerful because small ranking changes can make a product feel much smarter. Annoying because the system will optimize whatever signals you give it, including bad proxies.
A good ranking system should be measurable, debuggable, and humble about the difference between a score and a user’s actual intent.
The score is not the truth. It is a guess about what should be seen first.
Related posts

About Jeremy London
Engineering leader and builder in Denver. I write about AI platforms, agents, security, reliability, homelab infrastructure, and the parts of engineering work that have to survive production.