Table of Contents

Introduction
Tutorial Version History
Download and Installation
Support
Integration Services
Code Gallery
Licensing

Git Hub
Source Code
Issue Tracking

Community
Classes & Schedule

Tutorial - Initial Setup

Table of Contents

RPA, AI or Both?


When initially setting up CASE, it’s first question will be to ask if you’d like to bypass the AI capabilities of CASE.

Settings file not found. Starting initial setup...
Enter the GPT4All host file location, press Enter to use default (C:\Users\[Your Username]\GPT4All\):
Type 'bypass' to skip LLM and Generative AI configuration, or to strictly use RPA.

You can choose:

  • Press Enter - This will use the default path.
  • Type 'bypass' - This will skip the AI installation.
  • Type: C:\Path\To\Your\GPT4All\Installation


Setting Up AI


After you have provided and CASE has determined a valid installation of GPT4All exists, you will be asked to provide the cached location of the *.gguf files. By default (as of 8/24) this is located in "C:\Users\[Username]\AppData\Local\nomic.ai\GPT4All"

Enter the GPT4All cache location (press Enter to use default):

You can choose:

  • Press Enter - This will use the default path.
  • Type: C:\Path\To\Your\GPT4All\Cache\Location


AI: Under the hood


There are many parameters available to AI model tuning for optimizing and configuring your models to allow larger input arrays, consume larger blocks of text at a faster speed, output more material by default and more. These parameters are also heavily detailed on the GPT4All Software Development Kit reference webpage.

Would you like to fine-tune the AI model handler? (yes/no)

You can choose:

  • Type: no (or anything else) - defaults will be utilized.
  • Type: yes - this will bring you to the following options.


AI.ReceivedTokens (n_ctx): Number of tokens received. (Default: 2048)

AI.GPULayers (ngl): Number of GPU layers. (Default: 100)

AI.MaxTokensSent (max_tokens): Maximum number of tokens sent. (Default: 4096)

AI.Temperature (temp): Sampling temperature. (Default: 0.7)

AI.Top_K (top_k): The number of highest probability vocabulary tokens to keep for top-k filtering. (Default: 40)

AI.Top_P (top_p): Cumulative probability of token sequences to consider for sampling. (Default: 0.4)

AI.Min_P (min_p): Minimum cumulative probability for token sequences. (Default: 0)

AI.Penalty (repeat_penalty): The penalty for repeating tokens. (Default: 1.18)

AI.Repeat_Last_N (repeat_last_n): Number of last tokens to consider for repetition penalty. (Default: 64)

AI.ConsumptionBatch (n_batch): Batch size for consumption. (Default: 128)

AI.ShowLoadTimes: Display load times for model discussion and responses. (Default: True)

AI.SimulateType: Iteratively display responses character by character (Default: True)

CASE offers customization of the 'AI.ShowLoadTimes' and 'AI.SimulateType' options. These features are set to True by default, but if you are using CASE as an interfacing agent with AI through another piece of software, it is better to leave AI.SimulateType Disabled.

Alternatively, if you are using CASE as a direct chat agent, turning off 'AI.ShowLoadTimes' will be beneficial for a natural conversation.



AI: Model Selection


CASE then browses your model folder and collects a list of models for you to choose from.

Available models in cache:
1. mistral-7b-instruct-v0.1.Q4_0.gguf
Enter the number of the model you want to use:

You will be pressing the number for the model you'd like to load, in this circumstance I'd press '1'.


CASE: Storage Methodology


At this point in the initial setup procedure, the software will ask you if you want to store the data in the FlatFile system or the Database system.
CASE stores every interaction with Generative AI and the RPA requests. These are stored in a series of containers. By default, the chat logs are not stored in the storage system. This is why the CaseInteractions folder/database table is empty, this is designed to allow the user to store data in as they wish.


CASE: FlatFile Storage



CaseCommands Folder - This folder is for storage of your CASE RPA Commands.

Example JSON output data to the CaseCommands.dat file:

{
"Command":"openExplorer",
"CodeToExecute":"e;sExplorer.exe{ENTER}",
"Keywords":"Windows, Explorer, Start Menu",
"Software":"Windows",
"LastUsed":"1970-01-01T00:00:00",
"Dynamic":false
}

CaseInitializationLog Folder - This folder is for tracking load times on your AI model initiations.

