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

    Add all nodes and edges from another graph.

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

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

    Parameters

    NameTypeDescription
    graph*Graph

    The graph to add.

    prefixstr
    Default:''

    The prefix to add to the node ids.

    View source on GitHub