diff --git a/modules/ROOT/content-nav.adoc b/modules/ROOT/content-nav.adoc index e07c65db3..a8e62af55 100644 --- a/modules/ROOT/content-nav.adoc +++ b/modules/ROOT/content-nav.adoc @@ -107,7 +107,6 @@ ** xref:functions/user-defined.adoc[] ** xref:functions/vector.adoc[] -* xref:genai-integrations.adoc[] * xref:indexes/index.adoc[] ** xref:indexes/search-performance-indexes/index.adoc[] *** xref:indexes/search-performance-indexes/managing-indexes.adoc[] diff --git a/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc b/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc index 04bf0de57..ad25166ef 100644 --- a/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc +++ b/modules/ROOT/pages/appendix/gql-conformance/additional-cypher.adoc @@ -186,19 +186,6 @@ REMOVE n:$($label) |=== -[[genai-functions]] -=== GenAI functions - -[options="header", cols="2a,5a"] -|=== -| Cypher feature -| Description - -| xref:genai-integrations.adoc#single-embedding[`genai.vector.encode()`] -| Generates a vector embedding for a single value. - -|=== - [[graph-functions]] === Graph functions diff --git a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc index 80e6827c3..112cc886b 100644 --- a/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc +++ b/modules/ROOT/pages/deprecations-additions-removals-compatibility.adoc @@ -41,7 +41,7 @@ label:new[] VECTOR([1.05, 0.123, 5], 3, FLOAT32 NOT NULL) ---- -a| Introduced a `VECTOR` value type that can be stored as xref:indexes/semantic-indexes/vector-indexes.adoc#embeddings[embedding] properties on nodes and relationships and utilized for efficient semantic retrieval using Neo4j's xref:indexes/semantic-indexes/vector-indexes.adoc[vector indexes] and xref:genai-integrations.adoc[GenAI plugin]. +a| Introduced a `VECTOR` value type that can be stored as xref:indexes/semantic-indexes/vector-indexes.adoc#embeddings[embedding] properties on nodes and relationships and utilized for efficient semantic retrieval using Neo4j's xref:indexes/semantic-indexes/vector-indexes.adoc[vector indexes] and link:https://neo4j.com/docs/genai/plugin/[GenAI plugin]. For more information, see xref:values-and-types/vector.adoc[Values and types -> Vectors]. a| @@ -1780,7 +1780,7 @@ label:new[] * `"textembedding-gecko@003"` * `"textembedding-gecko-multilingual@001"` -| Added support for additional xref:genai-integrations.adoc#ai-providers[Vertex AI] vector encoding models. +| Added support for more Vertex AI vector encoding models in link:https://neo4j.com/docs/genai/plugin/current/[GenAI plugin]. Also added support for Vertex AI `taskType` and `title` embedding parameters. |=== diff --git a/modules/ROOT/pages/functions/index.adoc b/modules/ROOT/pages/functions/index.adoc index fdba301a4..677afe4fd 100644 --- a/modules/ROOT/pages/functions/index.adoc +++ b/modules/ROOT/pages/functions/index.adoc @@ -88,17 +88,6 @@ Database functions provide information about databases. |=== - -[[header-query-functions-genai]] -== GenAI functions - -[options="header"] -|=== -| Function | Signature | Description -1.1+| xref:genai-integrations.adoc#single-embedding[`genai.vector.encode()`] | `genai.vector.encode(resource :: STRING, provider :: STRING, configuration :: MAP = {}) :: LIST` | Encode a given resource as a vector using the named provider. -|=== - - [[header-query-functions-graph]] == Graph functions diff --git a/modules/ROOT/pages/genai-integrations.adoc b/modules/ROOT/pages/genai-integrations.adoc deleted file mode 100644 index 8d215459c..000000000 --- a/modules/ROOT/pages/genai-integrations.adoc +++ /dev/null @@ -1,545 +0,0 @@ -:description: Information about Neo4j's GenAI integrations. -:test-setup-dump: https://github.com/neo4j-graph-examples/recommendations/raw/main/data/recommendations-5.26-block.dump -include::https://raw.githubusercontent.com/neo4j-graphacademy/courses/main/asciidoc/courses/llm-fundamentals/ad.adoc[] - -[[genai-integrations]] -= GenAI integrations - - -Neo4j's xref:indexes/semantic-indexes/vector-indexes.adoc[] and xref:functions/vector.adoc[] allow you to calculate the similarity between node and relationship properties in a graph. -A prerequisite for using these features is that vector embeddings have been set as properties of these entities. -The GenAI plugin enables the creation of such embeddings using GenAI providers. - -To use the GenAI plugin you need an account and API credentials from any of the following GenAI providers: xref:genai-integrations.adoc#vertex-ai[], xref:genai-integrations.adoc#openai[], xref:genai-integrations.adoc#azure-openai[], and xref:genai-integrations.adoc#amazon-bedrock[]. - -To learn more about using embeddings in Neo4j, see xref:indexes/semantic-indexes/vector-indexes.adoc#embeddings[Vector indexes -> Vectors and embeddings in Neo4j]. - -For a hands-on guide on how to use the GenAI plugin, see link:https://neo4j.com/docs/genai/tutorials/embeddings-vector-indexes/[GenAI documentation - Embeddings & Vector Indexes Tutorial -> Create embeddings with cloud AI providers]. - -== Installation - -The GenAI plugin is enabled by default in Neo4j Aura. - -The plugin needs to be installed on self-managed instances. -This is done by moving the `neo4j-genai.jar` file from `/products` to `/plugins` in the Neo4j home directory, or, if you are using Docker, by starting the Docker container with the extra parameter `--env NEO4J_PLUGINS='["genai"]'`. -For more information, see link:{neo4j-docs-base-uri}/operations-manual/current/configuration/plugins/[Operations Manual -> Configure plugins]. - - -[[example-graph]] -== Example graph - -The examples on this page use the link:https://github.com/neo4j-graph-examples/recommendations[Neo4j movie recommendations] dataset, focusing on the `plot` and `title` properties of `Movie` nodes. - -image::genai-graph.svg[Example graph connecting person and actor nodes with a movie node via acted in and directed relationships,width=600,role=popup] - -The graph contains 28863 nodes and 332522 relationships. -There are 9083 `Movie` nodes with a `plot` and `title` property. -To recreate the graph, - -- For Aura or Enterprise Edition, import link:https://github.com/neo4j-graph-examples/recommendations/raw/main/data/recommendations-5.26-block.dump[this dump file] into an empty database. -- For self-hosted Community Edition, import link:https://github.com/neo4j-graph-examples/recommendations/raw/main/data/recommendations-5.26.dump[this dump file] into an empty database. - -To learn how to import dumps, see link:{neo4j-docs-base-uri}/aura/classic/auradb/importing/import-database/[Aura -> Importing an existing database] or link:{neo4j-docs-base-uri}/operations-manual/current/backup-restore/restore-dump/[Operations manual -> Restore a database dump]. - -[NOTE] -The embeddings on this page are generated using link:https://platform.openai.com/docs/guides/embeddings[OpenAI] (model `text-embedding-ada-002`), producing 1536-dimensional vectors. - -[[single-embedding]] -== Generate a single embedding and store it - -Use the `genai.vector.encode()` function to generate a vector embedding for a single value. - -.Signature for `genai.vector.encode()` label:function[] -[source,syntax] ----- -genai.vector.encode(resource :: STRING, provider :: STRING, configuration :: MAP = {}) :: LIST ----- - -* The `resource` (a `STRING`) is the object to transform into an embedding, such as a chunk text or a node/relationship property. -* The `provider` (a `STRING`) is the case-insensitive identifier of the provider to use. -See identifiers under xref:genai-integrations.adoc#ai-providers[] for supported options. -* The `configuration` (a `MAP`) contains provider-specific settings, such as which model to invoke, as well as any required API credentials. -See xref:genai-integrations.adoc#ai-providers[] for details of each supported provider. -Note that because this argument may contain sensitive data, it is obfuscated in the link:https://neo4j.com/docs/operations-manual/current/monitoring/logging/[query.log]. -However, if the function call is misspelled or the query is otherwise malformed, it may be logged without being obfuscated. - -[NOTE] -This function sends one API request every time it is called, which may result in a lot of overhead in terms of both network traffic and latency. -If you want to generate many embeddings at once, use xref:genai-integrations.adoc#multiple-embeddings[]. - - -[.tabbed-example] -==== -[.include-with-Store-embedding-as-a-vector] -====== - -`genai.vector.encode()` returns a `LIST`. -To convert and store this value as a xref:values-and-types/vector.adoc[`VECTOR`], use the xref:functions/vector.adoc#functions-vector[`vector()`] function. -Storing `VECTOR` values on an on-prem instance requires Enterprise Edition and link:{neo4j-docs-base-uri}/operations-manual/current/database-internals/store-formats/#store-format-overview[block format]. - -.Create a `VECTOR` embedding property for the Godfather -[source,cypher] ----- -MATCH (m:Movie {title:'Godfather, The'}) -WHERE m.plot IS NOT NULL AND m.title IS NOT NULL -WITH m, m.title || ' ' || m.plot AS titleAndPlot // <1> -WITH m, genai.vector.encode(titleAndPlot, 'OpenAI', { token: $openaiToken }) AS vector // <2> -SET m.embedding = vector(vector, 1536, FLOAT32) // <3> -RETURN m.embedding AS embedding ----- - -<1> Concatenate the `title` and `plot` of the `Movie` into a single `STRING`. -<2> Create a 1536 dimensional embedding from the `titleAndPlot`. -<3> Store the `propertyVector` as a new vector `embedding` property on The Godfather node. - -.Result -[source] ----- -+----------------------------------------------------------------------------------------------------+ -| embedding | -+----------------------------------------------------------------------------------------------------+ -| [0.005239539314061403, -0.039358530193567276, -0.0005175105179660022, -0.038706034421920776, ... ] | -+----------------------------------------------------------------------------------------------------+ ----- - -[NOTE] -This result only shows the first 4 of the 1536 numbers in the embedding. - - -====== - - -[.include-with-Store-embedding-as-a-list] -====== - -Use the `db.create.setNodeVectorProperty` procedure to store an embedding as a `LIST` value to a node property. - -.Signature for `db.create.setNodeVectorProperty()` label:procedure[] -[source,syntax] ----- -db.create.setNodeVectorProperty(node :: NODE, key :: STRING, vector :: ANY) ----- - -Use the `db.create.setRelationshipVectorProperty` procedure to store an embedding as a `LIST` value to a relationship property. - -.Signature for `db.create.setRelationshipVectorProperty()` label:procedure[] -[source,syntax] ----- -db.create.setRelationshipVectorProperty(relationship :: RELATIONSHIP, key :: STRING, vector :: ANY) ----- - -* `node` or `relationship` is the entity in which the new property will be stored. -* `key` (a `STRING`) is the name of the new property containing the embedding. -* `vector` is the object containing the embedding. - -The embeddings are stored as properties on nodes or relationships with the type `LIST`. - -.Create a `LIST` embedding property for the Godfather -[source,cypher] ----- -MATCH (m:Movie {title:'Godfather, The'}) -WHERE m.plot IS NOT NULL AND m.title IS NOT NULL -WITH m, m.title || ' ' || m.plot AS titleAndPlot // <1> -WITH m, genai.vector.encode(titleAndPlot, 'OpenAI', { token: $openaiToken }) AS vector // <2> -CALL db.create.setNodeVectorProperty(m, 'embedding', vector) // <3> -RETURN m.embedding AS embedding ----- - -<1> Concatenate the `title` and `plot` of the `Movie` into a single `STRING`. -<2> Create a 1536 dimensional embedding from the `titleAndPlot`. -<3> Store the `propertyVector` as a new `LIST `embedding` property on The Godfather node. - -.Result -[source, "queryresult"] ----- -+----------------------------------------------------------------------------------------------------+ -| embedding | -+----------------------------------------------------------------------------------------------------+ -| [0.005239539314061403, -0.039358530193567276, -0.0005175105179660022, -0.038706034421920776, ... ] | -+----------------------------------------------------------------------------------------------------+ ----- - -[NOTE] -This result only shows the first 4 of the 1536 numbers in the embedding. - -====== -==== - - -[[multiple-embeddings]] -== Generate a batch of embeddings and store them - -Use the `genai.vector.encodeBatch()` procedure to generate many vector embeddings with a single API request. -This procedure takes a list of resources as an input, and returns the same number of result rows, instead of a single one. - -[NOTE] -This procedure attempts to generate embeddings for all supplied resources in a single API request. -Therefore, it is recommended to see the respective provider's documentation for details on, for example, the maximum number of embeddings that can be generated per request. - -.Signature for `genai.vector.encodeBatch()` label:procedure[] -[source,syntax] ----- -genai.vector.encodeBatch(resources :: LIST, provider :: STRING, configuration :: MAP = {}) :: (index :: INTEGER, resource :: STRING, vector :: LIST) ----- - -* The `resources` (a `LIST`) parameter is the list of objects to transform into embeddings, such as chunks of text. -* The `provider` (a `STRING`) is the case-insensitive identifier of the provider to use. -See xref:genai-integrations.adoc#ai-providers[] for supported options. -* The `configuration` (a `MAP`) specifies provider-specific settings such as which model to invoke, as well as any required API credentials. -See xref:genai-integrations.adoc#ai-providers[] for details of each supported provider. -Note that because this argument may contain sensitive data, it is obfuscated in the link:https://neo4j.com/docs/operations-manual/current/monitoring/logging/[query.log]. -However, if the function call is misspelled or the query is otherwise malformed, it may be logged without being obfuscated. - -Each returned row contains the following columns: - -* The `index` (an `INTEGER`) is the index of the corresponding element in the input list, to aid in correlating results back to inputs. -* The `resource` (a `STRING`) is the name of the input resource. -* The `vector` (a `LIST`) is the generated vector embedding for this resource. - - - -[.tabbed-example] -==== -[.include-with-Store-embeddings-as-vectors] -====== - -`genai.vector.encode()` returns a `LIST`. -To convert and store this value as a xref:values-and-types/vector.adoc[`VECTOR`], use the xref:functions/vector.adoc#functions-vector[`vector()`] function. -Storing `VECTOR` values on an on-prem instance requires Enterprise Edition and link:{neo4j-docs-base-uri}/operations-manual/current/database-internals/store-formats/#store-format-overview[block format]. - -.Create embeddings from a limited number of properties and store them as `VECTOR` properties -[source,cypher] ----- -MATCH (m:Movie WHERE m.plot IS NOT NULL) -WITH m -LIMIT 20 -WITH collect(m) AS moviesList // <1> -WITH moviesList, [movie IN moviesList | movie.title || ': ' || movie.plot] AS batch // <2> -CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector -WITH moviesList, index, vector -MATCH (toUpdate:Movie {title: moviesList[index]['title']}) -SET toUpdate.embedding = vector(vector, 1536, FLOAT32) // <3> ----- - -<1> xref:functions/aggregating.adoc#functions-collect[Collect] all 20 `Movie` nodes into a `LIST`. -<2> A xref:expressions/list-expressions.adoc#list-comprehension[list comprehension] (`[]`) extracts the `title` and `plot` properties of the movies in `moviesList` into a new `LIST`. -<3> `db.create.setNodeVectorProperty` is run for each `vector` returned by `genai.vector.encodeBatch()`, and stores that vector as a property named `embedding` on the corresponding node. - -.Create embeddings from a large number properties and store them as `VECTOR` properties -[source, cypher] ----- -MATCH (m:Movie WHERE m.plot IS NOT NULL) -WITH collect(m) AS moviesList, // <1> - count(*) AS total, - 100 AS batchSize // <2> -UNWIND range(0, total-1, batchSize) AS batchStart // <3> -CALL (moviesList, batchStart, batchSize) { // <4> - WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS batch // <5> - CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector - MATCH (toUpdate:Movie {title: moviesList[batchStart + index]['title']}) - SET toUpdate.embedding = vector(vector, 1536, FLOAT32) // <6> -} IN CONCURRENT TRANSACTIONS OF 1 ROW // <7> ----- - -<1> xref:functions/aggregating.adoc#functions-collect[Collect] all returned `Movie` nodes into a `LIST`. -<2> `batchSize` defines the number of nodes in `moviesList` to be processed at once. -Because vector embeddings can be very large, a larger batch size may require significantly more memory on the Neo4j server. -Too large a batch size may also exceed the provider's threshold. -<3> Process `Movie` nodes in increments of `batchSize`. -The end range `total-1` is due to `range` being inclusive on both ends. -<4> A xref:subqueries/subqueries-in-transactions.adoc[`CALL` subquery] executes a separate transaction for each batch. -Note that this `CALL` subquery uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]. -<5> `batch` is a list of strings, each being the concatenation of `title` and `plot` of one movie. -<6> The procedure sets `vector` as value for the property named `embedding` for the node at position `batchStart + index` in the `moviesList`. -<7> Set to `1` the amount of batches to be processed at once. -For more information on concurrency in transactions, see xref:subqueries/subqueries-in-transactions.adoc#concurrent-transactions[`CALL` subqueries -> Concurrent transactions]). - -[NOTE] -This example may not scale to larger datasets, as `collect(m)` requires the whole result set to be loaded in memory. -For an alternative method more suitable to processing large amounts of data, see link:https://neo4j.com/docs/genai/tutorials/embeddings-vector-indexes/[GenAI documentation - Embeddings & Vector Indexes Tutorial -> Create embeddings with cloud AI providers]. - -====== - - -[.include-with-Store-embeddings-as-lists] -====== - -Use the `db.create.setNodeVectorProperty` procedure to store an embedding as a `LIST` value to a node property. - -.Signature for `db.create.setNodeVectorProperty` label:procedure[] -[source,syntax] ----- -db.create.setNodeVectorProperty(node :: NODE, key :: STRING, vector :: ANY) ----- - -Use the `db.create.setRelationshipVectorProperty` procedure to store an embedding as a `LIST` value to a relationship property. - -.Signature for `db.create.setRelationshipVectorProperty` label:procedure[] -[source,syntax] ----- -db.create.setRelationshipVectorProperty(relationship :: RELATIONSHIP, key :: STRING, vector :: ANY) ----- - -* `node` or `relationship` is the entity in which the new property will be stored. -* `key` (a `STRING`) is the name of the new property containing the embedding. -* `vector` is the object containing the embedding. - -The embeddings are stored as properties on nodes or relationships with the type `LIST`. - -.Create embeddings from a limited number of properties and store them as `LIST` properties -[source, cypher] ----- -MATCH (m:Movie WHERE m.plot IS NOT NULL) -WITH m -LIMIT 20 -WITH collect(m) AS moviesList // <1> -WITH moviesList, [movie IN moviesList | movie.title || ': ' || movie.plot] AS batch // <2> -CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector -WITH moviesList, index, vector -CALL db.create.setNodeVectorProperty(moviesList[index], 'embedding', vector) // <3> ----- - -<1> xref:functions/aggregating.adoc#functions-collect[Collect] all 20 `Movie` nodes into a `LIST`. -<2> A xref:expressions/list-expressions.adoc#list-comprehension[list comprehension] (`[]`) extracts the `title` and `plot` properties of the movies in `moviesList` into a new `LIST`. -<3> `db.create.setNodeVectorProperty` is run for each `vector` returned by `genai.vector.encodeBatch()`, and stores that vector as a property named `embedding` on the corresponding node. - -.Create embeddings from a large number properties and store them as `LIST` values -[source, cypher] ----- -MATCH (m:Movie WHERE m.plot IS NOT NULL) -WITH collect(m) AS moviesList, // <1> - count(*) AS total, - 100 AS batchSize // <2> -UNWIND range(0, total-1, batchSize) AS batchStart // <3> -CALL (moviesList, batchStart, batchSize) { // <4> - WITH [movie IN moviesList[batchStart .. batchStart + batchSize] | movie.title || ': ' || movie.plot] AS batch // <5> - CALL genai.vector.encodeBatch(batch, 'OpenAI', { token: $openaiToken }) YIELD index, vector - CALL db.create.setNodeVectorProperty(moviesList[batchStart + index], 'embedding', vector) // <6> -} IN CONCURRENT TRANSACTIONS OF 1 ROW // <7> ----- - -<1> xref:functions/aggregating.adoc#functions-collect[Collect] all returned `Movie` nodes into a `LIST`. -<2> `batchSize` defines the number of nodes in `moviesList` to be processed at once. -Because vector embeddings can be very large, a larger batch size may require significantly more memory on the Neo4j server. -Too large a batch size may also exceed the provider's threshold. -<3> Process `Movie` nodes in increments of `batchSize`. -The end range `total-1` is due to `range` being inclusive on both ends. -<4> A xref:subqueries/subqueries-in-transactions.adoc[`CALL` subquery] executes a separate transaction for each batch. -Note that this `CALL` subquery uses a xref:subqueries/call-subquery.adoc#variable-scope-clause[variable scope clause]. -<5> `batch` is a list of strings, each being the concatenation of `title` and `plot` of one movie. -<6> The procedure sets `vector` as value for the property named `embedding` for the node at position `batchStart + index` in the `moviesList`. -<7> Set to `1` the amount of batches to be processed at once. -For more information on concurrency in transactions, see xref:subqueries/subqueries-in-transactions.adoc#concurrent-transactions[`CALL` subqueries -> Concurrent transactions]). - -[NOTE] -This example may not scale to larger datasets, as `collect(m)` requires the whole result set to be loaded in memory. -For an alternative method more suitable to processing large amounts of data, see link:https://neo4j.com/docs/genai/tutorials/embeddings-vector-indexes/[GenAI documentation - Embeddings & Vector Indexes Tutorial -> Create embeddings with cloud AI providers]. - -====== -==== - -[[ai-providers]] -== GenAI providers - -The following GenAI providers are supported for generating vector embeddings. -Each provider has its own configuration map that can be passed to `genai.vector.encode()` or `genai.vector.encodeBatch()`. - -[[vertex-ai]] -=== Vertex AI - -* Identifier (`provider` argument): `"VertexAI"` -* https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings[Official Vertex AI documentation] - -.Configuration map -[%header,cols="1m,1m,3a,2"] -|=== -| Key | Type | Description | Default - -| token -| STRING -| API access token. -| label:required[] - -| projectId -| STRING -| GCP project ID. -| label:required[] - -| model -| STRING -| The name of the model you want to invoke. + - + -Supported values: + - + - -* `"textembedding-gecko@001"` -* `"textembedding-gecko@002"` -* `"textembedding-gecko@003"` -* `"textembedding-gecko-multilingual@001"` - - -| `"textembedding-gecko@001"` - -| region -| STRING -| GCP region where to send the API requests. + - + -Supported values: + - + - -* `"us-west1"` -* `"us-west2"` -* `"us-west3"` -* `"us-west4"` -* `"us-central1"` -* `"us-east1"` -* `"us-east4"` -* `"us-south1"` -* `"northamerica-northeast1"` -* `"northamerica-northeast2"` -* `"southamerica-east1"` -* `"southamerica-west1"` -* `"europe-west2"` -* `"europe-west1"` -* `"europe-west4"` -* `"europe-west6"` -* `"europe-west3"` -* `"europe-north1"` -* `"europe-central2"` -* `"europe-west8"` -* `"europe-west9"` -* `"europe-southwest1"` -* `"asia-south1"` -* `"asia-southeast1"` -* `"asia-southeast2"` -* `"asia-east2"` -* `"asia-east1"` -* `"asia-northeast1"` -* `"asia-northeast2"` -* `"australia-southeast1"` -* `"australia-southeast2"` -* `"asia-northeast3"` -* `"me-west1"` -| `"us-central1"` - -| taskType -| STRING -| The intended downstream application (see link:https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings/[provider documentation]). The specified `taskType` will apply to all resources in a batch. -| - -| title -| STRING -| The title of the document that is being encoded (see link:https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings/[provider documentation]). The specified `title` will apply to all resources in a batch. -| -|=== - -[[openai]] -=== OpenAI - -* Identifier (`provider` argument): `"OpenAI"` -* https://platform.openai.com/docs/guides/embeddings[Official OpenAI documentation] - -.Configuration map -[%header,cols="1m,1m,3a,2"] -|=== -| Key | Type | Description | Default - -| token -| STRING -| API access token. -| label:required[] - -| model -| STRING -| The name of the model you want to invoke. -| `"text-embedding-ada-002"` - -| dimensions -| INTEGER -| The number of dimensions you want to reduce the vector to. Only supported for certain models. -| Model-dependent. -|=== - - -[[azure-openai]] - -=== Azure OpenAI - -* Identifier (`provider` argument): `"AzureOpenAI"` -* https://learn.microsoft.com/en-us/azure/ai-foundry/[Official Azure OpenAI documentation] - -[NOTE] -Unlike the other providers, the model is configured when creating the deployment on Azure, and is thus not part of the configuration map. - -.Configuration map -[%header,cols="1m,1m,3a,2"] -|=== -| Key | Type | Description | Default - -| token -| STRING -| API access token. -| label:required[] - -| resource -| STRING -| The name of the resource to which the model has been deployed. -| label:required[] - -| deployment -| STRING -| The name of the model deployment. -| label:required[] - -| dimensions -| INTEGER -| The number of dimensions you want to reduce the vector to. Only supported for certain models. -| Model-dependent. -|=== - -[[amazon-bedrock]] -=== Amazon Bedrock - -* Identifier (`provider` argument): `"Bedrock"` -* https://docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html[Official Bedrock documentation] - -.Configuration map -[%header,cols="1m,1m,3a,2"] -|=== -| Key | Type | Description | Default - -| accessKeyId -| STRING -| AWS access key ID. -| label:required[] - -| secretAccessKey -| STRING -| AWS secret key. -| label:required[] - -| model -| STRING -| The name of the model you want to invoke. + - + -Supported values: + - + - -* `"amazon.titan-embed-text-v1"` -| `"amazon.titan-embed-text-v1"` - -| region -| STRING -| AWS region where to send the API requests. + - + -Supported values: + - + - -* `"us-east-1"` -* `"us-west-2"` -* `"ap-southeast-1"` -* `"ap-northeast-1"` -* `"eu-central-1"` -| `"us-east-1"` - -|=== diff --git a/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc b/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc index 5107b6b00..570b1c190 100644 --- a/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc +++ b/modules/ROOT/pages/indexes/semantic-indexes/vector-indexes.adoc @@ -47,7 +47,7 @@ As of Neo4j 2025.10, they can also be more efficiently stored as xref:values-and ==== For information about how embeddings can be generated and stored as properties, see: -* xref:genai-integrations.adoc[] +* link:https://neo4j.com/docs/genai/plugin/current/embeddings/[GenAI documentation -> Create and store embeddings in a Neo4j database] * link:https://neo4j.com/docs/genai/tutorials/embeddings-vector-indexes/[GenAI documentation -> Embeddings & Vector Indexes Tutorial] ==== diff --git a/modules/ROOT/pages/values-and-types/vector.adoc b/modules/ROOT/pages/values-and-types/vector.adoc index 8f71b969c..a0f753fe4 100644 --- a/modules/ROOT/pages/values-and-types/vector.adoc +++ b/modules/ROOT/pages/values-and-types/vector.adoc @@ -2,7 +2,7 @@ :description: Create and store vectors (embeddings) as properties on nodes and relationships, and use them for efficient semantic retrieval with vector indexes and the GenAI plugin. :page-role: new-neo4j-2025.10 -`VECTOR` values can be created and stored as xref:indexes/semantic-indexes/vector-indexes.adoc#embeddings[embedding] properties on nodes and relationships, and used for efficient semantic retrieval using xref:indexes/semantic-indexes/vector-indexes.adoc[vector indexes] and the xref:genai-integrations.adoc[GenAI plugin]. +`VECTOR` values can be created and stored as xref:indexes/semantic-indexes/vector-indexes.adoc#embeddings[embedding] properties on nodes and relationships, and used for efficient semantic retrieval using xref:indexes/semantic-indexes/vector-indexes.adoc[vector indexes] and the link:https://neo4j.com/docs/genai/plugin/current/[GenAI plugin]. `VECTOR` values can also be measured and compared (in terms of similarity, distance, and norm) using xref:functions/vector.adoc[vector functions]. @@ -265,7 +265,4 @@ Moreover, reducing a vector's coordinate type (e.g., from `INTEGER16` to `INTEGE [TIP] You can convert vectors into lists via the functions xref:functions/list.adoc#functions-tointegerlist[`toIntegerList()`] and xref:functions/list.adoc#functions-tofloatlist[`toFloatList()`]. -For information about how to store embeddings as `VECTOR` values with the xref:genai-integrations.adoc[GenAI plugin], see: - -* xref:genai-integrations.adoc#single-embedding[Generate a single embedding and store it] -* xref:genai-integrations.adoc#multiple-embeddings[Generate multiple embeddings and store them] +For information about how to store embeddings as `VECTOR` values with the GenAI plugin, see link:https://neo4j.com/docs/genai/plugin/current/embeddings/[GenAI documentation -> Create and store embeddings in a Neo4j database].