Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Vectara provides a way to add documents directly via their API. This API handles pre-processing and chunking internally in an optimal manner. This method is a wrapper to utilize that API within LangChain.
An array of VectaraFile objects representing the files and their respective file names to be uploaded to Vectara.
A Promise that resolves to the number of successfully uploaded files.
Creates a VectorStoreRetriever
instance with flexible configuration options.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<VectaraStore>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: VectaraFilterOptional 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.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.
Performs a similarity search and returns documents.
The query string for the similarity search.
Optional
k: numberOptional. The number of results to return. Default is 10.
Optional
filter: VectaraFilterOptional. A VectaraFilter object to refine the search results.
A Promise that resolves to an array of Document objects.
Throws an error, as this method is not implemented. Use similaritySearch or similaritySearchWithScore instead.
Not used.
Not used.
Optional
_filter: VectaraFilterNot used.
Does not return a value.
Performs a similarity search and returns documents along with their scores.
The query string for the similarity search.
Optional
k: numberOptional. The number of results to return. Default is 10.
Optional
filter: VectaraFilterOptional. A VectaraFilter object to refine the search results.
A Promise that resolves to an array of tuples, each containing a Document and its score.
Performs a Vectara API call based on the arguments provided.
The query string for the similarity search.
Optional. The number of results to return. Default is 10.
A Promise that resolves to an array of tuples, each containing a Document and its score.
Static
fromCreates a VectaraStore instance from documents.
An array of Document objects.
Not used.
A VectaraLibArgs object for initializing the VectaraStore instance.
A Promise that resolves to a VectaraStore instance.
Static
fromCreates a VectaraStore instance from texts.
An array of text strings.
Metadata for the texts. Can be a single object or an array of objects.
Not used.
A VectaraLibArgs object for initializing the VectaraStore instance.
A Promise that resolves to a VectaraStore instance.
Class for interacting with the Vectara API. Extends the VectorStore class.