class MatchingEngineA class that represents a connection to a Google Vertex AI Matching Engine instance.
The host to connect to for queries and upserts.
The version of the API functions. Part of the path.
The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.
The id for the "deployed index", which is an identifier in the index endpoint that references the index (but is not the index id)
The embeddings generated for the input texts.
Hostname for the API call
The id for the index endpoint
Region where the LLM is stored
Returns a string representing the type of vector store, which subclasses must implement to identify their specific vector storage type.
Adds an array of documents to the collection. The documents are first
converted to vectors using the embedDocuments method of the
embeddings instance.
Adds an array of vectors and corresponding documents to the collection. The vectors and documents are batch inserted into the database.
Creates a VectorStoreRetriever instance with flexible configuration options.
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 rows from the Cassandra table that match the specified WHERE clause conditions.
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.
Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.
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).
Searches for documents similar to a text query by embedding the query and performing a similarity search on the resulting vector.
Performs a similarity search on the vectors in the collection. The search is performed using the given query vector and returns the top k most similar vectors along with their corresponding documents and similarity scores.
Searches for documents similar to a text query by embedding the query, and returns results with similarity scores.
Creates an instance of AnalyticDBVectorStore from an array of texts
and corresponding metadata. The texts are first converted to Document
instances before being added to the collection.
The name of the serializable. Override to provide an alias or to preserve the serialized module name in minified environments.
Implemented as a static method to support loading logic.