Adds an array of vectors and corresponding documents to the database. The vectors and documents are batch inserted into the database.
Array of vectors to be added to the table.
Array of Document instances corresponding to the vectors.
Promise that resolves when the vectors and documents are added.
Checks if the specified column exists in the table and validates its data type and length.
The name of the table.
The name of the column to check.
The expected data type(s) of the column.
Optional
columnLength: numberThe expected length of the column. Optional.
Return 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.
List of documents selected by maximal marginal relevance.
Return docs most similar to query.
Query text for the similarity search.
Number of Documents to return. Defaults to 4.
Optional
filter: FilterA dictionary of metadata fields and values to filter by. Defaults to None.
Promise that resolves to a list of documents and their corresponding similarity scores.
Return docs most similar to the given embedding.
Number of Documents to return. Defaults to 4.
Optional
filter: FilterA dictionary of metadata fields and values to filter by. Defaults to None.
Promise that resolves to a list of documents and their corresponding similarity scores.
Return documents and score values most similar to query.
Query text for the similarity search.
Number of Documents to return. Defaults to 4.
Optional
filter: FilterA dictionary of metadata fields and values to filter by. Defaults to None.
Promise that resolves to a list of documents and their corresponding similarity scores.
Performs a similarity search based on vector comparison and returns documents along with their similarity scores and vectors.
The vector representation of the query for similarity comparison.
The number of top similar documents to return.
Optional
filter: FilterOptional filter criteria to apply to the search query.
A promise that resolves to an array of tuples, each containing a Document, its similarity score, and its vector.
Static
fromCreates an instance of HanaDB
from an array of
Document instances. The documents are added to the database.
List of documents to be converted to vectors.
Embeddings instance used to convert the documents to vectors.
Configuration for the HanaDB.
Promise that resolves to an instance of HanaDB
.
Static
fromStatic method to create a HanaDB instance from raw texts. This method embeds the documents, creates a table if it does not exist, and adds the documents to the table.
Array of text documents to add.
metadata for each text document.
Configuration for the HanaDB.
A Promise that resolves to an instance of HanaDB.
Static
parseStatic
sanitizeStatic
sanitizeStatic
sanitize
Adds an array of documents to the table. The documents are first converted to vectors using the
embedDocuments
method of theembeddings
instance.