Add Watson Discovery News to Your Chatbot

5 min read

By: Henrik Loeser

Extend your database-driven chatbot

Some months back I introduced you to a barebones news chatbot. Today, with the updated tutorial to build a database-driven chatbot in place, I want to show you how to easily combine Watson Assistant with Watson Discovery.

Watson Assistant already provides steps to deploy an integrated search skill which is based on Watson Discovery. My approach is similar to the database integration described in the tutorial: Deploy a cloud function and invoke it from the dialog. Read on for the details.

News Preview

Cloud Functions for dialog actions

The tutorial on how to build a Db2-based chatbot leverages dialog actions to reach out to a database system and return the results to the user in a bot response. The code for the news integration is a Python action deployed as IBM Cloud Functions. You bind the action to an existing Discovery service. That way, the code has access to the credentials and can connect to the system News collection.

With the code in place, you need to extend the skill from the tutorial and create an intent, an entity, and two dialog nodes. Details are in the linked GitHub repository. Once everything is in place, you can use the preview to test the news integration. I've included a screenshot of the rough output after a search for "bodensee."

Summary

It is easy to extend the tutorial for building a database-driven chatbot for other backends. I used the same concepts to add news from Watson Discovery to my chatbot. Check out the tutorial for additional ideas on how to extend it.

If you have feedback, suggestions, or questions about this post, please reach out to me on Twitter (@data_henrik) or LinkedIn.

Be the first to hear about news, product updates, and innovation from IBM Cloud