Name of the database to search
Interface for generating embeddings from text
OptionalentityOptional ChatModel used to extract entities from queries
Whether the metadata is contained in a single column or multiple columns
Array of filters to apply to search results
Number of results to return from full text search. Minimum is 1.
Name of table containing documents for full text search
Namespace for the retriever in LangChain
OptionalmetadataOptional metadata columns to include in results
Prompt template for entity extraction
OptionalsearchType of search to perform - either hybrid (combining vector + FTS) or similarity only
Number of results to return from similarity search. Minimum is 1.
Name of table containing vector embeddings for similarity search
Performs the selected search and returns the documents retrieved.
The user query
A promise that resolves with the completion of the search results.
Protectedconvert2Converts a query to a FTS query.
The user query
The converted FTS query
ProtectedextractExtracts entities from a user query using the entityExtractor model.
The user query
A promise that resolves with the extracted entities when the extraction is complete.
ProtectedgenerateGenerates a string of filters for the SQL query.
The filters to apply to the search.
A string of filters for the SQL query.
ProtectedgenerateGenerates the metadata string for the SQL query.
The metadata string.
ProtectedgenerateGenerates SQL queries for full-text search and similarity search.
The embedded query vector.
The entities extracted from the query for full-text search.
Additional metadata columns to be included in the results.
An object containing the FTS query and similarity query strings.
ProtectedgenerateGenerates the SQL statements for the similarity search and full-text search.
The user query.
An array of SQL statements.
ProtectedhybridPerforms a hybrid search on the vector store, using cosine similarity and FTS search, and returns the top 'similarityK' + 'ftsK' similar documents.
The user query
A promise that resolves with the hybrid search results when the search is complete.
ProtectedmapMaps search results to Document objects.
An array of SearchEmbeddingsResponse objects.
An array of tuples, each containing a single Document object.
ProtectedsearchGenerates an error document based on the provided error information
The error object containing details about the issue
A promise that resolves to an array containing a single Document representing the error
ProtectedsimilarityPerforms a similarity search on the vector store and returns the top 'similarityK' similar documents.
The query string.
A promise that resolves with the similarity search results when the search is complete.
Staticlc_
Example usage: