IBM Developer

Tutorial

Building a supply chain sustainability advisor using watsonx.ai and IBM SCIS

Learn how to integrate watsonx.ai and IBM Supply Chain Intelligence Suite to enhance supply chain management with AI-driven automation and insights

By Priya Vasudevan, Suja Mohandas
Archived content

Archive date: 2025-11-02

This content is no longer being updated or maintained. The content is provided “as is.” Given the rapid evolution of technology, some content, steps, or illustrations may have changed.

The IBM Supply Chain Intelligence Suite (SCIS) is a comprehensive software platform designed to optimize and enhance supply chain operations. It combines the power of AI and automation to provide real-time insights, predictive analytics, demand forecasting, and risk management to help organizations stay ahead of potential disruptions. These features enable businesses to improve efficiency, reduce costs, enhance collaboration with suppliers and partners, and respond proactively to changes in the market.

A key component of the suite is the Supply Chain Business Assistant, a conversational AI platform that leverages IBM watsonx Assistant. Using natural language understanding (NLU), watsonx Assistant interprets user requests, enabling seamless access to data, report generation, and delivery of insights through a conversational interface. The Supply Chain Business Assistant is pre-trained on a comprehensive set of supply chain-related requests, making it an essential tool for managing and optimizing supply chain operations.

This tutorial outlines the steps to train the Supply Chain Business Assistant on Scope 3 terminologies by implementing a dialog skill.

Prerequisites

To integrate watsonx Assistant with the SCIS tenant, the watsonx Assistant instance with custom skills must be registered with the SCIS tenant to recognize these custom skills.

To complete this registration, an IBM support ticket should be submitted with the following details:

  • SCIS Tenant ID
  • watsonx Assistant ID
  • watsonx Assistant Service URL
  • watsonx Assistant API Key
  • watsonx Assistant Draft Environment ID and Live Environment ID

alt

Configure Watson Discovery

  1. Load the Watson Discovery instance from the Resource List under AI/Machine Learning.

    alt

  2. Create a project by clicking on New Project.

    alt

  3. Within the project, create a new collection by clicking on New collection.

    alt

  4. Upload the required documents to the Watson Discovery instance by navigating to the Upload data tab.

    alt

  5. Perform relevancy training to improve watsonx Assistant's responses.

    alt

Configure watsonx Assistant

  1. Log in to IBM Cloud.

  2. Load the watsonx Assistant instance from the Resource List under AI/Machine Learning.

    alt

Create an Intent

  1. Click on the Create Intent button.

    alt

  2. Provide a name for the intent and add User examples. User examples are the questions that users might ask Watson Assistant. Add as many user examples as possible to cover a variety of scenarios.

    alt

Add an Extension

  1. Navigate to the Integrations menu.

    alt

  2. From the Extensions page, select Build Custom Extension.

    alt

Configure the Watson Discovery extension

  1. Upload the wd_openapi.json file.

  2. Specify the API key and URL for the Watson Discovery instance.

  3. Save the changes.

    alt

    Note: You can retrieve the API key and URL for the Watson Discovery instance from the Resource List under Watson Discovery instance.

    alt

Configure the watsonx.ai extension

  1. Upload the watsonx-openapi.json file.

  2. Enter the API key and URL of the watsonx.ai instance within the Custom Extension.

  3. Save the changes.

    alt

    Note: You can retrieve the API key and URL for the watsonx.ai instance from the Resource List under Watson Discovery instance.

    alt

Variable definitions

The following variables must be defined and will be used across various steps when defining Actions.

For this tutorial, we have used the ibm/granite-20b-multilingual model. However, you are encouraged to explore and use other Granite models available from IBM.

alt

