OptionalclientOptionalcollectionOptionalcollectionEmbeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
OptionalfilterOptionalindexOptionalnumAdds documents to the Chroma database. The documents are first
converted to vectors using the embeddings instance, and then added to
the database.
An array of Document instances to be added to the database.
Optionaloptions: { Optional. An object containing an array of ids for the documents.
Optionalids?: string[]A promise that resolves when the documents have been added to the database.
Adds vectors to the Chroma database. The vectors are associated with the provided documents.
An array of vectors to be added to the database.
An array of Document instances associated with the vectors.
Optionaloptions: { Optional. An object containing an array of ids for the vectors.
Optionalids?: string[]A promise that resolves with an array of document IDs when the vectors have been added to the database.
Creates a VectorStoreRetriever instance with flexible configuration options.
OptionalkOrFields: number | Partial<VectorStoreRetrieverInput<Chroma>>If a number is provided, it sets the k parameter (number of items to retrieve).
Optionalfilter: WhereOptional filter criteria to limit the items retrieved based on the specified filter type.
Optionalcallbacks: CallbacksOptional callbacks that may be triggered at specific stages of the retrieval process.
Optionaltags: string[]Tags to categorize or label the VectorStoreRetriever. Defaults to an empty array if not provided.
Optionalmetadata: Record<string, unknown>Additional metadata as key-value pairs to add contextual information for the retrieval process.
Optionalverbose: booleanIf true, enables detailed logging for the retrieval process. Defaults to false.
VectorStoreRetriever instance based on the provided parameters.Deletes documents from the Chroma database. The documents to be deleted
can be specified by providing an array of ids or a filter object.
An object containing either an array of ids of the documents to be deleted or a filter object to specify the documents to be deleted.
A promise that resolves when the specified documents have been deleted from the database.
OptionalmaxReturn documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.
Text to look up documents similar to.
Searches for documents similar to a text query by embedding the query and performing a similarity search on the resulting vector.
Text query for finding similar documents.
Optionalk: numberNumber of similar results to return. Defaults to 4.
Optionalfilter: WhereOptional filter based on FilterType.
Optional_callbacks: CallbacksOptional callbacks for monitoring search progress
A promise resolving to an array of DocumentInterface instances representing similar documents.
Searches for vectors in the Chroma database that are similar to the
provided query vector. The search can be filtered using the provided
filter object or the filter property of the Chroma instance.
The query vector.
The number of similar vectors to return.
Optionalfilter: WhereOptional. A filter object to filter the search results.
A promise that resolves with an array of tuples, each containing a Document instance and a similarity score.
Searches for documents similar to a text query by embedding the query, and returns results with similarity scores.
Text query for finding similar documents.
Optionalk: numberNumber of similar results to return. Defaults to 4.
Optionalfilter: WhereOptional filter based on FilterType.
Optional_callbacks: CallbacksOptional callbacks for monitoring search progress
A promise resolving to an array of tuples, each containing a document and its similarity score.
StaticfromCreates a new Chroma instance from an array of Document instances.
The documents are added to the Chroma database.
An array of Document instances.
An Embeddings instance used to generate embeddings for the documents.
A ChromaLibArgs object containing the configuration for the Chroma database.
A promise that resolves with a new Chroma instance.
StaticfromCreates a new Chroma instance from an existing collection in the
Chroma database.
An Embeddings instance used to generate embeddings for the documents.
A ChromaLibArgs object containing the configuration for the Chroma database.
A promise that resolves with a new Chroma instance.
StaticfromCreates a new Chroma instance from an array of text strings. The text
strings are converted to Document instances and added to the Chroma
database.
An array of text strings.
An array of metadata objects or a single metadata object. If an array is provided, it must have the same length as the texts array.
An Embeddings instance used to generate embeddings for the documents.
A ChromaLibArgs object containing the configuration for the Chroma database.
A promise that resolves with a new Chroma instance.
Chroma vector store integration.
Setup: Install
@langchain/communityandchromadb.Constructor args
Instantiate
Add documents
Delete documents
Similarity search
Similarity search with filter
Similarity search with score
As a retriever