Class ChromaVectorStore

java.lang.Object
com.google.genkit.plugins.chroma.ChromaVectorStore

public final class ChromaVectorStore extends Object
Chroma vector store backed by the Chroma v2 REST API.

Indexes documents (id + text + embedding + metadata) into a Chroma collection and retrieves the nearest neighbors of a query embedding.

  • Constructor Details

    • ChromaVectorStore

      public ChromaVectorStore(String baseUrl, String tenant, String database, ChromaCollectionConfig config, Embedder embedder)
      Creates a new store.
      Parameters:
      baseUrl - the Chroma server base URL (e.g. http://localhost:8000)
      tenant - the Chroma tenant
      database - the Chroma database
      config - the collection configuration
      embedder - the embedder used to vectorize documents and queries
  • Method Details

    • retrieve

      public RetrieverResponse retrieve(ActionContext context, RetrieverRequest request)
      Retrieves documents similar to the query.
      Parameters:
      context - the action context
      request - the retriever request
      Returns:
      the retriever response with matching documents
    • index

      public IndexerResponse index(ActionContext context, IndexerRequest request)
      Indexes documents into the collection, generating an embedding for each.
      Parameters:
      context - the action context
      request - the indexer request
      Returns:
      the indexer response