A note from 2026: This article was published in 2016. Microsoft Bot Framework is now part of Azure Bot Service, LUIS was retired on October 1, 2025 and replaced by Azure AI Language Conversational Language Understanding, Skype consumer service was retired in May 2025, and the hybris brand is now SAP Commerce Cloud.

Introduction

2016 is the year of conversational e-commerce: a number of large retailers are already experimenting with chatbots. This spring, Kik, a messaging app with 275 million registered users, launched a bot store for brands and publishers to build their own bots that deliver services to users. Sephora and H&M have Kik-powered bots that help shoppers browse and buy their products. Taco Bell showed off its TacoBot, a way to use the messaging app Slack to place a meal order. Amazon introduced its Echo, Google announced Allo, and Facebook built its bot engine on top of Messenger — and it is now capable of accepting payments!

Recently, Microsoft launched its Bot Framework, which allows developers to write bot code once and, using the Microsoft Bot Connector, deploy it on multiple channels, including Skype, Slack, and SMS.

This article is about the integration of Microsoft Bot Framework and hybris. I managed to create a PoC to demonstrate how different channels — in my example, Skype and Messenger — work with the MBF.

Microsoft Bot Framework

At the core of Microsoft’s bot work is the Microsoft Bot Framework. The Framework consists of three pieces:

The strong point of this framework is that there are ready-made integration layers in the middle — Bot Connector and Bot API — and once you have developed and tested a bot, you will be able to connect it quickly to a number of third-party products without touching the bot’s codebase. Certainly, it also imposes certain limitations, but it seems that all conceivable things have already been put into the framework.

Hybris Integration

The architecture is similar to the one I described for the hybris/Facebook Messenger integration. There is a component that is basically a web service server used to process the requests from the bot framework. I will refer to it as Bot Server. The main tasks of this piece of software are processing user input and sending automated replies back to the user. So, in its simplest form, it may work completely independently from any other resources, such as a hybris e-commerce storefront or employee-facing components, such as Cockpits.

There are two types of integration:

For the first task, the hybris web services are used. Bot Server pulls information from hybris by performing REST calls. Alternatively, Bot Server and hybris can share the same data — for example, a SOLR index — or hybris can offload some data to Bot Server to put data closer to the place where it is processed.

The reverse operation, which provides hybris with Bot Server data, is also backed by web service calls.

In my PoC, I demonstrate that hybris OCC is used for the product search. The user input is basically a search string.

Microsoft Bot Framework integration architecture with hybris

Using the bot framework, you can create comprehensive dialogs. For example, you can first ask the customer for their country, then for their zip code, and save this information into a profile linked with the IM account, to use this information in the “nearest stores” and “current promotions” user queries. Day by day, your bot may ask something new and gradually enrich the knowledge base.

There are some important points about the bot framework.

Make services asynchronous. Any request in your system may take more time than you or your customer expects. Obviously, you will not be able to put Skype on pause while the response to the sent message is on its way. It is one of the biggest difficulties in chatbot programming.

Be aware of the delays. They are not predictable. If your bot server sends a message to the customer, you never know how long it will take to deliver the message. And vice versa, you never know how soon the bot framework will inform your bot server about the request. Generally, these delays are not significant, but sometimes, for unknown reasons, it takes up to 10 seconds. Sometimes, it is too much for real-time chat: your customer will treat it as “the bot is not working”. Use logging to be aware of the real magnitude of this challenge and deal with it accordingly.

Test all channels for all user scenarios. For example, Skype is capable of displaying scrollable product carousels — see the screenshot above — but Facebook Messenger is not. If you have tens of products in the carousel, Facebook Messenger will display them one by one vertically. The vertical placement is very bad in terms of UX, especially for mobile clients. You are certainly able to identify a channel and change the information you send back to the user, but doing so is against the initially conceived architecture.

Microsoft LUIS – natural language parser

According to luis.ai, LUIS is a Language Understanding Intelligent Service, which offers a fast and effective way of adding language understanding to applications. With LUIS, you can use pre-existing, world-class, pre-built models from Bing and Cortana whenever they suit your purposes; and when you need specialized models, LUIS guides you through the process of quickly building them. LUIS is a part of Microsoft Cognitive Service.

LUIS can work directly with the Bot Framework, or your Bot Server can use LUIS as a service using the Microsoft Cognitive Services API. The latter approach is more flexible because you can use both natural language requests and fixed commands in one chat.

These examples show how LUIS works.

Intents. Intent means just what we desire and what our intention is. Intents are basically groups for an infinite number of natural language requests. The AI network connects natural language patterns to intents dynamically based on examples from you that form the knowledge base.

Utterances. These are examples of natural language requests that are examples of usage. You need to explain the structure of these requests to LUIS. It will help LUIS recognize similar utterances automatically.

Entities. The response of the LUIS engine is a JSON structure that contains the original query and recognized ideas. Entities are basically the keys of these ideas. For example, if the query may contain product names, you need to create a Product entity.

Phrase List Features. Some components of utterances are examples of business entities, such as specific product or category names, colors, or places. Using phrase lists significantly increases recognition quality, because these are key components of utterances. These sets are usually countable and finite.

Prebuilt entities. Such entities as dates, money, numbers, temperatures, and ages are prebuilt, which means that LUIS is capable of identifying them automatically if you mark part of an utterance as a prebuilt entity.

E-Commerce and chatbots

Chatbots are good for knowledge areas where the range of possible requests or answers is limited or managed by the bot. For e-commerce, they are good for ticket sales or pizza delivery, but for broader areas, the LUIS way may not fit expectations.

It is good when a bot initiates a dialog, asking the customer about something in a very clear and concise way. It should be a direct question. The range of answers should be clearly seen. For example, if the bot asks you about your age, you will likely answer “48”, won’t you? Some people who are natural-born testers may reply with “forty-eight”, but nobody will use something like “I’m in my late 40s” or “yesterday I turned 16”. However, if the customer is the first to initiate the dialog, the range of possible requests is really huge.

Look at the Kik’s H&M bot dialog:

Kik H&M bot dialog example

Every step in this dialog has a limited set of possible answers. Think about using expert systems to ask the right questions. For example, the Drools engine might be leveraged for this task.

E-commerce bots are good at giving advice or requested information to the user, but they aren’t capable of following the customer through the checkout process properly. Usually, bots redirect the customer to the website if the customer wants to buy a product or service. There is too much information that needs to be shown to the customer. The chat window is too small and it has too simple a UI for these purposes.

Neither Microsoft Bot Framework nor Skype is capable of receiving payments natively, without sending the customer to an external website. Facebook’s head of Messenger, David Marcus, announced a new feature today onstage at TechCrunch Disrupt SF 2016: now you will be able to use Messenger for payments. Now it is the turn of Microsoft to do the same with Bot Framework.

Video

© Rauf Aliev, September 2016