Functions and procedures

Table 1. genai.vector.encodeBatch() Function

Syntax

genai.vector.encode(resource :: STRING, provider :: STRING, configuration = {} :: ANY) :: ANY

Description

Encode a given resource as a vector using the named provider.

Input arguments

Name

Type

Description

resources

LIST<STRING>

The object to transform into an embedding.

provider

STRING

The identifier of the provider: ("VertexAI", "OpenAI", "AzureOpenAI", "Bedrock").

configuration

MAP

The provider specific settings.

Returns

ANY

Table 2. genai.vector.encodeBatch() Procedure

Syntax

db.vector.encodeBatch(resources :: LIST<STRING>, provider :: STRING, configuration = {} :: ANY) :: (index :: INTEGER, resource :: STRING, vector :: ANY)

Description

Encode a given batch of resources as vectors using the named provider.

Input arguments

Name

Type

Description

resources

LIST<STRING>

The object to transform into an embedding.

provider

STRING

An optional list of selectors to filter out changes.

configuration

MAP

The provider specific settings.

Return arguments

Name

Type

Description

index

INTEGER

The index of the corresponding element in the input list.

resource

INTEGER

The name of the input resource.

vector

INTEGER

The generated vector embedding for the resource.

To store the embeddings created by the encoding functions as node/relationship properties, use the built-in procedures db.create.setNodeVectorProperty and db.create.setRelationshipVectorProperty. Once stored as properties, they can be queried using vector indexes.
Table 3. genai.vector.listEncodingProviders() Procedure

Syntax

genai.vector.listEncodingProviders() :: (name :: STRING, requiredConfigType :: STRING, optionalConfigType :: STRING, defaultConfig :: MAP)

Description

Lists the available vector embedding providers.

Return arguments

Name

Type

Description

name

STRING

The name of the GenAI provider.

requiredConfigType

STRING

The signature of the required config map.

optionalConfigType

STRING

"The signature of the optional config map.

defaultConfig

MAP

The default values for the GenAI provider.