Class ChromaVectorStore

java.lang.Object
org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
org.springframework.ai.chroma.vectorstore.ChromaVectorStore
All Implemented Interfaces:
Consumer<List<org.springframework.ai.document.Document>>, org.springframework.ai.document.DocumentWriter, org.springframework.ai.vectorstore.VectorStore, org.springframework.ai.vectorstore.VectorStoreRetriever, org.springframework.beans.factory.InitializingBean

public class ChromaVectorStore extends org.springframework.ai.vectorstore.observation.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
    Modifier and Type
    Class
    Description
    static class 
     
  • Field Summary

    Fields inherited from class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore

    batchingStrategy, embeddingModel
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    builder(ChromaApi chromaApi, org.springframework.ai.embedding.EmbeddingModel embeddingModel)
     
    org.springframework.ai.vectorstore.observation.VectorStoreObservationContext.Builder
     
    void
    doAdd(List<org.springframework.ai.document.Document> documents)
     
    void
    doDelete(List<String> idList)
     
    protected void
    doDelete(org.springframework.ai.vectorstore.filter.Filter.Expression expression)
     
    List<org.springframework.ai.document.Document>
    doSimilaritySearch(org.springframework.ai.vectorstore.SearchRequest request)
     

    Methods inherited from class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore

    add, delete, delete, similaritySearch

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen

    Methods inherited from interface org.springframework.ai.document.DocumentWriter

    write

    Methods inherited from interface org.springframework.ai.vectorstore.VectorStore

    accept, delete, getName, getNativeClient

    Methods inherited from interface org.springframework.ai.vectorstore.VectorStoreRetriever

    similaritySearch
  • Constructor Details

    • ChromaVectorStore

      protected ChromaVectorStore(ChromaVectorStore.Builder builder)
      Parameters:
      builder - VectorStore.Builder for chroma vector store
  • Method Details

    • builder

      public static ChromaVectorStore.Builder builder(ChromaApi chromaApi, org.springframework.ai.embedding.EmbeddingModel embeddingModel)
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • doAdd

      public void doAdd(List<org.springframework.ai.document.Document> documents)
      Specified by:
      doAdd in class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
    • doDelete

      public void doDelete(List<String> idList)
      Specified by:
      doDelete in class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
    • doDelete

      protected void doDelete(org.springframework.ai.vectorstore.filter.Filter.Expression expression)
      Overrides:
      doDelete in class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
    • doSimilaritySearch

      public List<org.springframework.ai.document.Document> doSimilaritySearch(org.springframework.ai.vectorstore.SearchRequest request)
      Specified by:
      doSimilaritySearch in class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore
    • createObservationContextBuilder

      public org.springframework.ai.vectorstore.observation.VectorStoreObservationContext.Builder createObservationContextBuilder(String operationName)
      Specified by:
      createObservationContextBuilder in class org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore