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-classicchainscombine_documents
    Module●Since v1.0

    combine_documents

    Different ways to combine documents.

    Functions

    function
    acollapse_docs

    Execute a collapse function on a set of documents and merge their metadatas.

    function
    collapse_docs

    Execute a collapse function on a set of documents and merge their metadatas.

    function
    split_list_of_docs

    Split Document objects to subsets that each meet a cumulative len. constraint.

    function
    create_stuff_documents_chain

    Create a chain for passing a list of Documents to a model.

    Modules

    module
    stuff

    Chain that combines documents by stuffing into context.

    module
    refine

    Combine documents by doing a first pass and then refining on more documents.

    module
    reduce

    Combine many documents together by recursively reducing them.

    module
    base

    Base interface for chains combining documents.

    module
    map_reduce

    Combining documents by mapping a chain over them first, then combining results.

    module
    map_rerank

    Combining documents by mapping a chain over them first, then reranking results.

    View source on GitHub