The brain of the company. Part 2

Continuation of the story about the ups and downs of introducing AI in a trading company, about whether it is possible to completely do without managers. And what (hypothetically) it can lead to. The full version can be downloaded at Litres (free)

***

The world has already changed, the transformation has already started. We ourselves, of our own free will, become devices for reading instructions from a computer and a smartphone. We think we know how to do it right, but increasingly we turn to searching the Internet for the answer. And we do as someone wrote on the other side of the screen, blindly trusting him if he guessed right. A person does not think critically if his desire is satisfied. Critical thinking slips to zero. We are ready to plunge headlong into something that inspires us with confidence and reveals even our hidden desires. But there, on the other side of the screen, is no longer a person, but a program. That's where the focus is. The corporate program guesses the desires of consumers and gets their loyalty. I guessed that there was one step left before the creation of desires. And the man will be completely driven by the machine. I guessed, but so far did not attach much importance to this. So far there has been a result that we liked.

And I began to understand why large corporations eat small ones. Not only because they can accumulate large funds for their purchase. They have big data about the behavior of their customers that can't be bought anywhere. And so they have the ability to manipulate the opinions of buyers. Simply by identifying features on a large statistics that affect the choice.

Procurement and pricing automation

When a month later we added scoring on the site, recommendation search and banner creation, I made a presentation showing the effectiveness of the board of directors. How many operations we have abolished, how many additional sales by mailing lists and banners have been made. The general was visibly pleased. But he only succinctly said that we should continue in the same spirit. Later, the staff came running to me to sign a new amount in my contract. She was one and a half times taller. And in marketing there was a very lively discussion of who would do what now.

We decided to celebrate with the team and dumped everything together in a bar. Max congratulated us and himself on Skype. He did not like such parties. In the evening, he wrote: “It's time to start shopping. The most cloaca. Be ready".

“Where do we start,” I wrote to Max in the morning.
- From inventory. I have already looked at the statistics and forwarded to you. Traders do not guess stocks at all, they use a primitive approximation function. The mistake is such that they restock the warehouse by 15%, then they have to sell to zero. And the demanded goods are often not enough, zeros are formed by the remainder. I won’t even count how much margin flies so as not to be upset.
- How will we guess purchases?
- There are statistics for a couple of years, although they guessed to keep it. Launch the Raptor, feed it all the features you can muster. And we will check on the current sales data.
– What data should be collected?
– Yes, any that can influence or simply correlate with sales. Weather forecast, exchange rates, price increases by suppliers, supply disruptions, everything you can find in the statistics. Buy chocolate for analysts and steal everything you have from them.
– What are the forecasts?
- If we do everything correctly, then the error in the formation of inventory for the period will not exceed an average of 2-3 pieces.
- Sounds fantastic.
- You said the same thing when you started doing marketing. By the way, customer analysis is just needed here, one of the features will be a generalized basket of customers.
- What does it mean?
- Dependence of the purchase on the joint sale of goods. You can't buy 10 of product A without buying 4 of product B if 40% of the time they are sold together. Is it clear now?
- Cool.
- We'll take a month and a couple of weeks to set up. And you need to please the sales director that now it’s not his fighters who will soon steer the purchases.

It seemed easy after such an enchanting presentation of the results of the implementation of the marketing module. But after the first conversation with the purchasing director, I realized that it would be difficult. Merchants simply will not give purchases to a car. Always and everywhere the manager decided what and how much to buy. This was his unique competence. And we proposed instead to simply complete the tasks of the system for the purchase. Negotiate and conclude contracts. The purchasing director had one argument: “If the system makes a mistake, who will be responsible? Whom should I ask? From your system? So I can at least scold Ivanov or Sidorov. The counterargument that the check gave an error much less than the merchants do was not convincing. “Everything works on toy data, but anything can happen in combat,” the director retorted my argument. I came out upset, but didn't say anything to Max yet. I had to think it over.

