Functions and procedures
Functions and procedures are different Cypher features: functions are used inside expressions and evaluate to a value, whereas procedures are invoked with CALL.
For more information, see Cypher → Functions and Cypher → CALL procedure.
|
Most GenAI features are available only in Cypher 25.
If your database’s default language is Cypher 5, prepend the query with CYPHER 25 to override the default for that query (see Cypher → Select Cypher version).
|
ai.text.completion()Cypher 25FunctionIntroduced in 2025.11
Syntax |
|
||
Description |
Function to return generated text output based on the provided prompt. |
||
Input arguments |
Name |
Type |
Description |
|
|
Textual prompt. |
|
|
|
Name of the third party AI provider, see Generate text → Providers. |
|
|
|
Provider specific configuration, see Generate text → Providers. |
|
Returns |
|
Generated text based on the provided prompt. |
|
For usage examples, see Generate text from prompt.
ai.text.completion.providers()Cypher 25ProcedureIntroduced in 2025.11
Syntax |
|
||
Description |
Returns text completion providers and their configuration options. |
||
Return arguments |
Name |
Type |
Description |
|
|
Provider name. |
|
|
|
The signature of the required configuration options. |
|
|
|
The signature of the optional configuration options. |
|
|
|
Default configuration option values. |
|
For provider details and examples, see Generate text → Providers.
ai.text.structuredCompletion()Cypher 25FunctionIntroduced in 2026.02
Syntax |
|
||
Description |
Generate structured output as a map based on the specified prompt and JSON schema. |
||
Input arguments |
Name |
Type |
Description |
|
|
The prompt to generate output from. |
|
|
|
A map describing the JSON schema for the desired output. |
|
|
|
The identifier of the provider: 'Azure-OpenAI', 'Bedrock', 'OpenAI', 'VertexAI'. |
|
|
|
Provider specific configuration, use |
|
Returns |
|
A structured map conforming to the provided schema. |
|
For usage examples, see Generate structured output.
ai.text.structuredCompletion.providers()Cypher 25ProcedureIntroduced in 2026.02
Syntax |
|
||
Description |
Returns structured-output completion providers and their configuration options. |
||
Return arguments |
Name |
Type |
Description |
|
|
Provider name. |
|
|
|
The signature of the required configuration options. |
|
|
|
The signature of the optional configuration options. |
|
|
|
Default configuration option values. |
|
For provider details and examples, see Generate structured output → Providers.
ai.text.chat()Cypher 25FunctionIntroduced in 2025.12
Syntax |
|
||
Description |
Chat based on the specified prompt, optionally continuing a previous response. |
||
Input arguments |
Name |
Type |
Description |
|
|
The user message to send. |
|
|
|
Previous chat ID to continue the conversation. If this is the first message in the conversation, set to null. |
|
|
|
The identifier of the provider: 'azure-openai', 'openai'. |
|
|
|
Provider specific configuration, use |
|
Returns |
|
Contains |
|
For usage examples, see Chat with context.
ai.text.chat.providers()Cypher 25ProcedureIntroduced in 2025.12
Syntax |
|
||
Description |
Returns chat providers and their configuration options. |
||
Return arguments |
Name |
Type |
Description |
|
|
Provider name. |
|
|
|
The signature of the required configuration options. |
|
|
|
The signature of the optional configuration options. |
|
|
|
Default configuration option values. |
|
For provider details and examples, see Generate text → Providers.
ai.text.embed()Cypher 25FunctionIntroduced in 2025.11
Syntax |
|
||
Description |
Encode a given resource as a vector using the named provider. |
||
Input arguments |
Name |
Type |
Description |
|
|
The object to transform into an embedding. |
|
|
|
The identifier of the provider: ("vertexai", "openai", "azure-openai", "bedrock-titan"). |
|
|
|
The provider specific settings. |
|
Returns |
|
The generated vector embedding for the resource. |
|
For usage examples, see Generate and store a single embedding.
ai.text.embedBatch()Cypher 25ProcedureIntroduced in 2025.11
Syntax |
|
||
Description |
Encode a given resource as a vector using the named provider. |
||
Input arguments |
Name |
Type |
Description |
|
|
The objects to transform into embeddings. |
|
|
|
The identifier of the provider: ("vertexai", "openai", "azure-openai", "bedrock-titan"). |
|
|
|
The provider specific settings. |
|
Return arguments |
Name |
Type |
Description |
|
|
The index of the corresponding element in the input list. |
|
|
|
The given input resource. |
|
|
|
The generated vector embedding for the resource. |
|
For usage examples, see Generate and store a batch of embeddings.
ai.text.embed.providers()Cypher 25ProcedureIntroduced in 2025.11
Syntax |
|
||
Description |
Lists the available vector embedding providers. |
||
Return arguments |
Name |
Type |
Description |
|
|
The name of the GenAI provider. |
|
|
|
The signature of the required config map. |
|
|
|
The signature of the optional config map. |
|
|
|
The default values for the GenAI provider. |
|
For provider details and examples, see Embeddings → Providers.
genai.vector.encode()FunctionDeprecated in Cypher 25
Deprecated in Cypher 25.
Use ai.text.embed() instead.
|
Syntax |
|
||
Description |
Encode a given resource as a vector using the named provider. |
||
Input arguments |
Name |
Type |
Description |
|
|
The object to transform into an embedding. |
|
|
|
The identifier of the provider: ("VertexAI", "OpenAI", "AzureOpenAI", "Bedrock"). |
|
|
|
The provider specific settings. |
|
Returns |
|
The generated vector embedding for the resource. |
|
For current usage examples, see Generate and store a single embedding.
genai.vector.encodeBatch()ProcedureDeprecated in Cypher 25
Deprecated in Cypher 25.
Use ai.text.embedBatch() instead.
|
Syntax |
|
||
Description |
Encode a given batch of resources as vectors using the named provider. |
||
Input arguments |
Name |
Type |
Description |
|
|
The object to transform into an embedding. |
|
|
|
An optional list of selectors to filter out changes. |
|
|
|
The provider specific settings. |
|
Return arguments |
Name |
Type |
Description |
|
|
The index of the corresponding element in the input list. |
|
|
|
The given input resource. |
|
|
|
The generated vector embedding for the resource. |
|
For current usage examples, see Generate and store a batch of embeddings.
genai.vector.listEncodingProviders()ProcedureDeprecated in Cypher 25
Deprecated in Cypher 25.
Use ai.text.embed.providers() instead.
|
Syntax |
|
||
Description |
Lists the available vector embedding providers. |
||
Return arguments |
Name |
Type |
Description |
|
|
The name of the GenAI provider. |
|
|
|
The signature of the required config map. |
|
|
|
The signature of the optional config map. |
|
|
|
The default values for the GenAI provider. |
|
For current provider details and examples, see Embeddings → Providers.