Name of the database to search
Interface for generating embeddings from text
Optional
entityOptional 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
Optional
metadataOptional metadata columns to include in results
Prompt template for entity extraction
Optional
searchType 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.
Protected
convert2Converts a query to a FTS query.
The user query
The converted FTS query
Protected
extractExtracts 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.
Protected
generateGenerates a string of filters for the SQL query.
The filters to apply to the search.
A string of filters for the SQL query.
Protected
generateGenerates the metadata string for the SQL query.
The metadata string.
Protected
generateGenerates 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.
Protected
generateGenerates the SQL statements for the similarity search and full-text search.
The user query.
An array of SQL statements.
Protected
hybridPerforms 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.
Protected
mapMaps search results to Document objects.
An array of SearchEmbeddingsResponse objects.
An array of tuples, each containing a single Document object.
Protected
searchGenerates 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
Protected
similarityPerforms 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.
Static
lc_
Example usage: