Contextual compression | 🦜️🔗 Langchain
One challenge with retrieval is that usually you don't know the specific queries your document storage system will face when you ingest data into the system. This means that the information most relevant to a query may be buried in a document with a lot of irrelevant text. Passing that full document through your application can lead to more expensive LLM calls and poorer responses.
https://python.langchain.com/docs/modules/data_connection/retrievers/contextual_compression