Configuring the blade
---- IFX_LVECTOR_URI ----
In order to index vectors and perform nearest neighbor searches on them efficiently, the HCL Informix VectorBlade must store copies of your vectors in file system files outside of Informix chunks. You can set the location of this storage area using the IFX_LVECTOR_URI configuration parameter in your $INFORMIXDIR/etc/$ONCONFIG file:
IFX_LVECTOR_URI <path to storage directory> Default value:
$INFORMIXDIR/lvector_storage.<DBSERVERNAME>
Informix recommends that you ensure IFX_LVECTOR_URI is set to a unique directory for each instance using a particular
$INFORMIXDIR. The directory should have ownerships of informix:informix, permissions 770.
---- IFX_LVECTOR_OPENAI_KEY ----
For convenience, the blade has a built-in interface with OpenAI for embedding operations. To successfully use the blade to generate an embedding with OpenAI you will need a valid OpenAI API Key. Set that key for all databases in your instance by setting the IFX_LVECTOR_OPENAI_KEY configuration parameter. Example:
IFX_LVECTOR_OPENAI_KEY sk-proj--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -D0GbcqdKRkX
Alternatively you may set the OpenAPI API key on a per-database basis by executing the following routine as user informix while connected to your database:
EXECUTE PROCEDURE lvector_set_embedding_api_key( 'sk-proj--
xxxxx9_V4YfRXV3aWOEw9Al0fviZg_VmLqRCHc_gIMAFRAIDTHISISNOTAWORKINGKEYVJQlRHu_5gH5GlaRD2lbkFJpZv_lw5b5Rxpu_dl6msz DcdO_SD11vWp73IMAFRAIDTHISISNOTAWORKINGKEY-D0GbcqdKRkX');
Warning: If you use this method to set your key(s), instead of the configuration parameter, you will need to re-execute the lvector_set_embedding_api_key() routine for each database each time the server is restarted.
To create an OpenAI API key for generating vector embeddings, you must access the OpenAI API platform , separate from the standard ChatGPT interface.
Steps to Create Your API Key
- Log In to the Platform: Go to the OpenAI Platform and log in with your existing OpenAI account or create a new one.
- Navigate to API Keys: On the left-hand sidebar of the Dashboard, click on the API keys tab.
- Generate a New Key: Click the "+ Create new secret key" button.
- Label Your Key: Give your key a name (e.g., "Embeddings Project") to identify its purpose later.
- Copy and Save: Your full secret key will only be shown once. Copy it immediately and store it in a secure location (like a password manager or environment file).
Essential Requirements for Vector Embeddings
- Billing Information: You must add a payment method and purchase credits (starting at $5) for the API key to function; the API is not free beyond limited initial trial credits.
- Models for Embeddings: When using your key, the blade is explicitly using text-embedding-3-small.
- Security: Never share your key or commit it to public code repositories like GitHub.
---- IFX_LVECTOR_MAX_CONN ----
You can limit the number of simultaneous users who perform ANN (approximate nearest neighbor) searches using the blade by configuring the IFX_LVECTOR_MAX_CONN parameter. This parameter's maximum value is 16, which is also the default:
IFX_LVECTOR_MAX_CONN 16
---- STACKSIZE ----
Whenever data blades or User Defined Routines (UDRs) are used heavily in an Informix instance it is a good idea to increase the thread stack size from its default of 64 KB. One does this using the STACKSIZE parameter in your $INFORMIXDIR/etc/
$ONCONFIG file: STACKSIZE 128
Informix recommends a thread stack size of 128 when using the
VectorBlade. ---- VPCLASS ----
The UDRs bundled with this blade are designed to run on the 'lvec' VP class. When your blade is registered for the first time, one 'lvec' VP will be created if none exists. However, it is better to indicate the existence of this VP class in your config file, and to configure the initial number of VPs in the class. For example:
VPCLASS lvec,num=4
Chapter 3. Getting Started
---- PRELOAD_DLL_FILE ----
Include $INFORMIXDIR/extend/lvector.1.0.0_EAP/lvector.bld in the value of your PRELOAD_DLL_FILE configuration parameter and the Vector Blade's shared library will be automatically loaded each time the server is started. Otherwise it will load the first time one of the blade's UDRs is executed, which may cause a delay of several seconds.