Create an Action skill

  1. Click on New Action to create an action and specify a name.

    alt

  2. Create five steps within the action as outlined below. Add each step by clicking on New Step:

    • Step 1. Capture User Input

      • Define a step to consume the input from the user and store it in the variable Question.

      • Provide the Watson Discovery extension details:

        alt

        • count: 3
        • query: Question variable defined
        • passages.enabled: true
        • passages.characters: 250
        • passages.find_answers: true
        • collection_ids: Should be fetched as shown in the screenshot below
        • table_results.enabled: false
        • project_id: Should be fetched as shown in the screenshot below
        • version: 2022-08-01
      • To fetch collection_id and project_id:

        • Open the instance of Watson Discovery and navigate to the project where the files have been uploaded.

        • Go to Integrate and Deploy -> API Information.

          alt

        • Navigate to Manage Collections and open the collection. Then, go to Manage Data and open the document. Click on View as JSON in the top right corner to retrieve the necessary IDs.

          alt

    • Step 2. Store Watson Discovery output

      • Store the output from Watson Discovery in a variable WD_Result_info.

      • The first result with the highest confidence will be used.

        alt

    • Step 3. Prepare input for the LLM model

      • Set a temporary string variable, temp_input, for concatenation purposes.

      • Provide necessary instructions to the LLM model and clear the Question variable.

      • The model prompt will be constructed as follows:

        ("Answer the following question using information from the article confidently , which is surrounding with ###. If there is no answer in the article, provide the same article as the response.Article ###").concat("Result from discovery").concat("###").concat("Question")

        alt

    • Step 4. Provide watsonx.ai extension details

      • Provide the watsonx.ai extension details:

        alt

        • input: Input to the Granite model
        • model_id: Should be fetched as shown in the screenshot below
        • project_id: Should be fetched as shown in the screenshot below
        • parameters.max_new_tokens: 500
        • parameters.temperature: 0.5
        • parameters.top_k: 50
        • parameters.top_p: 1
        • parameters.decoding_method: sample
        • parameters.min_new_tokens: 1
        • version: 2023-05-29

          Note: To fetch model_id and project_id, refer to the following image.

          alt

    • Step 5. Store LLM output

      • Set the output of the LLM model to a variable, prompt_result, which will be the final response from the assistant and displayed to the user.

        alt

Create a Dialog skill

  1. Navigate to the Dialog section from the menu.

  2. Click on Add Node and specify a name for the node.

  3. In the If assistant recognizes field, specify the relevant intent names.

  4. From the drop-down menu, select the action you created earlier.

  5. Set the parameters, with the Question variable corresponding to the text input from the user. The return variable will be auto-populated.

    alt

  6. In the Assistant responds section, assign the output variable that was auto-created and set the next step to anything_else.

    alt

Configure webhooks

Webhooks in watsonx Assistant allow it to interact with external systems. To configure the webhook, specify the following details:

alt

  • URL: https://api.ibm.com/scassistant/run/named-entities/na/recognize

  • Authorization:

    • Bearer $integrations.chat.private.jwt
  • Client ID:

    • X-IBM-Client-Id scassistant-$integrations.chat.private.tenant_id

Call the webhook within the Dialog

  1. Click on the Customize gear icon for the Call a Webhook option within the dialog.

    alt

    This sample dialog node processes a dynamic value for Category (stored in $sterling_entities.category_name.value) from the user, and then displays the suppliers for that specific category.

    The previously configured webhook will be invoked from this dialog node with the necessary configurations:

    • Click on the gear icon for $sterling_entities.
    • Click on the three dots icon and select Open JSON editor to view the category name "compactSuppliersForCategory".

    alt

    alt

    alt

    In SCIS, the page compactSuppliersForCategory is created, as shown below, and is linked to the category name in watsonx Assistant by using the webhook callout to the NER API.

    alt

  2. Configure the Anything else option in the dialog node to handle queries that the Assistant cannot recognize or respond to, as shown in the screenshot.

alt

Demonstration video

To learn how to build a supply chain sustainability advisor using watsonx.ai and IBM SCIS, watch the following demonstration video:


Video will open in new tab or window

Summary and next steps

The integration of IBM SCIS, generative AI, and Watson Discovery represents a significant advancement in supply chain management. This convergence reduces time and effort for business users while enhancing decision-making and operational efficiency.

Generative AI can also be used to simplify developers' tasks, such as generating GraphQL code to create work queues in SCIS, further streamlining development processes and boosting productivity.

Useful resources

Acknowledgments

Thanks to Irene Lee and Kevin Grozav for their invaluable assistance with the registration and integration of these products.