Start building your own chatbot now

How do you search for information about specific SAP products? The SAP Help Portal serves as an important resource for customers because it contains a lot of information about various SAP products. Wouldn’t it be great to have your own intelligent chatbot that can help you easily access the documentation for a software product on the SAP Help Portal?

In this tutorial, you will learn how to deploy a backend service and use a preconfigured SAP Conversational AI chatbot template which allows you to do exactly that. This AI chatbot can help you search for content on the SAP Help Portal and leverage the information available in the existing product documentation.

Everything you’ll need comes for free:

Architecture

The high-level architecture of our setup looks as follows:

architecture-chatbot-help-portal

The backend service (search-conversion service) in the service runtime layer (Cloud Foundry/ Kubernetes / Serverless runtime) is called from an action in the SAP Conversational AI model.

This service proxies the request to the “real” backend and the SAP Help Portal search API and returns the request in a format which your AI chatbot understands. Finally, your bot displays the search results according to your search query.

5 easy steps to build your own AI chatbot

  1. Set up the application runtime (Cloud Foundry)
  2. Deploy the search-conversion service (Cloud Foundry)
  3. Fork the preconfigured bot model (SAP Conversational AI)
  4. Customize the bot model (SAP Conversational AI)
  5. Chat with your bot (SAP Conversational AI)

steps-how-to-build-ai-chatbot-sap-conversational-ai

Step 1 – Set Up the Application Runtime (Cloud Foundry)

1.1 Get a free trial account in the Cloud Foundry environment.

1.2 Download and install the official command line client (CLI) for Cloud Foundry.

1.3 To put the Cloud Foundry CLI configuration into the correct directory, set the CF_HOME variable.

  • Variable name: CF_HOME
  • Variable value: C:\Users\<USERNAME>environment-variables-user-cloud-foundry

1.4 Restart your computer.

1.5 Open a command line tool, for example, Windows PowerShell.

1.6 Log on to the Cloud Foundry environment: cf login

1.7 Set the target API endpoint where you want to deploy the application. For an overview of the API endpoints, see Regions and API Endpoints Available for the Cloud Foundry Environment.

windows-powershell-target-api-endpoint

1.8 Enter your email and password:

email-password-login-windows-powershell

Step 2 – Deploy the Search-Conversion Service (Cloud Foundry)

2.1 Clone the backend service for the search-conversion skills from https://github.com/afritzler/search-conversion.

2.2 Navigate to the directory of your cloned backend service for the search-conversion skills. For example, C:\Users\<User>\documents\github\search-conversion

cloned-backend-service-cloudfoundry

2.3 Push the application: cf push

push-application-cloudfoundry

2.4 Get the application URL: cf a

application-url

2.5 Note down the application URL. You will need to enter this URL in your SAP Conversational AI bot.

Step 3 – Fork the Preconfigured Bot Model (SAP Conversational AI)

3.1 Logon to SAP Conversational AI. If you do not have an account yet, create one. It’s free!

3.2 Once you’re logged in, fork the search-conversion bot.

fork-chatbot-sap-conversational-ai

Step 4 – Customize the Bot Model (SAP Conversational AI)

Once you have forked the bot model, you can customize it according to your individual product requirements.

4.1 Click the Build

4.2 Open the skill search-query. This skill calls the search-conversion service.

bot-builder-sap-conversational-ai-query

4.3 Click the Actions tab.

bot-builder-action-tab-sap-conversational-ai

4.4 Adapt the request body of the webhook as follows:

  • Replace the application URL with the one that will call your application from the cloud foundry. (See step 2)
    The URL must have the following format: https://<Application URL>/search
  • Replace the product name and version defined in your project map as metadata. By default, the bot is preconfigured to search within the product documentation for SAP Landscape Management, enterprise edition software. The body must have the following format:
{
  "response_type": "<carousel, card or buttons>",
  "products": [
    {
      "name": "",
      "version": "",
      "max_results": 
    }
  ],
  "conversation": {
    "memory": {
      "query": "{{nlp.source}}"
    }
  }
}

memory-query-sap-conversational-ai-chatbot

4.5 Open the Fallback skill and adapt the replies according to your bot identity.

Step 5 – Chat with your SAP Conversational AI chatbot

The bot now calls the search-conversion service whenever it recognizes a known search phrase as defined in the @search-query intent, for example:

  • How I can connect SAP Conversational AI to Slack?
  • How can I start a system?
  • Show me the SAP Conversational AI Help Portal page

webchat-sap-conversational-ai-chatbot

If required, add more changes to existing intents and further actions according to your individual requirements.

Congrats, your chatbot is now complete!

You should now have built a fully functional chatbot that can answer questions based on your specific product documentation.

If you have any questions about this tutorial, feel free to ask us in the comments section below or go to SAP Answers.
Ready to improve your bot building skills once again? Check out our blog! We often publish new tutorials for beginners and experts.

Happy bot building! 🤖

Want to build your own conversational bot? Get started with SAP Conversational AI !

Follow us on
There are currently no comments.

This site uses Akismet to reduce spam. Learn how your comment data is processed.