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.
Deletes entries from the table based on the provided filter.
Optional
filter?: FilterOptional
ids?: string[]Error if 'ids' parameter is provided, as deletion by ids is not supported.
Error if 'filter' parameter is not provided, as it is required for deletion. to do: adjust the call signature
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
sanitizeSanitizes a list to ensure all elements are floats (numbers in TypeScript). Throws an error if any element is not a number.
The array of numbers (floats) to be sanitized.
The sanitized array of numbers (floats).
Throws an error if any element is not a number.
Static
sanitizeGenerated using TypeDoc
Adds an array of documents to the table. The documents are first converted to vectors using the
embedDocuments
method of theembeddings
instance.