A merchandising baseline over two coffees
There's a cafe near my local beach where I do my best thinking. Two weeks ago I sat down there with a double espresso, a batch brew chaser on order, and a problem that would normally soak up a fortnight of workshops: what order should products appear in, on every category page, across two storefront brands, for customers from six different industries?
By the bottom of the second coffee, the problem was solved, tested against real merchandised pages, and the shipping mechanism designed. This piece is about how, because the interesting part isn't the formula. It's what working with AI does to the speed and, more surprisingly, the sharpness of this kind of thinking.
The problem hiding in plain sight
When people think about merchandising they picture search results. But most category traffic never types a query. Someone lands on Aprons or Chef Wear and scrolls, and on those browse pages the "sort order" isn't a tiebreaker, it is the page. Whatever sits in the first two rows gets the clicks. Whatever sits on page three may as well not exist.
Historically that order gets set one of two ways. Either a merchandiser hand-curates the important categories and the rest fall back to something arbitrary like newest-first, or nobody curates anything and the whole store runs on arbitrary. Hand-curation produces beautiful pages and doesn't scale: nobody is manually ordering two hundred categories across two brands, and the pages nobody curated are exactly where the long tail of revenue hides.
The answer is obvious in principle and fiddly in practice: compute a baseline order from business data, so every page is sensibly ranked before a human ever touches it, and let the humans spend their limited attention on the pages where taste genuinely matters.
Coffee one: the formula, and the argument with myself
The signals were never the hard part. The business already knows which products sell, how fast they're moving, what's actually in stock, what each sale earns, what's new, and what customers interact with. The goal was a baseline that considers all of it, squeezed into a single score between 0 and 1 that's as close to optimal as business data alone can get you. Sort descending, done. My first version took about ten minutes, most of which was the espresso.
The hard part is that a formula can be mathematically reasonable and retail-stupid at the same time. My first pass had exactly that problem, and here's where the way of working got interesting.
Cargo Crew's team had already hand-merchandised their most important categories, which meant we had something precious: a ground truth for what good looks like, built by people with taste. So instead of arguing about weights in the abstract, we set up a loop. Compute the score for every product. Push it to a test index. Then have Claude drive the browser, walking the live category pages ranked by formula next to the pages ranked by humans, and reporting where they disagreed and how badly.
The disagreements were where the learning lived. The formula's first draft adored a handful of high-velocity products that were nearly out of stock, which is a great way to merchandise your way into a backorder problem. It under-ranked new arrivals that a human instinctively floats, because newness hadn't earned sales data yet. It had opinions about a couple of hero products that the merchandiser would have called sacrilege.
Each disagreement forced a question I had to answer in plain English before I could encode it: why does the human page feel right here? Sometimes the answer was "it doesn't, actually, the formula found something we'd missed", and the manual page was quietly wrong. More often it was a rule I'd never have thought to articulate cold, like "availability should gate the score, not just weight it". Reweight, re-run, walk the pages again. Each lap took minutes.
That's the part I want to underline, because it's the actual point of this article. The AI didn't invent the formula. It compressed the loop between having a thought and seeing its consequences on a real page from days to minutes, and it forced my thinking to get sharper, because every fuzzy instinct had to become an explicit, testable rule. A problem that would have taken days of back-and-forth with screenshots and spreadsheets resolved itself in a sitting. It's amazing what a double espresso with a batch brew chaser can achieve.
By the end of coffee one we had a formula that the merchandiser and the maths stopped disagreeing about on anything that mattered, and a pipeline that goes from raw business data to a fully ranked catalogue in about five minutes. That's not a one-off build artefact, that's the operating cadence: the baseline re-ranks itself every time it runs, forever.
And because the formula is just weights over named signals, it moves as the business's priorities move. Want margin to pull harder next quarter? Inventory position to gate more aggressively into peak season? A clearance push that leans on aged stock? Each of those is a dial and a five-minute re-run, not a project. The baseline is designed to be argued with.
Where the baseline sits
One clarification worth making, because merchandisers get nervous at "algorithmic ranking": the baseline doesn't replace anybody, and it doesn't compete with the search platform's own intelligence either. It's deliberately designed to sit one level below all of it.
Text relevance still owns search: on a typed query, the score only breaks ties between equally relevant matches, it can never float an irrelevant product above a good one. Editorial rules still sit above the baseline: pin the denim aprons, push the winter range, run the brand promotion, all authored once and scoped by context. And above all of that, the search stack's own AI goes to work: re-ranking algorithms and per-user personalisation, learning from clicks and conversions.
Here's the thing about those tools: they optimise whatever order you hand them. Hand them arbitrary and they spend their learning budget polishing arbitrary. Hand them a baseline already optimised against every business signal you hold, and they compound it. That's the whole philosophy in one line: start with something great, then let the tools in the stack make it even better. What changed is the floor. The worst page on the store is now "sensibly ranked by business reality" instead of "whatever order things were created in", and everything smarter in the stack builds up from there.
Coffee two: one baseline isn't enough
Then the second question, and the better one. A cafe owner and a hotel general manager walk into the same category page. Should they see the same order?
Obviously not. The cafe owner should meet bib aprons and barista-friendly shirts in row one; the hotel GM should meet the tailored fronts of a housekeeping and concierge program. Same products, same page, different lead. So the single score became a family of scores: a default, plus one per industry, where each industry score is the default re-weighted by how that product actually performs for that segment. Six industries between the two brands: hospitality, hotels, healthcare, corporate, education, services.
And here we hit one of those platform constraints that quietly shapes the whole design, and is exactly the kind of thing you want to discover over coffee rather than in sprint three. In Algolia, the ranking formula is an index-level setting. You cannot ask the same index to sort by the hospitality score for one visitor and the default for the next.
The escape hatch is a feature called virtual replicas: lightweight views over the same index that override only the sort. One replica per industry, each pointing at its own key of the score object. No duplicated records, so no extra cost, and, critically, they inherit the primary index's merchandising rules, so the editorial layer survives untouched across every industry view. One more trap worth knowing: Algolia ranks any record that's missing the sort attribute dead last, and it can't fall back to another field at query time. So a generically strong product with no hospitality-specific signal would sink to the bottom of the hospitality view. The fix is to materialise the fallback when the score is computed: where an industry has nothing to say about a product, its industry score simply is the default score. Boring, robust, and the kind of edge you only find by walking the pages.
Shipping it as a query string
Now the fun part: how does a visitor end up in the right industry view? The obvious answers are heavy. Build an industry picker. Ask people to register. Infer it from behaviour with a full personalisation rollout. All fine, all slow.
We shipped something much simpler first: a query string.
Append ?industry=hospitality to any URL on the site and the edge middleware validates it against the six known industries, drops a long-lived cookie, and forwards the setting on the request. From that moment, every product listing and search on the site quietly routes to the hospitality replica, and it stays that way across the whole session and every return visit, because the cookie persists and the client keeps it healed if it's ever cleared. Nothing about the page announces itself; the store just leads with the right products. And ?industry=default is the reset switch: it clears the setting everywhere and the session falls back to the standard order.
A query string sounds like a small thing. It isn't. It turns personalisation into something you can hand to someone. The email campaign to hospitality customers links to ?industry=hospitality, and every page of that visit is merchandised for them. The QR code on the trade-show banner does the same. A sales rep walking into a hotel group sends a link, and the storefront that opens is already speaking hotel. No login, no build, no big personalisation program. One link.
It also sets up the future for free. The session classification that a behavioural personalisation rollout will eventually do automatically ("this visitor keeps clicking cafe products") has exactly the same job: pick one of six industries and set the setting. The query string and the future classifier are two hands on the same switch.
The real lesson isn't about merchandising
Step back from aprons and index replicas and the shape of the fortnight-into-a-morning trick is visible, and it's repeatable.
There was a formula to design, and instead of designing it in the abstract we put it against ground truth in a live browser and let the disagreements teach us. There was a platform constraint that would normally surface mid-build, and it surfaced in minutes because testing the idea was as cheap as having it. There was a shipping mechanism that could have become a project, and it became a query string because by the time we got there, the thinking was sharp enough to see the small version.
None of that was AI doing the thinking. All of it was AI collapsing the distance between a thought and its consequences, until iteration became cheaper than speculation. That's the change worth internalising: problems you'd schedule a week of workshops for are increasingly problems you can walk into a beach cafe with, and walk out of two coffees later with the thing designed, tested and shippable.
The batch brew helps too.
AFKN builds B2B commerce platforms on commercetools and Algolia, and works this way on every engagement. If you've got a problem that's been scheduled for a workshop three times and never solved, bring it over: hello@afkn.com.au