Example JSON output data to the CaseInitializationLog.dat file:

{
"LLM":"Conversational",
"DT":"2024-03-07T11:42:06.4492263-05:00",
"Loading":false,
"Loaded":true,
"TimeToLoad":"38.625795125961304"
}

CaseLogs Folder - This folder is for tracking your actions as you utilize CASE, it tracks every update and change made to the software.

Example JSON output data to the CaseLogs.dat file:

{"SessionId":"00000000-0000-0000-0000-000000000000","LogMessage":"SCADA Solve went through the initial setup procedure."}
{"SessionId":"1454b8a4-618f-4357-9aa5-65cf54b6d426","LogMessage":"Executed: e;sexplorer.exe{ENTER}"}
{"SessionId":"1454b8a4-618f-4357-9aa5-65cf54b6d426","LogMessage":"SCADA Solve activated the chat agent"}
{"SessionId":"1454b8a4-618f-4357-9aa5-65cf54b6d426","LogMessage":"Went through command creation procedure"}

CaseSessions Folder - This folder tracks your initial start and update time as you use CASE, this allows tracking of the start and end times CASE has been activated.

Example JSON output data to the CaseCommands.dat file:

{
"Session":"1454b8a4-618f-4357-9aa5-65cf54b6d426",
"StartDT":"2024-03-09T11:41:01.6110118-05:00",
"EndDT":"2024-03-09T11:45:40.3318522-05:00",
"Username":"SCADA Solve"
}

CASE: Database Storage


During the initial setup, if you choose a database architecture, you will need a connection string for CASE's distribution manager to utilize to auto-create the database table structures. This connection string will be stored in the Settings.conf file hosted in the same folder as the application, so the integratedSecurity condition would be advisable given the security implications of a raw password stored in the string. You will need to specify the database to store CASE into.

Sample connection string:

"Server=SERVER\SQLExpress;Database=CASE;Integrated Security=True;"


Example buildout of SQL Tables used by CASE:




Below are the table structures installed into the database. These are constructed and inserted automatically on connecting to the database, and do not to be executed manually.


CaseCommands Table Structure - This table is for storage of your CASE RPA Commands.


CREATE TABLE [dbo].[CaseCommands](
	[Command] [nvarchar](max) NULL,
	[Keywords] [nvarchar](max) NULL,
	[codeToExecute] [nvarchar](max) NULL,
	[Software] [nvarchar](max) NULL,
	[LastUsed] [datetime] NULL,
	[Dynamic] [bit] NULL
)

CaseInitializationLog Table Structure - This table is for tracking load times on your AI model initiations.


CREATE TABLE [dbo].[CaseInitializationLog](
	[llm] [nvarchar](20) NULL,
	[dt] [datetime] NULL,
	[loading] [bit] NULL,
	[loaded] [bit] NULL,
	[timeToLoad] [nvarchar](50) NULL
)

CaseInteractions Table Structure - This table is used for custom storage of CASE executions and interactions.


CREATE TABLE [dbo].[CaseInteractions](
	[Username] [nvarchar](20) NOT NULL,
	[Message] [nvarchar](max) NULL,
	[Screen] [nvarchar](255) NULL,
	[DT] [datetime] NULL,
	[Receiver] [nvarchar](20) NULL,
	[Submitted] [bit] NULL,
	[WaitingOnResponse] [bit] NULL,
	[Answered] [bit] NULL,
	[ActionPerformed] [bit] NULL,
	[TimeToProcess] [nvarchar](50) NULL,
	[CommandsActivated] [nvarchar](max) NULL,
	[id] [uniqueidentifier] NULL
)

CaseLogs Table Structure - This table is for tracking your actions as you utilize CASE, it tracks every update and change made to the software.


CREATE TABLE [dbo].[CaseLogs](
	[sessionid] [uniqueidentifier] NULL,
	[logmessage] [nvarchar](max) NULL
)

CaseSessions Table Structure - This table tracks your initial start and update time as you use CASE, this allows tracking of the start and end times CASE has been activated.


CREATE TABLE [dbo].[CaseSessions](
	[session] [uniqueidentifier] NOT NULL,
	[startDT] [datetime] NULL,
	[endDT] [datetime] NULL,
	[username] [nvarchar](50) NULL
)