Skip to Content
Technical Articles
Author's profile photo Jeff Chen

Building chat-bot with SAP Conversational AI & SAP Products

Introduction

I’m going to show you a chat-bot which can help HR search employee’s salary by name and employee number on specific date.

On the high-level, I’ll need to do:

  1. Create SAP UI 5 on SAP Cloud Platform
  2. Create SAP Conversational AI chat-bot
  3. Create server REST APIs to help chat-bot query database.
  4. Create Two tables(people and salary) in SAP HANA

For this post, I will focus on the chat-bot side.

 

 

It’s very easy to build your bot by leveraging SAP Conversational AI. You just need four steps!

The first step is training your bot, helping it to know what do you say. Here, “Intents” means the concept of which is designed to trigger “Skills”.

For example, “I wanna know the salary” and “show me the salary” means the same intent — “salary ”. On the other hand, “Entities” means the words like “person”, “number”, “date-time”.

Second, “skills” — after your chat-bot understand what do you say, you need to create your conversational flow with builder tool. You can let chat-bot take actions here.

For here, we need to set up web-hook which is meaning your chat-bot can request to your APIs and get the responses! I’ve built a simple query code here.

Sample code: https://github.com/JeffChern/SAP-ConversationalChatBot-ServerCode

 

If you choose using SAP HANA and developing with Python. You also need to open-db-tunnel at the same time when you query data from HANA.

Also, you need to make sure your REST APIs are good to respond. You can use software like Postman to check.

We can use ngrok to help us connect our localhost APIs via the Internet. (Don’t forget to set it in setting page)

Third, just choose the platform which you want to deploy!

Finally, the last step is helping you to trace what did your chat-bot receive and what kind of skills did it trigger.

Results:

Let me show the tables I created on SAP HANA here. We can see there’s an employee named tim cook and his employee_id is i000000 with several salary data.

Let’s focus on salary on January 2019, it’s 9999.

You can see payment date 2019–01–01 is 9999 in each query.

 

Let’s change the salary to 13579!

Woohoo, It shows 13579!

 

Conclusion

SAP conversational AI presents a new way for people to interact with data. A chatbot allows you to simply ask questions or help you do anything you want. Enjoy talking to your chat-bot!

 

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Nabheet Madan
      Nabheet Madan

      Nice blog, looks like today is Bot day, reading second blog about them, first one is here.

      Author's profile photo Sebastien BEGHELLI
      Sebastien BEGHELLI

      Nice tutorial! Thanks from the SAP Conversational AI team! 😉

      Author's profile photo Sergio Guerrero
      Sergio Guerrero

      very nice blog.. thank you for sharing all the details. I saw a demo of the  SAP Conversational AI product at tech ed last year... it was pretty awesome.

      Author's profile photo trupti agarwal
      trupti agarwal

      Nice Blog…!! thank you for sharing all the details.