The Research Chatbot, along with other Insight Booster (IB) deliverables, leverages data from your Knowledge Bases (KB). To use the Research Chatbot, you must first create an IB project, link a KB, and generate a landscape. While you can interact with the chatbot within the project, you can access it externally, customize it, and embed it into your website. This guide will walk you through the steps to effectively integrate the Dcipher Research Chatbot chat interface into your web application.
First, Open your Insight Booster projects menu. Locate the row corresponding to your Insight Booster project name, where you will see several icons. The icons related to your Research Chatbot are listed and explained below.
Icon 1: Starts the chat before entering the project.
Icon 2: Allows you to customize your chat settings, including the chatbot's domain and user interface.
Icon 3: This icon generates the client secret for your chatbot. It also provides documentation and relevant information for integrating the bot into your web application (details will follow).
Icon 4: Displays chat usage, indicating the number of questions asked.
After clicking on Icon 3, a window will pop up displaying your client key and essential integration information.
To successfully integrate the Dcipher Research Chatbot, your host application must include both a backend and a frontend. The backend is responsible for making POST requests to Dcipher's Auth API to obtain new access tokens whenever required, and the frontend is responsible for embedding the iframe and requesting new access tokens from your backend when they expire (every 10 minutes).
The first step is to retrieve the short-lived access token from Dcipher's Auth API. This token facilitates secure communication between your web application and the Research Chatbot.
clientId: ID assigned to your Dcipher account. Available at the top of the page, next to “Client ID”. This value cannot be changed.
clientSecret: The secret key assigned to your Dcipher account. Available at the top of the page. This value can be renewed in case of suspected leakage.
userId: ID of the user who interacts with the Dcipher Research Chatbot through your web application. This ID enables multiple users to access a single Research Chatbot while ensuring each user has a separate chat history. In case the Research Chatbot is offered to be accessed publicly on a website, random IDs can be set in every page reload to start a new chat.
Then, embed the iframe into your web interface. The Research Chatbot uses access tokens to authenticate requests. The embedded iframe will automatically request a new token when the current one expires.
The iframe and your application will communicate via the "MessageEvent" API. Your application should listen for the "authenticate message" event, which prompts a request for a new access token from your backend. After obtaining the access token, your application can send it to the embedded iframe using the “postMessage” method.
Following these steps will successfully integrate the Dcipher Research Chatbot into your web application.