class VercelPostgresClass that provides an interface to a Vercel Postgres vector database. It
extends the VectorStore base class and implements methods for adding
documents and vectors and performing similarity searches.
Embeddings interface for generating vector embeddings from text queries, enabling vector-based similarity searches.
Returns a string representing the type of vector store, which subclasses must implement to identify their specific vector storage type.
Method to add documents to the vector store. It converts the documents into vectors, and adds them to the store.
Method to add vectors to the vector store. It converts the vectors into rows and inserts them into the database.
Creates a VectorStoreRetriever instance with flexible configuration options.
Deletes documents from the vector store based on the specified parameters.
Closes all the clients in the pool and terminates the pool.
Method to ensure the existence of the table in the database. It creates the table if it does not already exist.
Generates the SQL placeholders for a specific row at the provided index.
Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.
Constructs the SQL query for inserting rows into the specified table.
Searches for documents similar to a text query by embedding the query and performing a similarity search on the resulting vector.
Method to perform a similarity search in the vector store. It returns
the k most similar documents to the query vector, along with their
similarity scores.
Searches for documents similar to a text query by embedding the query, and returns results with similarity scores.
Static method to create a new VercelPostgres instance from an
array of Document instances. It adds the documents to the store.
Static method to create a new VercelPostgres instance from an
array of texts and their metadata. It converts the texts into
Document instances and adds them to the store.
Static method to create a new VercelPostgres instance from a
connection. It creates a table if one does not exist, and calls
connect to return a new instance of VercelPostgres.
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.