Artificial intelligence will sell our tortes

The costs of running a patisserie are high. In addition to the need to employ specialists, issues arise such as the cost of purchasing and storing sophisticated raw materials, the proper handling of finished products, and—more than in baking—the necessity of using refrigeration equipment. The enormous turnover of goods forces the need for high sales efficiency. If sales fail, the losses will be significantly higher than in the case of a bakery.

Przegląd Piekarski i Cukierniczy — April 2025

The fashion for small family patisseries emerged in the late 1970s and continued uninterrupted until the early 2000s. What happened that patisseries today are no longer as popular and prosperous as they once were?

The confectionery business began to crumble for various reasons. First and foremost, in the late 1990s, shops were flooded with a wide variety of confectionery products—bars, gummies, and various kinds of long-shelf-life cookies. Intensively advertised in the media, these mass-market goods began to replace artisan confectionery products.

At the same time, a trend toward a slim figure and a sporty lifestyle emerged, which further worsened the situation of the confectionery craft. What still saves patisseries are consumer customs and habits. The operation of artisan patisseries is deeply rooted in our culture. We go to patisseries or cafés to meet friends. For various occasions and holidays we buy cakes, fruitcakes, poppy-seed cakes. An indispensable element of every family celebration—such as a christening, wedding, or birthday—is a torte.

Can an excellent location of a café-patisserie, combined with customer habits, save the industry?

It could go either way. As we know, some habits disappear, and others emerge that do not necessarily have a positive impact on the development of artisan patisseries.

To sell, you need to know how to sell

Everything we produce has to be sold. Of course, we know perfectly well that sometimes not even half can be sold. Whom can we blame for that? We can certainly say that we poorly predicted future sales; we produced too much.

Some things you can’t win against. For example, customers’ tendency to go away for weekend trips, which means that at times theoretically the busiest we have fewer customers. There is also the departure from over-the-counter retail in favor of online shopping.

Artificial intelligence will sell our tortes

Let’s imagine that we are bakers who have also been operating in the confectionery industry for at least two decades. Confectionery is a bit more sophisticated; it requires a sense of taste and decoration. A patisserie in an excellent location can even surpass the revenues of the baking operation.

What can be done if, instead of coming to the patisserie to buy a torte, the customer chooses the Internet? You can take your products online. Yes—but that requires technological preparation.

I have written about this many times: online there is technological competition. Whoever has the better e-commerce technology wins. Selling cakes, tortes, and other highly perishable goods—amid intense competition and practically no barriers to market entry—must be brought to perfection.

Selling by means of artificial intelligence

What can guarantee us online sales is technological excellence. Until now, that excellence was achieved through the right placement on a website. If a customer typed that they wanted to buy a torte, the search engine would find store addresses. The sites that appeared on the first and second pages of search results would find customers. Subsequent pages were rarely visited. A store’s placement on the search results page was to online sales what a patisserie’s location is to over-the-counter retail in a town.

That, too, started to change. Group sales services have appeared, such as Allegro or OLX. People began posting on local Facebook groups and on the websites of local online newspapers. After all, we won’t look for a torte in another province—we’ll look in the immediate vicinity.

The boring technology everyone uses

Imagine an artisan pastry chef who decided to mass-sell tortes throughout the county. They created a free Facebook account and joined all the local groups related to celebrations, cuisine, regional customs, as well as groups that gather the most users from the county.

Next, using the free Canva website,¹ they made a nice advertisement, which they then posted for free on all their Facebook groups. Under the ad there was a link to their website—to be more precise, to their online patisserie.

An online patisserie can be set up for free using the free WordPress tool. To say “set up” may be saying too much—there are already ready-made patisserie templates there; you just need to download them.² You can also design your own.

Now you need to buy a domain, e.g., tortyzcycowa.pl or tortyjanusza.gov.pl. You need to buy hosting, upload the site, and you already have an online store with tortes. The cost of the domain and hosting is about PLN 200 per year.

Such a store will really work; customers will visit the site, and it doesn’t require any special effort. You can improve it, but generally this solution is commonplace. The place where you can compete is on the page of our online store.

An online store with a chat?

