Nestlé’s Approach to Chatbots on SAP Cloud Platform

Insight-to-action capabilities via seamless transition between solutions

The solution diagram above illustrates a basic architectural pattern of the design-time environment for Nestlé’s approach to chatbots on SAP Cloud Platform.

Customer Profile

Nestlé is the world’s largest food and beverage company. They have more than 2000 brands ranging from global icons to local favorites, and they are present in 189 countries around the world.

Size: 323,000 employees, annual revenue of CHF 89.9 billion
Country or Region: Switzerland
Industry: Consumer products
Author: Trond Stroemme

Business Scenario

Large organizations, such as Nestlé, tend to have complex processes involving several IT systems. This complexity can make it difficult to bring processes together in a way that gives end users a seamless transition between solutions, while keeping the context of their task. For example, imagine that you are looking into your company’s sales figures and want to relate that data to the most recent sales orders, and then decide you want to pick out those customers who require a specific follow-up. Essentially, you want insight-to-action capability without having to switch screens or apps.

Conversational AI, or chatbots, is one way of addressing this problem. However, developing a chatbot as a secure, intelligent interface between the end user and various back-end systems can be challenging, especially when managing various sources of data and traversing several cloud platforms.

This document describes how Nestlé addressed both of those challenges by using SAP Cloud Platform in combination with other components such as SAP Conversational AI, Microsoft Azure Active Directory, and on-premise SAP systems.

Pain Points

  • Increasingly complex IT landscape
  • Mobilization of workforce
  • Automation of repetitive and formalized tasks (such as providing answers to standard user queries)
  • Loss of context when switching between different solutions

Industry Example

One of the first conversational AI use cases implemented by Nestlé was a chatbot for Human Resource (HR) employees. The HR department receives a large number of inquiries from users looking for aggregated information about HR headcount, such as the number of employees for various countries, or the percentage of full-time versus part-time hires. The idea behind the chatbot was to provide self-service access to this information, while visualizing the data graphically using SAPUI5 smart graphics.


After evaluating several conversational AI platforms, Nestlé decided to use SAP Conversational AI (formerly known as Recast.AI). This allowed them to use OData services to retrieve data from the back-end SAP Business Warehouse (BW) system, where the information is exposed in a BW query. The central point of this solution is a Node.js application hosted in the SAP Cloud Platform Cloud Foundry environment. The Node.js application contains two main components:

  1. ‘BotFather’, which handles the back-end calls, authentication, conversation status, and web calls to the back-end services.
  2. ‘Gatekeeper’, which is the SAPUI5 web application where the chatbot is exposed. 

The whole solution is implemented as a Multi-Target Application (MTA) in the SAP Cloud Platform Cloud Foundry environment. The Gatekeeper component contains one single view with a few SAPUI5 controls to handle input from end users and provide output from the bot. The BotFather provides a compliant exchange of information between SAP Conversational AI and on-premise systems, using the SAP Cloud Connector.

The Gatekeeper interacts with the BotFather component, which, as mentioned above, takes care of the inner workings of the app. The services of the chatbot were available to Nestlé employees in the form of a mobile SAPUI5 app, as well as deployment on internal web sites. The SAP Cloud Platform app was also used to tokenize and store HR data from the OData service so that sensitive information was not passed on to SAP Conversational AI.

Value Proposition

By putting SAP Cloud Platform at the center of their solution, Nestlé was able to:

  • Handle the data exchange between the conversational AI service from Recast.AI and the back-end systems in a secure way
  • Implement their organizational Single Sign On for the chatbot app
  • Carry the context of the user request across different systems
  • Provide an SAPUI5-based UX interface suitable for both web pages and mobile devices, with integrated graphics in the chatbot UI

There are a lot of conversational AI services offered on the market, and Nestlé undertook a thorough evaluation of the major contenders during 2016-17. Their main criteria were architectural simplicity, deployment options (which, for internal chatbots, were initially targeted for Skype for Business and web pages), and compatibility with OData services. After evaluating 8+ frameworks, they decided on the Microsoft bot framework and SAP Conversational AI (which became available in January 2018); both of which were included in Nestlé’s internal strategy recommendations for B2E chatbots (for B2C scenarios, they have adopted other frameworks, like DialogFlow).