- There is a problem in the system - received a message from Max at six in the morning.
- What happened?
– We analyzed sales by purchases made by people. They are crooked, and sales are also crooked. The system is bad at guessing sales.
– And what to do? Where do we get the data, what should we buy? We have nothing but sales, which the merchants look at.
Why do managers decide what customers need? Let the customers decide what they want. We will simply analyze their requests on our website.
This is unexpected, but true! And how do we compare what they were looking for with what they need to buy? Requests are not always clear.
- It's simple, they don't find it with us, but they find it in search engines. And we will look for the result of what is in online stores. There will be errors, but it will smooth out on big data.
- Brilliant.
- Thanks I know. We will set it as a correction function for retraining the procurement model. It takes a long time to wait for merchants to buy, sell, and it gets into the model.

Rumors that we were making a purchasing system began to spread quickly. Some businessmen even stopped saying hello, but some came up and asked what she would be able to do and how we were going to implement it. I felt the clouds were gathering and was ready to go to the general before switching inventory management to our trained model. But Max suggested that we first refine the system.
“We need an automatic system for setting and changing prices. Without systematic and uniform pricing, the procurement model is foolish and confused. Prices must be quickly changed to suit a competitor so as not to lose margin. The merchants screw up here.
- I agree, but it will be difficult ...
– You need to write price parsing on competitor sites. But how to compare with our positions? I don't want to include my hands here.
- We have positions with manufacturers' articles, they are on the websites of competitors.
- Exactly. Then make it easy, take care of the list of competitors for each category. And I'll think about the admin panel, in which we will start the rules for changing prices. How much to change with different demand and margins from the purchase of goods. It will be necessary to set the Raptor.
– Well, the managers themselves still change the prices when they have time to look at the prices of competitors, or when the supplier changes them. I'm not sure I'll be able to persuade you to give it to the system.
- Yes, they do not change anything, I looked, they only increase, and then rarely. Nobody is changing anything. It looks like there is no time for businessmen to look at prices. And it is unrealistic to keep track of a matrix of thousands of products, multiplied by a dozen competitors. Need a system.
– Do such systems exist?
We'll find something suitable. You prepare a report on the transfer of pricing to the automatic machine, I will give you statistics and an approximation of what will happen as a result of automating the prompt price changes for competitors.
- It will be more difficult to do than with marketing, I already spoke with the purchasing director. He is against it, only as a hint.
- The system has 20% of prices that no one has changed for 2-3 years. And they sell, most likely, already in the red. This is not enough?
- I'm afraid not. These are people, you understand. We deprive them of power over purchases, they will look for arguments to topple our forecasting system. Just out of spite they will not buy what she offered.
- Okay, let's make it easier. She will recommend, and in a quarter we will calculate the difference, how much the system recommended and how much the merchant bought. And we will see how much the company lost on this. Just don't talk about the calculations to the directors, let it be a convincing surprise. For now, let's take a look at the next system.
It was a compromise. I agreed with the purchasing director that the system would recommend to merchants, but they would decide for themselves. Together we held a meeting with the general, where we presented the implementation plan. I insisted only that we conduct a performance evaluation every quarter. A month has passed.
- While they are there deciding with purchases, I will make fully automatic purchases - purchase requests will go directly to the suppliers via the API. There is nothing for businessmen to do here.
- Wait, but not everything can be automated, the same work with a supplier, this is bargaining, human qualities are needed, the ability to communicate, negotiate.
- Myths are all invented by people for themselves. And people with their negotiations, sympathies and other non-systemic features only spoil everything, make noise in the system. There are prices on the market, you need to take the lowest price from a trusted supplier. Everything else is fantasy. We will make a closed procurement exchange for accredited suppliers. The system will put up lots, suppliers will compete for who is cheaper, the system will control the final price, expelling crooks from the exchange. All. Merchants will only have accreditation. Although I'm still thinking.
- Well, there are other factors, there, the history of relationships, bonuses from the supplier.
- History - only for history, there is a market and a price at the time of purchase. And no more history. It's all an excuse to raise the price. And bonuses must be taken into account, smeared on the price of the purchased item. This is all marketing stuff for people, but not for the system. The system will still take into account the bonus in the trading price.
“You want to take the last thing from the merchants.
- We have taken everything from marketers, why should something be left to merchants?
Three months passed, Max finished doing the parsing and the purchasing system. I took the statistics on the markup on the purchases of merchants and calculated the markup if the purchases were made on the recommendation of our system. Even without pricing, the losses were in the hundreds of millions. I sent a report to the general. There was a small earthquake in the office. The Purchasing Director and his deputies walked down the corridor red and angry, like players on a losing football team. Merchants were excommunicated from purchases from the first day of the next month. They could make purchases only for specific projects, as well as find suppliers of a new product that we identified that customers could not find on the site. I again gathered the team in the bar, there was something to celebrate.
Sitting in a bar, Skyped jokes with Max. He also drank and willingly joked back.
How do you manage to write so much code? For others, it takes months. You write maximum for one. Tell me honestly, do you keep a whole gang of coders on interest?
“No one advanced writes code anymore, baby. Only juniors do this. I only invent architecture. And the most free code is full on github and in other places. It has been written so much that it will last for many years. Why write, you need to be able to read the code and correct it so that it works, despite the curvature of its unfortunate creator, who in desperation posted it on the network. And connect via API to the general system as a microservice. I sometimes add an interface between microservices. And no gang.

