Contextual Compression Retriever

Compress retrieved documents down to the parts relevant to the query, using a chat model. Requires a base retriever and a model.

Written By Philippe

Last updated 2 days ago

Contextual Compression Retriever

πŸ§ͺ Labs β€” Experimental, may change or break without notice

What It Does

Wraps a base retriever and uses a chat model to strip retrieved documents down to only the passages relevant to the query β€” reducing noise and token usage before the context reaches a chain.

Connections

InputRequiredDescription
ModelYesChat model that judges relevance
RetrieverYesThe base retriever to compress

Output: a Retriever connection.

Compatibility

FeatureStatus
Model-based document compressionSupported
Chat modelsAny supported chat model (not OpenAI)

Notes

  • Both a base retriever and a chat model must be connected for this node to run.