SAP Conversational AI Overview & Build your first BOT
Welcome to my first blog post. In this series of blog posts, I’ll walk you through the SAP Conversation AI, which is one of the trending products from SAP.
The series will include:
- SAP Conversational AI – Getting Started
- Integration with S4HANA Cloud and developing a business case SAP Conversational AI + S4HANA Cloud – ‘A Fantabulous Combination’
- Integration with messaging platforms like Whatsapp, Telegram
Let’s start with the basics first:
A chatbot is a computer software program designed to simulate human conversation via text or audio messages.
Conversational AI refers to the use of messaging apps, speech-based assistants, and chatbots to automate communication and create personalized customer experiences at scale.
Terminology/Nomenclature used in SAP CAI
- Intent – An intent is a group of expressions that mean the same thing but are constructed in different ways using a different set of words. Intents are the core of your bot and are responsible for bots understanding. For example, if I want my bot to understand when someone asks for help. Just create an intent called ‘help’ and fill it with every expression a user would say when asking for help.
• Could you help me? • I’m lost, give me a hand please. • Can you help? • What can you do for me?
- 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 and constitute the complete knowledge of your bot. The more expressions you have, the more precisely your bot can understand its users. Example If the intent is order-food, some useful expressions could be:
• I’d like to order a pizza. • Can you get some pasta for me? • How about a salad? • A veggie burger and fries would do nicely!
- Entity – An entity is a keyword that is extracted from an expression. The bot can automatically detect 28 different entities, such as Datetime, Location, Person, and so on. SAP CAI calls them gold entities. However, you’re not limited to these gold entities. You can also tag your own custom entities to detect keywords depending on your bot’s context, such as city name, if you’re building a bot that can tell the weather.
- Skill – A skill is a block of conversation that has a clear purpose and that your bot can execute to achieve a goal. It can be as simple as the ability to greet someone, but it can also be more complex, like giving movie suggestions based on information provided by the user.
There are a few more terms which I’ll explain while we build our first bot.
So now let’s get started with building our first SAP Conversational AI BOT
Use Case – Beginning with simple use cases, this bot will respond to some simple user requests, and the answers will be built-in into the bot, aka Scripted Bots. Later in subsequent blog posts, I’ll show you how to integrate the bot with SAP S4HANA system and make actual business transactions.
Step 1. Head over to SAP Conversational AI and create your account on CAI.
Step 2. After logging into your newly created account, click on +NEWBOT
After you’ve created your bot, you’ll be welcomed by a screen similar to below. Based on the settings you choose while creating bot a few elements like Intents can vary, but we do not need to worry about that now.
Step 3. Create a new intent ‘jokes’.
Step 4. Add Expressions for your newly created intent
Now we have our intent ready, we need to add expressions to it. An expression is a sentence that your bot can understand.
Similarly, add few expressions which mean the same thing. Like
- Can you tell me a joke?
- I want a joke
- How about a joke
Step 5. Create custom entities for – For each expression, consider ‘joke’ as keyword and add it as an entity in each expression.
Step 6. Create a skill
Each Skill represents one thing that your bot knows how to do, and they can interact with each other.
Step 7. Add triggers to the Skill.
Step 7. Add requirements (optional step)
Requirements: Describes what information this Skill has to collect, and what questions need to be asked to fulfill the requirements.
Requirements are either intents or entities that your Skill needs to retrieve before executing actions. Requirements are pieces of information that are important in the conversation and that your bot can use, for example, the user’s name or a location.
Step 8. Add actions for your Skill
An action is something that your bot executes at a specific point when executing a skill. To add actions to a skill, open the Skill on the Build tab, and then open the Actions subtab and click ADD NEW MESSAGE GROUP.
An action can be one of the following:
- Send a message to the user
- Call webhook
- Fallback (that is, redirect the conversation to a human agent)
- Go to another skill
- Edit the bot’s memory for the current conversation
- Change language
Similarly, add few more jokes as messages, and the bot will randomly pick jokes from this message group.
Step 9. Now its time to test your BOT.
Click on CHAT WITH YOUR BOT button on the bottom right side of the screen and test your bot with various expressions.
Note – In case you get any error like below :
Make sure you disable the already existing joke intent if it exists.
Parts of this blog post has been taken from below source:
Upcoming topics in this series of the blog:
- Integration of CAI with S4HANA Cloud SAP Conversational AI + S4HANA Cloud – ‘A Fantabulous Combination’
- SAP CAI + S4HANA Cloud + Whatsapp = A marvelous user experience!
I’ll keep updating this blog post for further updates and links to new blogs in this series.
Stay tuned for more upcoming fantastic stuff.
I hope you all have enjoyed this blog post, and I’ve been able to make myself clear. Please let me know your thoughts, doubts in the comment section below, and if you enjoyed, please like and share.
Wishing excellent health and safety to all of you and your friends & families.