Class ChromaStore

java.lang.Object
dev.langchain4j.adaptiverag.ChromaStore

public final class ChromaStore extends Object
The ChromaStore class provides a singleton interface for interacting with the Chroma Embedding Store. This class is designed to be used in conjunction with an OpenAI API key to perform search operations on text segments. It abstracts the embedding model and the storage layer, offering a simple method to retrieve relevant data based on queries.
  • Method Details

    • of

      public static ChromaStore of(String openApiKey)
      Creates a new instance of ChromaStore using the provided OpenAI API key.
      Parameters:
      openApiKey - The API key to be used for authentication with OpenAI services.
      Returns:
      A new instance of ChromaStore.
    • search

      public dev.langchain4j.store.embedding.EmbeddingSearchResult<dev.langchain4j.data.segment.TextSegment> search(String query)
      Searches for text segments in the embedding index that match a given query.
      Parameters:
      query - The search query to be embedded and used for searching.
      Returns:
      An EmbeddingSearchResult containing up to one TextSegment that best matches the query.