Mashob in search of personnel

According to our plans, it was the turn of the staff. It was the most non-computerized service in the company. And the staff had to be strengthened before taking on sales managers. That was our plan.
- Well, how do we start automating frames? I started Skype with Max on Monday morning before the sprint.
Let's start with recruitment. Do they still look for resumes themselves, through keyword searches on the hunter?
- Yes, but how else? They search for a long time, but they find.
- There is an API. We will make an admin panel - I listed the parameters of the desired candidate separated by commas and wait for the resume. Moreover, you can put it on a permanent search - as soon as a new resume with such qualities appears, it will immediately go to the HR manager. Speed, it's all about speed. Called first, invited first.
- It's right. I also heard that they are looking for those who are inclined to such work and will be delayed by tests. Relevant for sales managers.
– No tests are needed, the Raptor should be trained on resumes and data from social networks for those who are delayed and not delayed, a simple model, we will pass the resumes received from the hunter through it with an additional pull-up of candidate data from the social network.
- Let's also search by psychotype, we have an algorithm for determining the psychotype from social networks.
- What for?
- We have a psychotype of decision makers. We will attach for compatibility. The likelihood of a deal will increase.
“Well, you see, and you have cool ideas, and you complained,” Max unexpectedly but harmlessly quipped.
“We’ll also make them a system of first dialing and invitations somehow,” I added to finally confirm my classiness.

In contrast to the history of procurement in the personnel department, our system was accepted with a bang. They still have a lot of work left, the first interview and hiring with the verification of documents and the signing of contracts, not a single system has yet been able to take away from them. This is the work of people with people. The system was made quickly, as the hunter had a good API. We were ready to start the most difficult part - sales. But Max suddenly changed his mind.

Eyes in stock

– Before automating salespeople, everything else needs to work like clockwork. We need to do the logistics. They also screw up on the timing and accuracy of the assembly of orders. Until you replace them with automatic assembly, we will help them to others.
– How can we help? I can’t imagine yet, there is continuous physical labor, it is not automated by programs. Will we start making robots?
“I see you are in a good mood today. No, not robots, but eyes. Let's make two systems. The first is a mobile application for determining the product code from the supplier from the photo. Will immediately show the storage location in the warehouse. Speed ​​up the receipt of goods. The second is a system for detecting the movement of a storekeeper when assembling an order. Tracker with recognition of the goods collected in the basket. They are unlikely to like it, but they will stop hanging around the corner.
“We don’t have machine vision specialists.
– No need, order on the side, with pre-trained product recognition systems. There are such, read somewhere, you will find. In the meantime, I'll take care of the monitoring system.
– Monitoring what? You didn't tell.
- It is necessary to control all processes, not just logistics.
Why such total control?
- In the client analysis, we will add a chain with a survey on the satisfaction of those who received the order. We will immediately identify when customers have problems.
– This is a good idea, there are a lot of applications with complaints in the contact center. But why monitor?
– To connect information about customer problems with information about process failures. This will allow you to immediately identify where the cause of the failure in working with clients. And promptly remove it. Fewer customers will have time to suffer, more sales and profits.
Who will fix these failures?
- Operational management, what else are they needed for? The task of people is to influence people. Failures in 99% of cases are related to the work of people. A couple of warehouses fell ill and did not go to work - customers did not receive orders. The manager must quickly transfer people to another site. Or set a longer processing time in the system so as not to deceive customers. That's all.

