There are a couple of things that need to be initialised in the index utilities for AI History.
Run the following script.
cd C:\InsightMaker\Utils\InsightMaker.IndexUtilities
.\InsightMaker.IndexUtilities.exe initialise --ai-history
You can check this was successful by logging into the Control Hub.
Go to Mappings then Models.
You should see an Aiimi Insight Engine group with two models within it.
Go to the configurations area of the control hub.
Click new configuration and select source from the dropdown.
Configuration ID: Enter ai_history.
Configuration Description: Enter AI History.
Manage: Under visibility uncheck manage.
Mapped Data Models: Select Aiimi Insight Engine AI from the dropdown.
Source System: Select AI History from the dropdown.
Select the available agent from this tab.
Select Save
Once the Source Configuration is set up go to the configuration page.
Find the source you just configured.
Select the actions menu for the source.
Select Start.
This will create a new empty index that you can see in Kibana.
Within the Control Hub go to Search Flows.
Select Edit of the Search Flow you want to add history to.
On the General tab
History Source: Select AI History from the dropdown.
Save the Search Flow.
If your AI chats are hanging on the second message it is likely due to a malformed AI History index.
Delete the corrupt source index
For example, DELETE prod_idx_ai_history_main
Go to the Configuration page.
Select the AI History source config.
Select the actions menu for the source.
Select Start.
This will create an empty index. You can confirm this has worked by checking in Kibana.
You can now start using AI History in search flows again.
After creating a new chatbot search flow and defining its AI history source you should restart the middleware with iisreset.