Method to add documents to the Weaviate index. It first generates vectors for the documents using the embeddings, then adds the vectors and documents to the index.
Array of documents to be added.
Optional
options: { Optional parameter that can include specific IDs for the documents.
Optional
ids?: string[]An array of document IDs.
Method to add vectors and corresponding documents to the Weaviate index.
Array of vectors to be added.
Array of documents corresponding to the vectors.
Optional
options: { Optional parameter that can include specific IDs for the documents.
Optional
ids?: string[]An array of document IDs.
Creates a VectorStoreRetriever
instance with flexible configuration options.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<WeaviateStore>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: WeaviateFilterOptional 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.Method to delete data from the Weaviate index. It can delete data based on specific IDs or a filter.
Object that includes either an array of IDs or a filter for the data to be deleted.
Optional
filter?: WeaviateFilterOptional
ids?: string[]Promise that resolves when the deletion is complete.
Return 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.
Optional
_callbacks: undefinedSearches 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: WeaviateFilterOptional filter based on FilterType
.
Optional
_callbacks: CallbacksOptional callbacks for monitoring search progress
A promise resolving to an array of DocumentInterface
instances representing similar documents.
Method to perform a similarity search on the stored vectors in the Weaviate index. It returns the top k most similar documents and their similarity scores.
The query vector.
The number of most similar documents to return.
Optional
filter: WeaviateFilterOptional filter to apply to the search.
An array of tuples, where each tuple contains a document and its similarity score.
Method to perform a similarity search on the stored vectors in the Weaviate index. It returns the top k most similar documents, their similarity scores and embedding vectors.
The query vector.
The number of most similar documents to return.
Optional
filter: WeaviateFilterOptional filter to apply to the search.
An array of tuples, where each tuple contains a document, its similarity score and its embedding vector.
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: WeaviateFilterOptional 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
fromStatic method to create a new WeaviateStore
instance from a list of
documents. It adds the documents to the Weaviate index.
Array of documents.
Embeddings to be used for the documents.
Arguments required to create a new WeaviateStore
instance.
A new WeaviateStore
instance.
Static
fromStatic method to create a new WeaviateStore
instance from an existing
Weaviate index.
Embeddings to be used for the Weaviate index.
Arguments required to create a new WeaviateStore
instance.
A new WeaviateStore
instance.
Static
fromStatic method to create a new WeaviateStore
instance from a list of
texts. It first creates documents from the texts and metadata, then
adds the documents to the Weaviate index.
Array of texts.
Metadata for the texts. Can be a single object or an array of objects.
Embeddings to be used for the texts.
Arguments required to create a new WeaviateStore
instance.
A new WeaviateStore
instance.
Deprecated
Prefer the
@langchain/weaviate
package.Class that extends the
VectorStore
base class. It provides methods to interact with a Weaviate index, including adding vectors and documents, deleting data, and performing similarity searches.