In the first month, the implementation of the warehouse program increased the speed of order picking by a quarter. It turns out that everyone knew, but could not catch the warehouse that they were hacking. But not everyone was happy with the process monitoring system. Statistics became transparent, who performs how many operations. The difference between individual managers turned out to be many times. Just someone worked, and someone sometimes worked. I myself did not expect this and at first I did not even believe it. After providing comparative statistics, several waves of earthquakes swept the office. Some leaders at the planning meeting looked at me as a fierce enemy. But no one has tried to openly oppose the project.

Sales without sellers

Finally, we were ready to automate the most important link - sales managers. It was the most untouchable caste. It was possible to slow down marketing and criticize purchases, but sales were always separate - they brought in revenue. There was no automation in sales. There was a problem book in which they wrote down instructions for customer managers. It was the manager's activity diary, which they formally completed on Fridays for the entire week. It was impossible to check if the manager was at the client's office or just noted that he was in a meeting. Neither mail nor calls were recorded. As the good-natured heads of some sales offices said, the manager goes to meetings 10-15 times a month. The rest of the time they are on the phone in the office. And it processes incoming orders, although there is a contact center for this. Everything was like in a classic crisis - everyone knows that nothing is working the way it should, in theory, but no one dares to change something. The tops can't, the bottoms don't want to. And we had to break into this conservative system with our automatic sales management system. The sales director was much tougher than the purchasing director. And I was even afraid to talk to him without the general. But it was necessary to take on a key link in the sales chain. But first it was necessary to discuss with Max.

- How do we start disbanding sales? I started Monday morning.
- Accounting and control. The salespeople are the only ones left out of the system.
Sounds harsh, but what exactly are we going to do? I have no idea yet how to control sales managers in the fields.
- We will make a mobile application that they will be required to include during working hours. With geolocation and tracking of customer addresses from scheduled meetings.
– If there was a meeting and the geolocation showed the meeting, will the task for the meeting be automatically counted?
– No, the microphone will still work and the conversations will be decoded in the cloud. If all the keywords from the task were sounded and the interlocutors were recognized in the conversation, then the task will be recognized. Also, office premises and signs will be recognized from the camera. The manager will be required to photograph the meeting point.
- Cool, but this is total control, not everyone will agree and may protest
- And let it be better if they leave, we are ready for a massive recruitment. New ones will come and accept such a system as a given.
- But eavesdropping is somehow, well, in general, I myself would not turn it on.
You just didn't listen. The application will prompt the manager with the correct sales script, product recommendations, responses to objections, help immediately on customer questions, all this in the application and automatically from the recognized text during the conversation. To do this, turn on. They don't know how to sell, so they don't go to the client. And with the application of confidence will increase.
- How do you imagine it?
- Place your phone in front of you and look at it while talking. Yes, even with the client. Widgets such as "Don't forget to include in order" will appear on your phone. Or “91% of our customers receive orders on time” in response to an objection, or “Customer may be interested in service X.” It all depends on how it is presented to the manager, how it is useful to him. Many do not meet, because they do not know how to talk with a client, such an assistant will help them. The system will do all the selling for them. And the percentage of them. Fear must be overcome with enlightenment. I didn't say.
I don't know, let's try. I'm so afraid of the sales director, and you still offer such a thing.
- That's not all, tasks in the application, as we planned, will come from client analysis. What to sell, how to persuade. But the application will also transmit data about the meeting back. And the system will look at the total in sales. If it is - offset, if not - write it down. And the system itself will offer to change the manager, fire or change clients for him.
- You want my death. How can I sell this to the sales director?
- Go to the general, let him talk to him. He believes you after what we have done, and the sales director believes in the general. This is the case when you need it.
- Okay I will try. When do you think we can do it?
– This is a standard application, a month old and will be ready with all integrations.

