You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a new component called the LCCompressorComponent (standing for LangChain Compressor Component) which is a base class for reranker components. Common attributes of the rerankers are abstracted away into this class, leaving the build_compressor abstract method to be implemented by the child class. This requires sourcing BaseDocumentCompressor from langchain_core.documents.compressors but otherwise is a fairly lightweight class and is even an improvement because the previous implementation of rerankers were inaccurately subclassed from LCVectorStoreComponent.
The Cohere & NVIDIA rerankers were marked as legacy because we wanted to deprecate retrievers and both components had relied on the ContextualCompressionRetrieverabstraction from LangChain. This particular abstraction is redundant in LangFlow because simply performs similarity search on a vector store and then reranks the resulting documents using the provided reranker (referred to as a compressor in LC documentation). Because we have the search results coming directly from VectorStore components we can instead pass the results directly into the reranker without this abstracted class.
Your Contribution
This PR adds a new component called the LCCompressorComponent (standing for LangChain Compressor Component) which is a base class for reranker components. Common attributes of the rerankers are abstracted away into this class, leaving the build_compressor abstract method to be implemented by the child class. This requires sourcing BaseDocumentCompressor from langchain_core.documents.compressors but otherwise is a fairly lightweight class and is even an improvement because the previous implementation of rerankers were inaccurately subclassed from LCVectorStoreComponent.
The text was updated successfully, but these errors were encountered:
Feature Request
New Features
This PR adds a new component called the
LCCompressorComponent
(standing for LangChain Compressor Component) which is a base class for reranker components. Common attributes of the rerankers are abstracted away into this class, leaving thebuild_compressor
abstract method to be implemented by the child class. This requires sourcingBaseDocumentCompressor
fromlangchain_core.documents.compressors
but otherwise is a fairly lightweight class and is even an improvement because the previous implementation of rerankers were inaccurately subclassed fromLCVectorStoreComponent
.New Rerankers
Adding new reranker components will be easier. There are desires for an integration with Voyage AI because their rerank-2 is both cost-effective and has high relevance.
Motivation
The Cohere & NVIDIA rerankers were marked as legacy because we wanted to deprecate retrievers and both components had relied on the
ContextualCompressionRetriever
abstraction from LangChain. This particular abstraction is redundant in LangFlow because simply performs similarity search on a vector store and then reranks the resulting documents using the provided reranker (referred to as a compressor in LC documentation). Because we have the search results coming directly fromVectorStore
components we can instead pass the results directly into the reranker without this abstracted class.Your Contribution
This PR adds a new component called the
LCCompressorComponent
(standing for LangChain Compressor Component) which is a base class for reranker components. Common attributes of the rerankers are abstracted away into this class, leaving thebuild_compressor
abstract method to be implemented by the child class. This requires sourcingBaseDocumentCompressor
fromlangchain_core.documents.compressors
but otherwise is a fairly lightweight class and is even an improvement because the previous implementation of rerankers were inaccurately subclassed fromLCVectorStoreComponent
.The text was updated successfully, but these errors were encountered: