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_documentsmap_reduceMapReduceDocumentsChaincombine_docs
    Methodā—Since v1.0

    combine_docs

    Copy
    combine_docs(
      self,
      docs: list[Document],
      token_max: int | None = None
    View source on GitHub
    ,
    callbacks
    :
    Callbacks
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    tuple
    [
    str
    ,
    dict
    ]

    Combine documents in a map reduce manner.

    Combine by mapping first chain over all documents, then reducing the results. This reducing can be done recursively if needed (if there are many documents).