A month later, we presented the application at a sales web conference. I made a presentation specifically from the sales office, where I gathered local managers. There was deathly silence, and not a single question. From the Monday after the presentation, they were supposed to start including apps during business hours. We monitored inclusions. Only a third of the managers did this. We gave the signal to the sales executives. And again they began to wait. Nothing has changed, but a week later, signals began to come from the field that all managers were leaving. In fact, 20 percent quit. It was a failure. All the salesmen rebelled against me. They were supported by vindictive purchases. For the first time, I didn't know what to do. It was impossible to listen to Max and introduce a rigidly complete control system. It was necessary gradually and with a long period of testing. Habits.

- I shouldn't have listened to you, with sales it was necessary somehow differently. The project collapsed, a third of the managers quit. I can be fired.
“Wait, who made the fuss?”
- Sales, of course, they were left without managers, the staff will not find so many quickly, we will lose customers during this time. This is a demarche, a third of the managers left at once in all regions.
“Who told you that we would lose customers?” You are sure?
- Well, it cannot be that people leave, but sales remain.
I don't see any loss in sales. It's been two weeks already. Customers keep buying. Through the website, through the contact center, through the office. Managers left, but not customers.
- You are sure? This is at least strange. Salespeople are sure that "everything is lost, boss" (c).
- They are sure that they have no one to manage now, but otherwise look at the numbers, not the screams. In general, I think everything went perfectly. They themselves left, unlike marketers.
- Are you kidding me? I could be fired and terminate my contract with you.
“Look for yourself, we made a system to cut costs and staff. Those who received a salary, but did not really add sales, quit themselves. This is a victory, not a failure. Go to the general and show the figures for reducing payroll costs by 30% with the same sales. We did everything right.
- But the sales are angry and have already reported to the general.
“Sales are angry because we exposed the truth about the work of some managers. I see that a third of managers, on the contrary, actively use the application, and this correlates with the growth of their sales. Take the numbers and go to the general. The numbers will win.

I checked the numbers again three days later. That's right, sales are going according to plan, nothing has fallen. I sent the numbers first to the sales director. He offered to discuss. The conversation went quietly, but promised to check everything. And if everything is so, then he will stop the recruitment of managers. The statistics were convincing, and he understood the general's reaction. A third of his subordinates did nothing. Rather, according to my version, they were engaged in the processing of incoming orders, which the contact center handled after their dismissal. I sent the statistics to the general. A month later, all deputy sales directors were fired. And sales began to grow, because new managers began to go to customers. With a handy assistant in the palm of your hand.
After this story, I began to feel like a Spartan who left the battlefield barely alive, but victorious. Corporation Warrior. Only the enemy was not outside, but inside. Within ourselves. Our habits are our enemy.

Sales voice assistant

Next in line was the contact center, which by that time had already been shut down from calls. But I didn't understand how to automate the voice.
The contact center after our sales operation asks for help. They don't make it. This is the last point of automation. But this is live communication. Here, as with logisticians, we are unlikely to help, we need people.
- Fuck people, let's automate everything. Let's make a voice bot. The network is full of dialogue bots and voice acting. Light project.
- Are you sure it's possible? Did you hear the recording of the conversation with the client? This is trash! Not only are there only interjections, but also no logic, a bunch of extra words, no punctuation marks. And abbreviations that no Google can recognize. I have already thought about it, read the materials of conferences, only slogans, nothing real.
Why are you making things difficult?
- In terms of?
“Why do you need to recognize all these extra words if you know in advance what the client wants. He wants the goods, we have all the names and synonyms of the goods, sorted by merchants (at least we thank them for this). Add here a few more syntactic constructions from generative grammar, with which he can express this desire. Everything else does not need to be identified. The product vocabulary is limited, the dialogue frame is also understandable and can be described. Put markers of leaving the sales frame on other topics, where there are own bots, or an operator, if the conversation is not at all in the topic, and that's it. For the rest, the customer will adapt if he wants to buy. And Raptor will also train the system on successful and unsuccessful precedents. Naturally, the bot will be assisted by all our recommended features from client analysis. We know by phone who is calling.

