Package com.google.genkit.plugins.chroma
Class ChromaVectorStore
java.lang.Object
com.google.genkit.plugins.chroma.ChromaVectorStore
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 Summary
ConstructorsConstructorDescriptionChromaVectorStore(String baseUrl, String tenant, String database, ChromaCollectionConfig config, Embedder embedder) Creates a new store. -
Method Summary
Modifier and TypeMethodDescriptionindex(ActionContext context, IndexerRequest request) Indexes documents into the collection, generating an embedding for each.retrieve(ActionContext context, RetrieverRequest request) Retrieves documents similar to the query.
-
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 tenantdatabase- the Chroma databaseconfig- the collection configurationembedder- the embedder used to vectorize documents and queries
-
-
Method Details
-
retrieve
Retrieves documents similar to the query.- Parameters:
context- the action contextrequest- the retriever request- Returns:
- the retriever response with matching documents
-
index
Indexes documents into the collection, generating an embedding for each.- Parameters:
context- the action contextrequest- the indexer request- Returns:
- the indexer response
-