The scoring formula and logic behind how we find and rank alternative products for every listing.
Every product on Liners has an alternatives section showing similar products you might want to consider. We compute these automatically using a scoring formula based on Jaccard similarity β measuring what proportion of tags two products share, not just how many they have in common. I've got
QA Quinn overseeing the quality of the results, and
DD Dave runs the actual computation.
When we compute alternatives for a product, we look at every other published product that passes the hard gates (see below) and calculate a relevance score. The higher the score, the more relevant the alternative.
Instead of awarding fixed points per matching tag, we use Jaccard similarity for each tag group:
Jaccard = shared tags / union of tags
This measures the proportion of combined features two products share. A product with 20 tags that shares 3 with another product scores much lower than a product with 5 tags that shares 3 β because proportional overlap is a stronger signal of true similarity.
Each tag group has a different scaling factor:
| Tag Group | Formula | Max Score |
|---|---|---|
| Product Features | Jaccard Γ 15 | 15 (perfect overlap) |
| Technology | Jaccard Γ 6 | 6 (perfect overlap) |
| All other groups | Jaccard Γ 3 | 3 (perfect overlap) |
Product Features carry the most weight because shared features are the strongest signal that two products are genuine alternatives. Technology overlap is a useful secondary signal, and other groups (business model, audience, etc.) contribute a smaller amount.
Country overlap is a binary signal β either the products operate in the same market or they don't:
| Condition | Points |
|---|---|
| Either product has no countries assigned | 0 (neutral). |
| Either product is Pan-African | +3 (wildcard match). |
| Products share any specific country | +3 (same market). |
| No country overlap at all | -5 (different market). |
Pan-African products are treated as operating in every country, so they always get the same-market bonus. Products with no countries assigned yet are treated neutrally β no bonus or penalty.
Note: Verified status does not affect the alternatives score. Alternatives are based purely on product similarity β what the products do, where they operate, and who they serve.
A product must pass two gates before it can be considered as an alternative:
Any candidate with a score below 7 is dropped. This keeps our alternatives list genuinely relevant β no noise, no random matches.
We compute alternatives at several points:
Cascade recomputations are processed via QStash (Upstash's serverless message queue) when configured. Each affected product is published as an individual job, processed with a concurrency limit of 5 to avoid overloading the database. When QStash is not configured (e.g. local development), recomputations fall back to sequential in-process execution.
All alternatives are pre-computed and stored in the ToolAlternative table with a relevance score. Every surface β product cards, the product detail page, and the full alternatives page β reads from this same pre-computed data. This ensures consistent, scored results everywhere.
Say Paystack is a B2B payments platform with Product Features tags: api, payment-gateway, payment-processing, payment-links, online-store, ussd. It's in the "Fintech" category, operating in Nigeria, Ghana, Kenya, and South Africa.
Teamapt shares the "Fintech" category (passes gate 1). Its Product Features are: api, bulk-payments, direct-debit, payment-gateway, payment-processing, pos. Shared PF tags: api, payment-gateway, payment-processing (passes gate 2). Union: 9 total unique PF tags. Jaccard = 3/9 = 0.33, scaled: 0.33 Γ 15 = 5.0. Both are B2B (+3 from Other group Jaccard). Same country (+3 bonus). Total score: 11.0 β well above the threshold.
Cowrywise shares the "Fintech" category (passes gate 1). Its Product Features are: investments, savings, wealth-management. Zero shared PF tags with Paystack β fails gate 2. Not considered as an alternative, which makes sense: a savings platform and a payment gateway serve fundamentally different needs.