Artisan confectionery is an industry in which you must constantly surprise customers. Surprising them—i.e., delivering increasingly sophisticated and complex forms of tortes—means we have an ever-larger assortment. The increase in the size of the assortment causes storage costs for refined raw materials to rise, as well as the costs of maintaining specialists capable of making such exquisite tortes. The growth in the number of products leads to higher fixed costs, which creates additional pressure to improve sales efficiency. Additionally, when making purchases, customers may feel a bit lost in the abundance of assortment.

It must be said that customers have recently become more “complicated,” if we can put it that way. The enormous number of videos and posts about health, the harmfulness of certain ingredients, all sorts of problems—often contrived—have led people to become hypersensitive, oddly suspicious, or excessively cautious. How can you sell something online to such people—something as one-off and rarely purchased as a torte?

You can add an active dialog window—a so-called chat—on the website. Each customer will then be able to ask any, even the strangest, question: “Are the candles made from ecological wax?”, “Were the colorants used in decorating the torte produced from insects?”, “Is the torte sturdy enough to transport by car for 12 km?” The number of variants of questions that can be generated by such “complicated” customers is unlimited. It is difficult for an ordinary person to answer most of the questions. Besides, hiring someone to answer them on an ongoing basis is an expensive and difficult undertaking. No normal person is able to endure such a job for a long time. Artificial intelligence comes to the rescue.

A chat based on artificial intelligence

If we don’t want to pay for hosting, we can have the website on our own computer. It is important not to turn off that computer and the website, because customers may want to buy something at any time of the day or night. On such a website we can download one of the “pocket” versions of artificial intelligence; it could be DeepSeek, Mistral, or, for example, ChatGPT-3.5. However, I do not recommend this method, because the chat may not necessarily work well; its smooth operation will depend on the performance of the local computer.

It is best to set up a free Azure account and then go to the Azure OpenAI module.

Next, you need to choose which language model is to represent us in the store.

In this way, we have set up a language model that will sell tortes in the store. To connect to it from the website, we need to obtain the address and a password.

Setting up a chat on the site requires the skills of an average IT specialist and may take, in total, a few hours.

What is important for the person who will create the artificial-intelligence chat in the store is that the website cannot connect directly to the cloud. It needs an intermediary system for this. The most common tool used is the Flask program, which is free and very simple to configure.

In this process, Flask acts as a translator between the user on the frontend and ChatGPT. Flask is a server application that “listens” for questions from the user sent by the browser (the frontend). When the user enters a question and clicks “send,” Flask receives the question as a message. Imagine that the user puts a letter (the question) into a mailbox. Flask is the mail carrier who collects the letters and knows where to take them. It intermediates in sending the question to the ChatGPT model in Azure. It uses appropriate tools (e.g., an API key) to obtain a response from artificial intelligence. So, in Flask we need to build an API endpoint that will connect to Azure. It looks roughly like this:

The mail carrier delivers the letter (question) to the appropriate institution (ChatGPT) that can provide an answer. When the AI model in Azure generates a response, Flask receives that response and sends it back to the user on their computer. Without Flask or a similar server-side tool, the frontend (our torte store) would have no way to communicate with the AI model in Azure. The user would then have to communicate with the ChatGPT API in the cloud on their own, which is complicated and impractical.

The last time I did this, the configuration of the connection ports caused me the most difficulty. Therefore, below I include instructions on how to do it.

Here is the HTML code of the online store page:

And this is the connection with Flask:

In very simple terms, a chat on the site is built relatively quickly; the cost of using it is very low (about a few dollars per month), charged to a bank card via the AZURE payment system. The solution works as follows.

1. Frontend (online store):
• The user opens the store portal on their computer.
• The user interface (e.g., in HTML/JavaScript) allows entering questions and receiving answers.

2. Backend (Azure Cloud):
• The portal backend in Azure handles requests.
• Azure hosts the AI model (e.g., the OpenAI API) and processes user queries.

3. Communication:
• The user’s query is sent from the frontend portal to the backend in Azure via Flask.
• The ChatGPT model in the cloud generates a response, which is then returned to Flask, and Flask sends it to the user.

Even a synthetic salesperson requires training

