Skip to main content

Setting Up the Supply Chain AI Assistant

This page describes how to set up the Supply Chain AI Assistant.

Installing the AI Assistant Package

To install the AI Assistant package:

  1. In the namespace where you want to use the AI Assistant API, start the ObjectScript shell.

  2. Start IPM. To do so, enter the command zpm.

  3. Upgrade IPM to at least version 0.10.7. To do so, enter the command install zpm.

    This version of IPM requires Python 3.10, 3.11, or 3.12.

  4. Obtain a login for the https://ipm.intersystems.comOpens in a new tab package repository.

  5. At the IPM prompt, use the following command to log in to that package repository:

    repo -o -name isc -url https://ipm.intersystems.com -username <username> -password <password>
    

    Use your username and password as arguments, as shown here.

  6. Still at the IPM prompt, install the Supply Chain AI Assistant package, as follows:

    install isc-supply-chain-ai-assistant
    

Getting Started

To get started:

  1. Obtain credentials for Azure OpenAI. (For information on supported models, see Posting and Updating Credentials.)

  2. Use the AI Assistant API to upload those credentials to your Supply Chain Orchestrator instance.

    This upload starts a significant amount of background processing, so wait a few minutes before asking a question. If using an IRIS version prior to 2025.3, you will need to create and provide an encryption key. For related instructions, see Data-Element Encryption.

    This step also adds two tasks to the Task Manager.

  3. Open the Task Schedule page and review the schedule for the following new tasks:

    • {namespace}_ProcessDDLTask

    • {namespace}_ReverseIndexTask

    These tasks are initially scheduled to run once a day. They update the vector tables to reflect any relevant changes to the data. These tasks can be as is or can be scheduled at a custom time, for example, outside of work hours or after a large data ingestion process.

Uploading Memories

A memory is an additional chunk of information for the AI Assistant to use when generating responses. You can define memories system-wide and for individual users. The AI Assistant API uses all applicable memories.

First, it is a good idea to review all the standard supply chain table names and identify all cases where the table name does not align with the specific usage in your industry. The tables are fully generic and capture the scenarios needed in any supply chain, but the table names do not necessarily match what is typically used. For example, in a medical supply chain, the Customer table may be used to store patients. For each table, if the use is not obvious based on its name, create a memory explaining how that table is used.

Some additional useful memories could include the following:

  • Any less other obvious use of the data model (for example: “The SalesOrder table is also being used to store service orders”)

  • Preferred calculation methods (for example: “To calculate revenue, use the sum of sales minus outstanding purchase orders older than 30 days”)

  • Industry terminology definitions

  • Personal shorthand

  • User context (for example: “I work in Warehouse 43”)

Use the AI Assistant API to upload memories to your Supply Chain Orchestrator instance.

New Supply Chain Data

If data is populated into the SC_Data schema, it may be necessary to rerun the vectorization tasks. Specifically, if either of the following conditions are true, it is necessary to rerun those tasks:

  • The data is master data, as opposed to transactional data, and includes the names or identifiers of an entity that may be referenced in a user question.

  • The data is the first data to populate a column or table which was previously not used.

Troubleshooting

Business Process Coverage

If the AI Assistant does not provide information about a business process, make sure that the business process meets all the following criteria:

  • It must be in the currently running production.

  • It must be enabled.

  • It must inherit from Ens.BusinessProcessBPL.

  • It must have the request type SC.Core.BP.Message.IssueAnalysisRequest.

Tables to Check

If the responses seem wrong, check that SC_Core_AI_Vector.DDL, SC_Core_AI_Vector.NER, and SC_Core_AI_Vector.Memory are populated, and that the latter two have embedding values.

Tracing

Connecting the system to an instance of Langfuse allows for tracing for debugging as well as LLM usage monitoring. To integrate with Langfuse, the following environment variables should be defined: LANGFUSE_HOST, LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY, AND LANGFUSE_ACCESS_URL.

It is also useful to enabling Haystack tracing for greater text-to-SQL visibility. Set HAYSTACK_CONTENT_TRACING_ENABLED=True.

FeedbackOpens in a new tab