In this post you will learn to build a chatbot with SAP Conversational AI. For this you only need will to learn – no prior knowledge is required. Not even ABAB.
SAP Conversational AI is
- SAP’s low code chatbot building platform
- a collection of natural language processing services
- AI layer of SAP Business Technology Platform
Let us create a chatbot now.
Step 1 : Create account / sign in
Visit https://cai.tools.sap/ and sign in if you have an account or sign up and create a new account.
New user creation is simple and you need to provide only few fields.
Step 2 : Start creating a new bot
If this is the first time you are creating a chatbot – Click on Start With Template
If you already have built a bot – you will find + New Bot button.
Step 3 : Select chatbot settings
3.1. What do you want your chatbot to do?
Select tile Perform Actions using conversational flows. This type of chatbot is able to understand user input, responds then processes next input and goes through a flow to serve the user.
- Note : Retrieve Answers from FAQ documents is used to create a chatbot that can answer the questions based on a csv document containing questions and answer.
3.2 Select predefined skills for your bot
Select predefined skills from the list. Here, let us select Greetings. These skills will be applied by the bot to have a conversation with user.
3.3 Create your bot
Enter a name for your bot. Enter description and topics if you want to. Keep the language default option unchanged.
3.4 Data Policy
This controls the data retention and whether the conversation will be saved or not. Chose Type of data as Non-personal and Store conversation data as Store.
3.5 Bot Visibility
You can select private or public – its your choice.
Now click the create button at the bottom and your first bot will be created. You will be redirected to below page.
As you can see here – there are 4 tabs – Train, Build, Connect and Monitor. They represent phases in the bots life.
|What is included in the Tab/Phase
|Train the bot to understand users input. Intents are created in this phase.
|Build conversational flow. Skills are built in this phase.
|Connect to messaging platforms.
|Monitor how users communicate with your bot. Whether the bot is understanding users correctly. Based on the findings bot can be updated/upgraded to have new capabilities.
Step 4 Work on Train tab
4.1 Create Intent
An intent is a set of expressions that mean the same thing, but are constructed in different ways. For example – in all three statements below user is asking for the same information.
- which tcode I should use for creating order?
- Order creation tcode
- Transaction for new order
So, we can simply create an intent – find-tcode
To create a new intent – click on
+ New Intent
Provide the details and click
New intent is added in the list. Note that goodbye and greetings were auto-created when we selected Greetings as predefined skill.
4.2 Add Expressions
An expression is a sentence that your bot can understand – it’s basically something that a user might say to your bot. Expressions are organized into intents.
Click on the intent name.
Here we can add the expressions manually or import using a csv file.
Import File format is provided in the pop up itself. We can also select Replace or Merge when uploading expressions. Save below text as .csv file on your desktop and import the expressions using the same.
May I know the tcode;en
May I know the transaction code;en
What is the t-code for;en
I need transaction code for;en
Tell me tcode for;en
Seach for transaction;en
Once Import is successful, expressions are added as below. A golden rule would be to add ideally more than 50 and at least 30 expressions to an intent.
4.3 Train the bot
Click on Train to train the bot using the intent and expressions added.
Once training is completed, the status will be updated.
4.4 Test Intent
At the bottom right corner we have two icons for chat preview and expression analysis.
Chat Preview is used to test the chatbot itself and Expression Analysis is used to analyze whether the expression from user can trigger expected intent or not.
For this testing use expression analysis. Enter phrase ‘what is the tcode for sales order’ and press enter. The intent is found correctly.
Step 5 Create new skill
As per the definition – A skill is a block of conversation that has a clear purpose and that your bot can execute to achieve a goal. In simple word skill means ability of the bot to take certain action.
5.1 Go to Build tab & add skill
Click on Build tab to see skill menu. Chose + Add skill.
For this skill, give a name like ‘give-tcode-info‘, select type as Business and chose Add.
There are several types of skills:
- Business skills should be selected for skill that has core purpose of the bot
- Floating skills complement business skills
- Initialize skill (only one in a chatbot) is triggered at start of conversation
5.3 Configure skill trigger
Click on the new skill give-tcode-info and go to trigger tab.
Click on the blank space after If to get all intents and save.
After save, the trigger will look like below.
5.4 Configure action
Go to the actions tab and click on +New Action Group
Below action types are available – click on Choose Message Type
Then chose the type ‘Text’
Enter message to be provided to user and save.
Step 6 Test the chatbot
This time select chat preview from the bottom right.
Then try to chat with the bot using
- what is the tcode for sales order
- okay then cya
And what we get is as below.
You may have noticed that the platform is easy to use but it provides so many options and it wont be possible to cover everything in blog posts.
What I am going to do next is to show how a practical and useful bot can be built using this platform in next few posts in this series.
Visit the page SAP Conversational AI to see all posts in this series.
If you like the content, please subscribe…