LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    Standard Tests
    Text Splitters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    Standard Tests
    Text Splitters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Language
    Theme
    Pythonlangchain-classicretrieversdocument_compressors
    Module●Since v1.0

    document_compressors

    Classes

    Modules

    View source on GitHub
    class
    DocumentCompressorPipeline
    class
    LLMChainExtractor
    class
    LLMChainFilter
    class
    CrossEncoderReranker
    class
    EmbeddingsFilter
    class
    LLMListwiseRerank
    deprecatedclass
    CohereRerank
    module
    cohere_rerank
    module
    cross_encoder_rerank
    module
    cross_encoder
    module
    embeddings_filter
    module
    chain_extract_prompt
    module
    chain_filter_prompt
    module
    base
    module
    flashrank_rerank
    module
    chain_filter
    module
    listwise_rerank
    module
    chain_extract

    Document compressor that uses a pipeline of Transformers.

    LLM Chain Extractor.

    Document compressor that uses an LLM chain to extract the relevant parts of documents.

    Filter that drops documents that aren't relevant to the query.

    Document compressor that uses CrossEncoder for reranking.

    Embeddings Filter.

    Document compressor that uses embeddings to drop documents unrelated to the query.

    Document compressor that uses Zero-Shot Listwise Document Reranking.

    Adapted from: https://arxiv.org/pdf/2305.02156.pdf

    LLMListwiseRerank uses a language model to rerank a list of documents based on their relevance to a query.

    Note

    Requires that underlying model implement with_structured_output.

    Document compressor that uses Cohere Rerank API.

    Filter that uses an LLM to drop documents that aren't relevant to the query.

    Filter that uses an LLM to rerank documents listwise and select top-k.

    DocumentFilter that uses an LLM chain to extract the relevant parts of documents.