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

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    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
    map_rerank

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

    module
    stuff

    Chain that combines documents by stuffing into context.

    module
    reduce

    Combine many documents together by recursively reducing them.

    module
    refine

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

    module
    map_reduce

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

    module
    base

    Base interface for chains combining documents.

    View source on GitHub