The host to connect to for queries and upserts.
The version of the API functions. Part of the path.
Explicitly set Google Auth credentials if you cannot get them from google auth application-default login This is useful for serverless or autoscaling environments like Fargate
The id for the "deployed index", which is an identifier in the index endpoint that references the index (but is not the index id)
Docstore that retains the document, stored by ID
Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Hostname for the API call
The id for the index
The id for the index endpoint
Region where the LLM is stored
Adds documents to the vector store, embedding them first through the
embeddings
instance.
Array of documents to embed and add.
A promise resolving to an array of document IDs or void, based on implementation.
Adds precomputed vectors and corresponding documents to the vector store.
An array of vectors representing each document.
Array of documents associated with each vector.
A promise resolving to an array of document IDs or void, based on implementation.
Creates a VectorStoreRetriever
instance with flexible configuration options.
Optional
kOrFields: number | Partial<VectorStoreRetrieverInput<MatchingEngine>>If a number is provided, it sets the k
parameter (number of items to retrieve).
Optional
filter: Restriction[]Optional 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.Create an index datapoint for the vector and document id. If an id does not exist, create it and set the document to its value.
Deletes documents from the vector store based on the specified parameters.
A promise that resolves once the deletion is complete.
For this index endpoint, figure out what API Endpoint URL and deployed
index ID should be used to do upserts and queries.
Also sets the apiEndpoint
and deployedIndexId
property for future use.
The URL
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.
Given the metadata from a document, convert it to an array of Restriction objects that may be passed to the Matching Engine and stored. The default implementation flattens any metadata and includes it as an "allowList". Subclasses can choose to convert some of these to "denyList" items or to add additional restrictions (for example, to format dates into a different structure or to add additional restrictions based on the date).
The metadata from a document
a Restriction[] (or an array of a subclass, from the FilterType)
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: Restriction[]Optional filter based on FilterType
.
Optional
_callbacks: CallbacksOptional callbacks for monitoring search progress
A promise resolving to an array of DocumentInterface
instances representing similar documents.
Performs a similarity search using a vector query and returns results along with their similarity scores.
Vector representing the search query.
Number of similar results to return.
Optional
filter: Restriction[]Optional filter based on FilterType
to restrict results.
A promise resolving to an array of tuples containing documents and their similarity scores.
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: Restriction[]Optional 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 VectorStore
instance from an array of documents, using the specified
embeddings and database configuration.
Subclasses must implement this method to define how documents are embedded and stored. Throws an error if not overridden.
A promise that resolves to a new VectorStore
instance.
Static
fromCreates a VectorStore
instance from an array of text strings and optional
metadata, using the specified embeddings and database configuration.
Subclasses must implement this method to define how text and metadata are embedded and stored in the vector store. Throws an error if not overridden.
A promise that resolves to a new VectorStore
instance.
A class that represents a connection to a Google Vertex AI Matching Engine instance.