This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hybrid Search Implementation: | |
import { PineconeStore } from "@langchain/pinecone"; | |
import FlexSearch from "flexsearch"; | |
class HybridRetriever { | |
constructor(vectorStore, documents) { | |
this.vectorStore = vectorStore; | |
this.bm25Index = new FlexSearch.Document({ | |
tokenize: "forward", | |
document: { |