Class InMemoryVectorStore
java.lang.Object
org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
org.springframework.ai.vectorstore.SimpleVectorStore
com.logicaldoc.ai.embedding.store.InMemoryVectorStore
- All Implemented Interfaces:
ExtendedVectorStore,Consumer<List<org.springframework.ai.document.Document>>,org.springframework.ai.document.DocumentWriter,org.springframework.ai.vectorstore.VectorStore
public class InMemoryVectorStore
extends org.springframework.ai.vectorstore.SimpleVectorStore
implements ExtendedVectorStore
Extended implementation of the standards
SimpleVectorStore- Since:
- 9.2.2
- Author:
- Marco Meschieri - LogicalDOC
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.ai.vectorstore.SimpleVectorStore
org.springframework.ai.vectorstore.SimpleVectorStore.EmbeddingMath, org.springframework.ai.vectorstore.SimpleVectorStore.SimpleVectorStoreBuilderNested classes/interfaces inherited from interface org.springframework.ai.vectorstore.VectorStore
org.springframework.ai.vectorstore.VectorStore.Builder<T extends org.springframework.ai.vectorstore.VectorStore.Builder<T>> -
Constructor Summary
ConstructorsConstructorDescriptionInMemoryVectorStore(org.springframework.ai.embedding.EmbeddingModel embeddingModel) -
Method Summary
Modifier and TypeMethodDescriptionintclear()Remove all embeddingsbooleanChecks the existence of a specific entry in the vector storeorg.springframework.ai.embedding.EmbeddingModelReturns theEmbeddingModelused by this storevoidvoidupdateMetadata(com.logicaldoc.core.document.Document document) Updates the metadata of all the entries that refer to the given documentMethods inherited from class org.springframework.ai.vectorstore.SimpleVectorStore
builder, createObservationContextBuilder, doAdd, doDelete, doSimilaritySearch, load, saveMethods inherited from class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
add, delete, delete, similaritySearchMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.ai.document.DocumentWriter
writeMethods inherited from interface org.springframework.ai.vectorstore.VectorStore
accept, add, delete, delete, delete, getName, getNativeClient, similaritySearch, similaritySearch
-
Constructor Details
-
InMemoryVectorStore
public InMemoryVectorStore(org.springframework.ai.embedding.EmbeddingModel embeddingModel)
-
-
Method Details
-
load
- Overrides:
loadin classorg.springframework.ai.vectorstore.SimpleVectorStore
-
exists
Description copied from interface:ExtendedVectorStoreChecks the existence of a specific entry in the vector store- Specified by:
existsin interfaceExtendedVectorStore- Parameters:
docId- Identifier of the documentfileVersion- Optional version specification- Returns:
- True only if there is at least one matching entry
-
updateMetadata
public void updateMetadata(com.logicaldoc.core.document.Document document) Description copied from interface:ExtendedVectorStoreUpdates the metadata of all the entries that refer to the given document- Specified by:
updateMetadatain interfaceExtendedVectorStore- Parameters:
document- The document to extract metadata from
-
getEmbeddingModel
public org.springframework.ai.embedding.EmbeddingModel getEmbeddingModel()Description copied from interface:ExtendedVectorStoreReturns theEmbeddingModelused by this store- Specified by:
getEmbeddingModelin interfaceExtendedVectorStore- Returns:
- the embedding model
-
clear
public int clear()Description copied from interface:ExtendedVectorStoreRemove all embeddings- Specified by:
clearin interfaceExtendedVectorStore- Returns:
- number of removed embeddings
-