Inspiration
In recent years, there are a lot of places where you can get a good cup of coffee wherever you go. In Japan, in addition to traditional coffee shops and chains such as Starbucks, even places that do not specialise in coffee, such as McDonald's and convenience store chains such as Seven Eleven, are offering coffee with a particular taste.
In this context, consumers have become more discerning and are demanding "better coffee". Demand for speciality coffee has been increasing these days. Due to the COVID in the past few years, the number of people who want to enjoy coffee at home has increased and sales of coffee machines are now rising steadily. This is why we turned our attention to a service that allows you to 'make your own blended coffee'.
We felt that such a service, which allows people to make their own special coffee by combining multiple coffee beans, is what is required in the incoming 4th wave era. We therefore considered several advantages of Square for coffee shops offering such a service. The advantages are briefly summarised as follows.
・Change the blend with a few touches on the UI.
・Visualise abstract coffee characteristics by using Generative AI.
・Store customer data in Square, allowing the users to understand their own past blended coffee and preferences.
・Enable shopkeepers to make new suggestions for customers.
・Be used for sales forecasting, so that coffee beans, which require delicate handling, are not wasted.
The last point in particular can contribute to the sustainability of coffee beans. Coffee is expected to face problems such as the '2050 problem', so it is necessary to be aware of the sustainable coffee life cycle now.
What it does
Bean Craft Laboratory is a store application that allows customers to create and purchase their own personalised blended coffee. Using Square API, orders can be freely customised. We have focused on this point and devised Bean Craft Laboratory as a service that offers customers their own personalised blended coffee. The three main functions are as follows.
Browse product catalogue and customise blends: the application allows users to select beans from the catalogue to create their own blends. The user can then customise the blend of coffee beans, adjusting beans' proportions, which can be visually viewed on a bar graph.
AI-based blend evaluation: if setting blend ratios is difficult, users can enlist the help of an AI. This AI uses image-generating AI and text-generating AI to describe the flavour of the coffee blend based on the ratios you set. This provides a visual and textual assessment of the blend's characteristics and helps the user find the ideal blend.
Purchase of original blends and local payment: users can purchase the blends they have created directly from the app. The payment is made locally using a payment device linked to TerminalAPI, which is installed in the shop. After the purchase, the transaction and order can be confirmed. The service is provided using an iPad displaying the app and a Terminal in the coffee bean shop.
How we built it
As for Product Catalog's registration, fetch, and payment, we use Square's Catalog API and Terminal API functions. For describing the taste of blended coffee, we use GPT's Chat Completions API and Stable Diffusion's text-to-image API .
To input text-based prompts to generative AIs, we focused on SCAA Flavor Wheel, which is a framework commonly used in the coffee industry to represent the taste and aroma of coffee. This framework uses nine categories of words to describe the taste and aroma of coffee. e.g.) Sweet like Honey and Vanilla, Fruity like Raspberry.
Users register their taste descriptions in the Custom Property of the product catalog according to the SCAA Flavor Wheel classifications, and the application uses the API to retrieve each word and generate prompts for generative AIs.
In image generation with Stable Diffusion, we use the concept of prompt weighting. By changing the weight of the coffee flavor prompts according to the proportions of the blend, the interaction of the flavors of each bean in the coffee blend is also reflected in the generated image.
The image below is an example representing a typical prompt weight.

Challenges we ran into
We struggled with prompts for generative AI. Even though they were shared as best practice on the web, they often did not work. We reached the current quality through trial and error, struggling to omit old and incorrect information. It was also difficult to get used to controlling the system using natural statements, because we felt they were different from normal programming languages.
Accomplishments that we're proud of
For a range of coffee varieties as if in a real shop, we are proud of the quality of the application, which is exactly as we envisioned it, and which can stand up to use in a real shop.
What we learned
We learnt that Square has a wealth of functionality for shops. In addition, Square API enables us to implement a wide range of functionality. Indeed, by virtue of the functionality, our custom development was minimal.
What's next for Bean Craft Laboratory
We were only able to verify our system in Square's sandbox environment this time, so we would like to introduce an actual POS cash register and Terminal ourselves to verify it. On the other hand, we could understand the usefulness of Square API, so we are now interested in managing a shop in the future.
Built With
- express.js
- gpt
- node.js
- stable-diffusion
- vue
Log in or sign up for Devpost to join the conversation.