This seems like a solved problem for those who care to solve it. Weigh product on intake, weigh on outflow or some other constant displacement pump solution. I've seen How It's Made and those factories have it down to a science without a guessbot at the wheel.
I am also missing the cost savings. I assume coffee shops have extensive dead-time in between peak hours. If some person does not have to manually perform inventory during the day - what other value was on the table to be generated?