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
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum to configure the distance function used in the Neo4j vector index.static final classConfiguration for the Neo4j vector store. -
Constructor Summary
ConstructorsConstructorDescriptionNeo4jVectorStore(org.neo4j.driver.Driver driver, EmbeddingClient embeddingClient, Neo4jVectorStore.Neo4jVectorStoreConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds Documents to the vector store.voidsimilaritySearch(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:VectorStoreAdds Documents to the vector store.- Specified by:
addin 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:
deletein interfaceVectorStore
-
similaritySearch
- Specified by:
similaritySearchin interfaceVectorStore
-
similaritySearch
- Specified by:
similaritySearchin interfaceVectorStore
-
similaritySearch
- Specified by:
similaritySearchin 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:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-