LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-corerunnablesgraphGraphextend
    Methodā—Since v0.1

    extend

    Copy
    extend(
      self,
      graph: Graph,
      *,
      prefix: str = ''
    ) -> tuple
    View source on GitHub
    [
    Node
    |
    None
    ,
    Node
    |
    None
    ]

    Parameters

    NameTypeDescription
    graph*Graph
    prefixstr
    Default:''

    Add all nodes and edges from another graph.

    Note this doesn't check for duplicates, nor does it connect the graphs.

    The graph to add.

    The prefix to add to the node ids.