In the specific use case described in this document, which involves interacting with data from SAP BW exposed as a service on their SAP Gateway hub, it was decided to use SAP Conversational AI ( This framework contained all the features needed (ease of use, advanced query management, Node.js compatibility, channel exposure via SAPUI5 and web, and OData interaction).

As for the back-end service, they briefly contemplated building a custom OData service on their HR client, but quickly decided to use an existing BW query instead, which contained all the search options needed. The beauty of using BW queries as OData services lies in the simplicity of exposure, which requires minimal effort.

In terms of development resources planning, they could leverage existing competences for Gateway services, JavaScript, and SAPUI5. The only area where they lacked in-depth competence was development and deployment on Cloud Foundry. This was, however, also one of the arguments for going ahead with this implementation: The chatbot solution would be their first in the SAP Cloud Platform Cloud Foundry environment and would therefore also build internal competence for future projects.

Implementing a chatbot in an already complex technical landscape is challenging. You need a number of components, such as the tool to design the rules of the chatbot conversation (the “chatbot builder”), the Natural Language Processing (NLP) mechanism that tries to understand what the user is saying, as well as the back-end services that connect to your corporate or external services,  if want to interact with your SAP ERP or other systems. On top of this, you need some form of authentication mechanism to ensure that the person using the chatbot is who they claim to be, whether they are an internal employee or an external user. To further complicate things, you will need to expose the chatbot in some kind of ”channel”, which can be a web page, a mobile app, or a collaboration platform such as Workplace, Skype, or Slack. This means you need to build or interact with not only “native” components and tools like SAP Gateway and SAP Cloud Platform, but also third-party tools and services.

At Nestlé, their goal was to maintain an architecture with as few components and platforms as possible. They wanted to host their chatbot on SAP Cloud Platform because the platform had already proven its value in a range of other projects. Also, SAP Cloud Platform can connect easily to back-end SAP systems using the SAP Cloud Connector, which was an advantage because they wanted to use corporate data exposed on an SAP Gateway hub. Finally, since SAP Conversational AI already provided a “bot connector” template written in Node.js, it was a good candidate for the SAP Cloud Platform, Cloud Foundry edition. This also allowed the use of various embedded tools and libraries already present on SAP Cloud Platform for authentication and interaction with our Microsoft Active Directory, where the user authentication and SSO was done.

In addition, SAP Cloud Platform provided them with embedded services such as Redis, which was used for temporarily storing sensitive business data related to the communication context. They could also have used the SAP Cloud Platform embedded HANA database for this, but their use case was ideal for a lightweight data storage such as Redis.

The main reason for wanting to store such sensitive data temporarily on SAP Cloud Platform relates to the fact that they are using an external cloud service for the chatbot’s NLP mechanism, which is the “logic” that decodes what the user says and formulates replies. The NLP mechanism resides on the Conversational AI cloud platform, outside their SAP Cloud Platform instance (and thus also outside the Nestlé firewall). In their chatbot use case, they are retrieving potentially sensitive business data from their SAP Gateway back-end service and embedding it into the chatbot’s replies to the user, and as they were not allowed to send such sensitive business data to an external cloud platform like Conversational AI, they had to first store it temporarily on SAP Cloud Platform, then tokenize it. The token is sent to Conversational AI for embedding into the reply to the user. This reply then passes through SAP Cloud Platform on its way back to the web page or channel where the chatbot is exposed. During this final “pass”, the token is replaced with the business data in their Redis instance, and this ensures that the potentially sensitive data never leaves the Nestlé cloud environment.

This “data anonymization” mechanism was probably the most complex part of their chatbot implementation, and where they expended most of their implementation effort. They believe that this logic will no longer be needed once the SAP Conversational AI (Recast) solution becomes available as a service on SAP Cloud Platform itself.

One of the operational aspects to consider is the monitoring of the app and how users will interact with it. Another operational consideration is the rollout to all the countries represented in a global company such as Nestlé. Different countries have different attitudes towards conversations. Some cultures may prefer short terse answers, for example, while others prefer off-topic small talk. These aspects have not yet been addressed, since their first chatbot is intended for use by the global HR office. However, we need to look into these topics going forward with new use cases.

Multiple language support and speech-to-text are two other important topics to address in the future. On the language side, Nestlé knows that there are use cases across the globe, which means a strong need for both “global” (Spanish, French, German…) and more “local” languages (like Turkish, where another use case is currently being investigated).

Training and monitoring are further aspects that need to be focused on closely. In Nestlé’s (limited) experience, training the chatbot is best done as a collaboration between the chatbot developers and a select team of users. Persistence in training is the key to good results. Leaving users or super-users to handle this on their own can rapidly lead to failure and disappointment, as ordinary users tend to look at chatbots as all-round “oracles”, without being aware of the contextual limitations to their conversation. Due to this, focused follow-up and retraining is important for a period after go-live, as is proper information to end users about the scope and limitations of the chatbot.

For now, Nestlé is using a Microsoft QnA service as a fallback intent for their chatbot. This means that the chatbot funnels unidentified questions from end users to the QnA knowledge base, which has been populated with several relevant questions and answers. This mechanism allows users to ask questions that go beyond the specific main skill of their chatbot (that is, providing headcount numbers). Still, they need to explore whether having such a fallback skill could cause issues of its own. For example, will the chatbot NLP mistake valid questions related to headcount for questions that should be forwarded to the QnA service? The Recast NLP allows you to tune the confidence levels of the “skills” that it operates on, but Nestlé have already seen that using a fallback mechanism could present some challenges. They expect to gather key learnings soon as more conversational bots are rolled out, and they become more confident in structuring and tuning skills.

Bill of Material – SAP Cloud Platform Components for Licensing Considerations

Please note that the following Bill of Material is for reference purposes only. The following table is only an example of the SAP Cloud Platform services and components required for this use case.

Sales Item


Licensing Metrics


Redis Service

An open-source, advanced, in-memory key-value store with on-disk persistence. Can be used as a cache database, and message broker.

GB of Memory Blocks per unit

100 GB

Application Runtime

Operate polygot cloud applications in Cloud Foundry on the SAP Cloud Platform *not reflected in the solution diagram.

Instances: X-Small, Small, Medium, Large (CPU Cores (per node), GB Memory (per node), GB Disk Space (per node)

1 Medium Instance (4 CPU Cores, 16 GB Memory, 60 GB Disk Space)

Customers can use the SAP Cloud Platform pricing estimator to calculate the required investment for a particular project. Scale up or down on services as required.

Members and partners of SAP PartnerEdge* can evaluate the development of an application for this use case – most development licensing is covered by the packs offered by the SAP partner licensing services. Click here for details.

*excluding open ecosystem basic.