This is a cache of https://developer.ibm.com/tutorials/awb-enhance-chatbot-performance-rag/. It is a snapshot of the page as it appeared on 2025-11-21T04:28:16.192+0000.
Updating the knowledge base of a RAG DA <strong>c</strong>hatbot - IBM Developer

Tutorial

Updating the knowledge base of a RAG DA chatbot

Update a RAG chatbot knowledge base by adding new documents to enhance its real-time response accuracy

By

Ana Biazetti,

Jennifer Glover,

Anuj Jain,

Igor Naumov

Retrieval-Augmented Generation (RAG) is a powerful architecture for chatbots, blending real-time document retrieval with generative responses to create more accurate and contextually relevant answers. IBM cloud has a DA (Deployable Architecture) which includes deployment of a sample chatbot using watsonx Assistant and AI. This guide walks through the process of updating the RAG DA chatbot’s knowledge base with new documents so it can be adapted to other domains.

Objective

The objective of this blog post is to provide a step-by-step guide on updating the knowledge base of a RAG-based chatbot to transition from home loans to life insurance knowledge base. By walking through the process, users will learn how to seamlessly update their chatbot's knowledge base, ensuring that it adapts to provide accurate and timely responses to customer inquiries in other domains.

Prerequisites

  1. Deploy the RAG Deployment Architecture (DA) in the IBM cloud Red Hat OpenShift (ROKS) environment using ElasticSearch Platinum with ELSER2 (Elastic Learned Sparse EncodeR). For detailed instructions, see the Deploying RAG Solutions with ElasticSearch Platinum and OpenShift tutorial.

  2. Access the RAG DA GitHub repository.

The RAG Deployment Accelerator (DA) uses Elasticsearch as the chatbot’s knowledge base repository. It initializes a keyword index with sample bank loan data.

Variations in RAG DA: Basic and Standard

  • Basic variation:

    • Uses IBM cloud Elasticsearch Enterprise edition.
    • Adding or updating content requires:
      • Transforming documents into text.
      • Manually creating or updating the index directly in the Elasticsearch instance.
    • The index is then linked to the chatbot via the watsonx Assistant UI.
  • Standard variation:

    • Uses IBM cloud Elasticsearch Platinum edition.
    • Enables document updates directly through the watsonx Assistant UI.
    • watsonx Assistant automates:
      • Document transformation.
      • Index creation or updates.
      • configuration of an ELSER2 vector index for advanced semantic search and retrieval.

Note: The steps outlined in this guide are specific to the Standard variation using Elasticsearch Platinum edition.

Steps to access the application and how to upload new artifacts to the RAG chatbot

Step 1: Navigate and open the application

Depending on whether your application is hosted on IBM cloud code Engine or ROKS, follow one of the two paths outlined below to navigate to the application.

Using code Engine
  1. Expand the Navigation Menu (A) and hover over containers (B), then select Projects (c).

    alt

  2. On the Overview dashboard, select your project (A) (e.g., prefix-Generative_AI_Sample_App_cI_Project).

    alt

    alt

  3. Switch to the Applications (A) tab and click Open URL (B) to relaunch the application.

    alt

Using ROKS
  1. Open the Navigation Menu (A) and select Projects (B).

    alt

  2. choose your project.

  3. Go to the configuration (A) tab, expand your project, and select Workload – Sample RAG App configuration (B).

    alt

  4. Find the sample_app_public_url and click to open the application.

Step 2: Interact with the home loan virtual assistant

  1. Open the virtual agent chat window in the bottom right-hand corner (A).

    alt

  2. Ask the virtual assistant questions regarding home loans. Here are some example questions.

    • What is a conventional loan?
    • What is arm?
    • What loan should I get for an expensive property?
    • How much does it cost to get a bank loan?

      alt

  3. Ask the following questions regarding life insurance and observe how the virtual assistant is not able to answer the questions. As currently configured, the virtual assistant’s knowledge base is centered around home loans, rendering it unable to provide accurate or relevant information on life insurance.

    • What are the different life insurance policies?
    • When should I buy life insurance?
    • What does life insurance cover?

      In the next section, we will guide you through the step-by-step process of updating the chatbot's knowledge base to life insurance.

Step 3: Access AI resources in your IBM account

  1. Go to the Resource List (A) in your IBM cloud account.

  2. If necessary, filter by a specific resource group (B).

  3. Expand the AI / Machine Learning (c) section in the resource list.

  4. Select watsonx Assistant (D).

    alt

Step 4: Launch the assistant

click Launch Assistant (A) to open the main dashboard of your chatbot project.

alt

Step 5: Verify project selection

Ensure you are working on the correct project (A) by checking the project name. It should resemble (prefix)-gen-ai-rag-sample-app-assistant.

alt

Step 6: Update assistant architecture

  1. In the Assistant Architecture section, locate conversational Search and click change (A).

    alt

  2. Select Draft (A) as the environment for making changes, then click confirm (B).

    alt

Step 7: configure Elasticsearch for document retrieval

  1. Select Elasticsearch (A) as the retrieval method to access the document knowledge base.

    alt

  2. In the Settings (A) tab, choose Upload documents to a new index in your Elasticsearch instance (B), then click Save (c).

    alt

Step 8: Add new documents

  1. Go to the Documents (A) tab and click Upload (B).

    alt

  2. Upload the new documents. Please go to this GitHub respository to find 5 sample life insurance documents that can be uploaded.

    alt

Step 9: Relaunch the chatbot to apply changes

To ensure the chatbot integrates the updated documents into its responses, you’ll need to relaunch the chatbot application. Follow Step 1 to relaunch the application.

Ask the life insurance questions again and observe the improvement in answers.

  • What are the different life insurance policies?
  • When should I buy life insurance?
  • What does life insurance cover

Summary

RAG based chatbots rely heavily on the information stored in their knowledge base. By updating the index with new documents, you are able to update the knowledge base of the chatbot. For example, the default home loan chatbot shipped as part of the RAG DA can be easily adapted to answer life insurance inquiries.

Through this updating process, your chatbot will be able to retrieve recent and relevant information in real time, making interactions more effective.