Class ChromaVectorStore
java.lang.Object
org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
org.springframework.ai.chroma.vectorstore.ChromaVectorStore
- All Implemented Interfaces:
Consumer<List<Document>>,DocumentWriter,VectorStore,VectorStoreRetriever,org.springframework.beans.factory.InitializingBean
public class ChromaVectorStore
extends AbstractObservationVectorStore
implements org.springframework.beans.factory.InitializingBean
ChromaVectorStore is a concrete implementation of the VectorStore
interface. It is responsible for adding, deleting, and searching documents based on
their similarity to a query, using the ChromaApi and EmbeddingModel for
embedding calculations. For more information about how it does this, see the official
Chroma website.- Author:
- Christian Tzolov, Fu Cheng, Sebastien Deleuze, Soby Chacko, Thomas Vitale, Jonghoon Park
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
batchingStrategy, embeddingModel -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic ChromaVectorStore.Builderbuilder(ChromaApi chromaApi, EmbeddingModel embeddingModel) createObservationContextBuilder(String operationName) Create a newVectorStoreObservationContext.Builderinstance.voidPerform the actual add operation.voidPerform the actual delete operation.protected voiddoDelete(Filter.Expression expression) Template method for concrete implementations to provide filter-based deletion logic.doSimilaritySearch(SearchRequest request) Perform the actual similarity search operation.Methods inherited from class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
add, delete, delete, similaritySearchMethods inherited from class java.lang.Object
clone, equals, finalize, 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, delete, getName, getNativeClientMethods inherited from interface org.springframework.ai.vectorstore.VectorStoreRetriever
similaritySearch
-
Constructor Details
-
ChromaVectorStore
- Parameters:
builder-VectorStore.Builderfor chroma vector store
-
-
Method Details
-
builder
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
doAdd
Description copied from class:AbstractObservationVectorStorePerform the actual add operation.- Specified by:
doAddin classAbstractObservationVectorStore- Parameters:
documents- the documents to add
-
doDelete
Description copied from class:AbstractObservationVectorStorePerform the actual delete operation.- Specified by:
doDeletein classAbstractObservationVectorStore- Parameters:
idList- the list of document IDs to delete
-
doDelete
Description copied from class:AbstractObservationVectorStoreTemplate method for concrete implementations to provide filter-based deletion logic.- Overrides:
doDeletein classAbstractObservationVectorStore- Parameters:
expression- Filter expression to identify documents to delete
-
doSimilaritySearch
Description copied from class:AbstractObservationVectorStorePerform the actual similarity search operation.- Specified by:
doSimilaritySearchin classAbstractObservationVectorStore- Parameters:
request- the search request- Returns:
- the list of documents that match the query request conditions
-
createObservationContextBuilder
Description copied from class:AbstractObservationVectorStoreCreate a newVectorStoreObservationContext.Builderinstance.- Specified by:
createObservationContextBuilderin classAbstractObservationVectorStore- Parameters:
operationName- the operation name- Returns:
- the observation context builder
-