Are you sure this will be enough? Something is too simple, corporations are struggling with the problem, and you offer such a seemingly simple solution.
“I already told you that the same person as me works in the corporation, only he doesn’t understand a damn thing or doesn’t want to simplify his task, because he is paid for the time, not for the solution. The rest of the people in the corporation are useless plankton who only makes reports. The solution is simple, because I'm too lazy to do something complicated. If that's enough for a solution, why complicate it?
- What about abbreviations?
- They are easy to calculate and create a dictionary - they are all written in caps. Minute business.
“Damn, I didn't even think about that, although it seems obvious.
– But in general, even mossy guest workers communicate in WhatsApp. We will get two solutions in one, and by voice on the phone, since you have so many telephone retrogrades, and a bot in the messenger. You connect with messengers. I'll take care of the engine.
The ability to create a voice contact center operator seemed fantastic. If it hadn't been Max, I would have only grinned back. Many have already tried to create sales bots, but they all turned out to be very formulaic. Almost said so, and out. It is unrealistic to adapt to them, because it is not clear what templates the creator laid down. And no one will remember them either, if they are not equal to natural ones. And the natural ones were very arbitrary and noisy. I wasn't sure about Max's decision either.
– You know, I read a lot about bots, they have a pattern problem. People constantly fall out of them, and the dialogue ends. No matter how you tune in to keywords and templates in DialogFlow, even their mashob does not help build successful dialogues with the arbitrariness of people. Are you sure we can make it?
– You always look at those who do not succeed, and you become infected with pessimism from them. Of course, it is useful to know what you have already tried so as not to repeat it. But let me remind you that I have a powerful beast that will learn universal patterns on its own. And the people themselves will help him in this.
How are you going to find precedents in such noise? I watched the transcripts of the dialogues.
Why do I need raw data? In case of deviation from the pattern, when the bot does not know how to continue, I will switch to people. This seems to be called variance management.
- And what it will give, so 80% of the dialogues can fall out of the template.
“At first, it probably will. You still do not understand how we will achieve the result, on the contrary, 80% with the bot?
“I don’t even get close.
- I will write conversations switched to operators, parse their frame chains and feed them to the Raptor along with the result achieved by people in the conversation. Where additional training is successful, we include in the model and reduce the number of switching to people according to these conversation patterns. So, until outright trash remains, let it remain in public. This is a couple of people for the whole company.
– Raptor can do everything?
- Not a Raptor, but a universal way to adapt to the process by building its model. That's where the strength lies. We needed not only feedback, backpropagation of the error, but also motivation - reinforcement learning. And everything worked like a living system. Only their evolution is slower. And they don't have a god who helps them evolve like me. I was the first to ride such a universal mechanism in business, not in games. That's all.
“You won’t die of modesty, but it sounds really amazing.

I decided to present this functionality in a special way. Just turn on the bot and offer the general to buy something by voice. And then some numbers. This time there was not even a center of resistance, because the leadership of the contact center was subordinate to the marketing director, and he was already an adherent of the project. And the employees themselves were tired of such boring work and were happy to work only with deviations and complaints. The presentation went off with a bang, except for the fact that the general did not manage to buy it. The general effect, as he said - he just turned out to be an unconventional client and quickly fell on the operator. But the marketing director succeeded, and everyone was delighted. Everyone was guaranteed a prize. But we ourselves were pleased with the result. We went to celebrate in a bar according to an already established tradition. With the permission of the general, I prepared an article in vc.ru, as it was an achievement. Nothing similar has yet been achieved. The bot quickly progressed and learned more patterns. I even felt a sense of emptiness in my heart. We have almost completed the project. There were no more grandiose tasks, although there was a lot of work on honing and retraining. All that remained was the analytics project, which had to be done online with outlier alerts. It was easy, though not fast.

To be continued...
(c) Alexander Khomyakov, [email protected]

Source: habr.com

Add a comment