The LLM Filter Retriever is a specialized retriever that enhances the document retrieval process by using a language model to filter and extract relevant content from initially retrieved documents.
The LLM Filter Retriever uses a ContextualCompressionRetriever with an LLMChainExtractor. It works as follows:
The base retriever (e.g., a vector store retriever) fetches initial documents.
The language model (LLM) is used to create an LLMChainExtractor, which serves as the base compressor.
The ContextualCompressionRetriever combines the base retriever and the LLM-based compressor.
When retrieving documents, the compressor filters and extracts only the relevant content from each document based on the query.
This approach helps to reduce noise and improve the relevance of the retrieved information, especially useful in scenarios where documents might contain a mix of relevant and irrelevant content.