If we launch the chat window on our store’s website, that chat will talk like a typical GPT chat on our phone. It will answer in general terms—in short, it will be artificial intelligence devoid of any orientation or training.

For our electronic salesperson to know what he is talking about, we need to upload several hundred recipes for our tortes. We must upload the dimensions of the tortes, the terms of sale and delivery—in short, everything needed for competent answers. Of course, it will not reveal recipes and other secrets, because we will instruct it not to. Based on the ingredients contained in the recipes, artificial intelligence will be able to formulate answers.

Providing the robot with sales information is done in the form of prompts—that is, everything is uploaded into the machine’s memory in a human-readable form. The answers will be as competent as the artificial-intelligence algorithm we have chosen is advanced. More advanced models can improvise or draw on external sources; less sophisticated machines may answer vaguely and at length, and they may even fudge or equivocate. The choice of machine therefore has a major impact on service quality.

For example, a woman buying a torte may ask: “What is the concentration of diglycerides of fatty acids in this torte, and what direct consequences could that concentration have for the body of a 12-year-old child? I mean the substance contained in the cream used to decorate this torte. What is the content of diglycerides of fatty acids in the recipe of this chosen torte?”

Response generated by the latest ChatGPT-4.5 model:
“The concentration of diglycerides of fatty acids in our tortes usually does not exceed 0.5

The same response generated by the inexpensive ChatGPT-3.5 model looks a bit different:
“Good morning! Diglycerides of fatty acids are a type of emulsifier that can be used in cream for decorating tortes to improve their consistency and stability. The concentration of these substances in our tortes complies with food-industry standards and is safe for children of any age, including a 12-year-old. Generally, the concentration of diglycerides in the product is very low and should not have a negative impact on a child’s health, provided the torte is consumed in moderate amounts as part of a balanced diet. If you have specific concerns related to allergies or other health conditions, I recommend consulting a doctor. I can also show the composition of our tortes if that helps.”

A non-laconic conclusion

The pace of change in the area of artificial intelligence is so great that at the moment of printing this article it will likely already be outdated. Generally, in the coming months we can expect chats with faces to appear that will closely resemble human faces. This technology has been available for many months, and I could present instructions on how to introduce it on a store’s website. Unfortunately, the avatar subscription is very expensive. Additionally, you can introduce a chat that recognizes customers’ faces. This technology can be introduced relatively cheaply using the Azure Face API within Azure Cognitive Services. For that volume of recognized faces, the service is free. In an extended version, it can recognize customers’ moods and create a correlation between mood deterioration and a particular piece of information contained in the dialog. In addition, you can introduce instructions that will influence customers’ decisions. The robot will continuously build a recommendation system; it will recommend specific additional products or services, analyzing the customer’s facial expression on the fly or analyzing the questions they ask—it will leverage their concerns and signs of euphoria. This is not the future; this is the present. I created similar recommendation systems a few years ago for the e-commerce industry.

Besides, all of this may soon turn out to be outdated anyway, because the company OpenAI, the provider of ChatGPT, released “Operator” last month. It is a robot that will make online purchases, payments, and transfers for us—handling every matter with efficiency surpassing a human being. What if such a robot comes to an online store where there is another robot equipped with a recommendation system? And that first robot, “Operator,” is equipped with defensive systems. We arrive at a small absurdity—except that what I have just described is already happening. “Operator” is already being used in the United States. Soon it will come to Europe. The only barrier to its widespread use is the price: about 100 dollars per month. Several competing “Operators” will probably appear, and then the price will drop and “Operators” will become commonplace. Will “Operator,” with an avatar of our face, then converse with the electronic salesperson about the concentration of diglycerides of fatty acids in the cream? All this gives one pause. The question arises: where will the human be in all this in a few months’ time? I warned that this conclusion would not be laconic.

W-MOSZCZYNSKI ppic 4-25

Wojciech Moszczyński

Wojciech Moszczyński — graduate of the Department of Econometrics and Statistics at Nicolaus Copernicus University in Toruń; specialist in econometrics, finance, data science, and management accounting. He specializes in the optimization of production and logistics processes. He conducts research in the development and application of artificial intelligence. For years he has been involved in the popularization of machine learning and data science in business environments.