Class Neo4jVectorStore
java.lang.Object
org.springframework.ai.vectorstore.Neo4jVectorStore
- All Implemented Interfaces:
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
Modifier 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. -
Constructor Summary
ConstructorDescriptionNeo4jVectorStore
(org.neo4j.driver.Driver driver, EmbeddingClient embeddingClient, Neo4jVectorStore.Neo4jVectorStoreConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds Documents to the vector store.void
similaritySearch
(String query) similaritySearch
(String query, int k) similaritySearch
(String query, int k, double threshold)
-
Constructor Details
-
Neo4jVectorStore
public Neo4jVectorStore(org.neo4j.driver.Driver driver, EmbeddingClient embeddingClient, Neo4jVectorStore.Neo4jVectorStoreConfig config)
-
-
Method Details
-
add
Description copied from interface:VectorStore
Adds Documents to the vector store.- Specified by:
add
in interfaceVectorStore
- Parameters:
documents
- the list of documents to store Will throw an exception if the underlying provider checks for duplicate IDs on add
-
delete
- Specified by:
delete
in interfaceVectorStore
-
similaritySearch
- Specified by:
similaritySearch
in interfaceVectorStore
-
similaritySearch
- Specified by:
similaritySearch
in interfaceVectorStore
-
similaritySearch
- Specified by:
similaritySearch
in interfaceVectorStore
- Parameters:
query
- The query to send, it will be converted to an embedding based on the configuration of the vector store.k
- the top 'k' similar resultsthreshold
- the lower bound of the similarity score- Returns:
- similar documents
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-