Optional
clientOptional
collectionOptional
collectionEmbeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Optional
filterOptional
indexOptional
numAdds 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.
Optional
options: { Optional. An object containing an array of ids
for the documents.
Optional
ids?: 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.
Optional
options: { Optional. An object containing an array of ids
for the vectors.
Optional
ids?: 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.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<Chroma>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: WhereOptional filter criteria to limit the items retrieved based on the specified filter type.
Optional
callbacks: CallbacksOptional callbacks that may be triggered at specific stages of the retrieval process.
Optional
tags: string[]Tags to categorize or label the VectorStoreRetriever
. Defaults to an empty array if not provided.
Optional
metadata: Record<string, unknown>Additional metadata as key-value pairs to add contextual information for the retrieval process.
Optional
verbose: 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.
Optional
maxReturn 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.
Optional
k: numberNumber of similar results to return. Defaults to 4.
Optional
filter: 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.
Optional
filter: 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.
Optional
k: numberNumber of similar results to return. Defaults to 4.
Optional
filter: 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.
Static
fromCreates 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.
Static
fromCreates 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.
Static
fromCreates 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/community
andchromadb
.Constructor args
Instantiate
Add documents
Delete documents
Similarity search
Similarity search with filter
Similarity search with score
As a retriever