Skip to content

Commit

Permalink
Merge pull request #637 from ChhikaraBRUH/main
Browse files Browse the repository at this point in the history
Adding Supabase Hybrid Search default assumptions to the docs
  • Loading branch information
nfcampos committed Apr 6, 2023
2 parents 22e2b73 + 6a3b21f commit a5eeaff
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions examples/src/retrievers/supabase_hybrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ export const run = async () => {

const retriever = new SupabaseHybridSearch(embeddings, {
client,
// Below are the defaults, expecting that you set up your supabase table and functions according to the guide above. Please change if necessary.
similarityK: 2,
keywordK: 2,
tableName: "documents",
similarityQueryName: "match_documents",
keywordQueryName: "kw_match_documents",
});

const results = await retriever.getRelevantDocuments("hello bye");
Expand Down
13 changes: 11 additions & 2 deletions langchain/src/retrievers/supabase-hybrid-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,24 @@ type SearchResult = [Document, number, number];

export interface SupabaseLibArgs {
client: SupabaseClient;
/**
* The table name on Supabase. Defaults to "documents".
*/
tableName?: string;
/**
* The name of the Similarity search function on Supabase. Defaults to "match_documents".
*/
similarityQueryName?: string;
/**
* The name of the Keyword search function on Supabase. Defaults to "kw_match_documents".
*/
keywordQueryName?: string;
/**
* The number of documents to return from the similarity search
* The number of documents to return from the similarity search. Defaults to 2.
*/
similarityK?: number;
/**
* The number of documents to return from the keyword search
* The number of documents to return from the keyword search. Defaults to 2.
*/
keywordK?: number;
}
Expand Down

0 comments on commit a5eeaff

Please sign in to comment.