How DeskBeers picks your beer

Adam Rogers
Delivering DeskBeers
4 min readFeb 5, 2016

--

At DeskBeers we love all our children equally. Every beer we send to customers is one we’d be delighted to receive ourselves. Each box of DeskBeers contains 12 beers, made up of two or three styles of beer usually from the same brewery.

It used to be that we’d send the same beer to everyone getting beer that week. While this was elegant (naive?) in its simplicity, it was not without its problems. The number of beers we needed would always change. New customers would sign up, old customers would leave. No matter how hard we tried, the only thing we knew was that the number of beers we needed was not the number of beers we’d ordered.

Additionally, breweries come in all shapes and sizes. Our usual order ran to something in the region of 70 cases of beer, broadly enough beer to cover the whole round. The more established breweries might be able to meet this order comfortably, but it’s a huge order for a brewery just starting out. And as we grew, we needed more, not less beer! Increasingly we found the breweries we wanted to stock were not able to supply a whole order. We had to start splitting the round.

Enter “The Box Picker”

Splitting the round meant that no longer would everyone get the same box of DeskBeers. Our initial solution to this problem was to pick a box of beer for a customer automatically. The criteria on which we would pick this box would be quite simple:

potential boxes = boxes in stock — customer history

This allowed us to do a couple of things. Firstly, we could have multiple types of boxes of beer in stock at any given moment, meaning we could split our ordering across multiple breweries each week. Secondly, it removed the need for us to manually stay on top of who had already had what. A nice side effect of this plan was that we could start building up a history of beers for each customer, something we weren’t really able to do before.

The algorithm above takes all the types of DeskBeers boxes we have in stock and subtracts any that we’ve already sent to a customer. We can’t send the customer the same box twice, which is great. From the remaining boxes, we pick the first one with enough quantity to fulfil the order. We base the notion of “first” in this case on a simple first-in-first-out system.

This box picker distributes the “best” box of beer to each customer. We don’t have to be too picky about the quantities of beer we order (meaning we can take a small run of seasonal beers, for example). It also manages the stock in such a way that we’re never holding on to beer for longer than a week or so.

So that’s it, right? Problem solved? Not quite.

The Box Picker Strikes Back

What happens in the following situation: We order 20 cases of beer A, 20 cases of beer B and 20 cases of beer C. We plan to make up 120 DeskBeers boxes containing 4 bottles of each kind of delicious beer. But before we do, someone drops and smashes 10 cases of beer C. Disaster. We can only make up 60 boxes of beers A, B and C. We’ll call that Box A. We can also make up 40 boxes of just beers A and B. Let’s imaginatively call that Box B.

Box A has three styles of beer, Box B has just two

Only 20 DeskBeers boxes worse off. Not too bad.

The box picker runs and decides who gets what. It decides to send out all 60 of Box A and only some of Box B, making up the rest of the round with other boxes we also had in stock. We’ve got a few of Box B left, but we’ve sorted out this week’s round and we can go home. Smashing (sorry).

The problem arises the next time we want to send out beer. Our algorithm is smart enough to know not to send anyone that got a Box B that same box again, but it’s not smart enough to know that the people that got Box A probably don’t want Box B, which contains 2 of the three beers they had last time. It’s a different box so meets the rules we set, but computers are stupid.

What to do?

Box Picker 2.0

We are going to have to take a look inside these boxes. Box picker 2.0 needs to find the box with the most beers in it that the customer has not seen before. By comparing the beers in a box to the beers we’ve sent a customer, we can prefer a box with more “new-to-you” beers in it. And that’s not all.

“Best” means a lot of things. Part of the joy of DeskBeers is trying beer from a large number of breweries, right? So we do a similar trick and rank the potential boxes by the number of new-to-you breweries in each box. This way you get the best spread of new breweries we can muster. But what else?!

Well, that’s enough for now, but make no mistake that more smarts are coming to the DeskBeers box picker. Soon to launch is a rule that will try and get you the widest spread of styles of beer — had an IPA and a Pale Ale last week? How about a Saison and Kölsch this week? Lovely.

We think the DeskBeers box picker is pretty special. It’s fun, useful and a little bit clever. It’s a great example of technology quietly improving a user experience. If it does its job, you need never know of the existence of the box picker. It’ll just tick away choosing beer for each of our customers and making the world a little better.

Cheers to that, little box picker. Cheers to that.

--

--