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:
-
In the namespace where you want to use the AI Assistant API, start the ObjectScript shell.
-
Start IPM. To do so, enter the command zpm.
-
Upgrade IPM to at least version 0.10.6. To do so, enter the command install zpm.
-
Obtain a login for the https://ipm.intersystems.comOpens in a new tab package repository.
-
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.
-
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:
-
Obtain credentials for working with Azure OpenAI.
-
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.
-
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.
Some useful memories could include the following:
-
Any use of the data model outside of its documentation (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.