Class Neo4jVectorStore
java.lang.Object
org.springframework.ai.vectorstore.Neo4jVectorStore
- All Implemented Interfaces:
Consumer<List<Document>>
,DocumentWriter
,VectorStore
,org.springframework.beans.factory.InitializingBean
public class Neo4jVectorStore
extends Object
implements VectorStore, org.springframework.beans.factory.InitializingBean
- Author:
- Gerrit Meier, Michael Simons
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enum to configure the distance function used in the Neo4j vector index.static final class
Configuration for the Neo4j vector store. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNeo4jVectorStore
(org.neo4j.driver.Driver driver, EmbeddingClient embeddingClient, Neo4jVectorStore.Neo4jVectorStoreConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds list ofDocument
s to the vector store.void
Deletes documents from the vector store.similaritySearch
(SearchRequest request) Retrieves documents by query embedding similarity and metadata filters to retrieve exactly the number of nearest-neighbor results that match the request criteria.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.ai.vectorstore.VectorStore
accept, similaritySearch
-
Field Details
-
DEFAULT_EMBEDDING_DIMENSION
public static final int DEFAULT_EMBEDDING_DIMENSION- See Also:
-
DEFAULT_LABEL
- See Also:
-
DEFAULT_INDEX_NAME
- See Also:
-
DEFAULT_EMBEDDING_PROPERTY
- See Also:
-
-
Constructor Details
-
Neo4jVectorStore
public Neo4jVectorStore(org.neo4j.driver.Driver driver, EmbeddingClient embeddingClient, Neo4jVectorStore.Neo4jVectorStoreConfig config)
-
-
Method Details
-
add
Description copied from interface:VectorStore
Adds list ofDocument
s to the vector store.- Specified by:
add
in interfaceVectorStore
- Parameters:
documents
- the list of documents to store. Throws an exception if the underlying provider checks for duplicate IDs.
-
delete
Description copied from interface:VectorStore
Deletes documents from the vector store.- Specified by:
delete
in interfaceVectorStore
- Parameters:
idList
- list of document ids for which documents will be removed.- Returns:
-
similaritySearch
Description copied from interface:VectorStore
Retrieves documents by query embedding similarity and metadata filters to retrieve exactly the number of nearest-neighbor results that match the request criteria.- Specified by:
similaritySearch
in interfaceVectorStore
- Parameters:
request
- Search request for set search parameters, such as the query text, topK, similarity threshold and metadata filter expressions.- Returns:
- Returns documents th match the query request conditions.
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-