class NeonPostgresClass that provides an interface to a Neon Postgres database. It
extends the VectorStore base class and implements methods for adding
documents and vectors, performing similarity searches, and ensuring the
existence of a table in the database.
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.
Method to delete documents from the vector store. It deletes the documents that match the provided ids.
Method to ensure the existence of the table to store vectors in the database. It creates the table if it does not already exist.
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 NeonPostgres instance from an
array of Document instances. It adds the documents to the store.
Static method to create a new NeonPostgres 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 NeonPostgres instance from a
connection. It creates a table if one does not exist.
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.