LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Graphs
  • Functional API
  • Pregel
  • Checkpointing
  • Storage
  • Caching
  • Types
  • Runtime
  • Config
  • Errors
  • Constants
  • Channels
  • Agents
LangGraph CLI
LangGraph SDK
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
LangGraph CLI
LangGraph SDK
LangGraph Supervisor
LangGraph Swarm
Language
Theme
PythonlanggraphpregelremoteRemoteGraph
Class●Since v0.2

RemoteGraph

Copy
RemoteGraph(
  self,
  assistant_id: str,
  ,
  *,
  url: str | None =

Bases

PregelProtocol

Used in Docs

  • Distributed tracing with Agent Server
  • How to interact with a deployment using RemoteGraph

Constructors

Attributes

Methods

Inherited fromRunnable(langchain_core)

Attributes

AInputTypeAOutputTypeAinput_schemaAoutput_schemaA
View source on GitHub
None
,
api_key
:
str
|
None
=
None
,
headers
:
dict
[
str
,
str
]
|
None
=
None
,
client
:
LangGraphClient
|
None
=
None
,
sync_client
:
SyncLangGraphClient
|
None
=
None
,
config
:
RunnableConfig
|
None
=
None
,
name
:
str
|
None
=
None
,
distributed_tracing
:
bool
=
False
)
config_specs

Methods

Mget_nameMget_input_schemaMget_input_jsonschemaMget_output_schemaMget_output_jsonschemaMconfig_schemaMget_config_jsonschemaMget_promptsMpipeMpickMassignMbatchMbatch_as_completedMabatchMabatch_as_completedMastream_logMtransformMatransformMbindMwith_listenersMwith_alistenersMwith_typesMwith_retryMmapMwith_fallbacksMas_tool

Parameters

NameTypeDescription
assistant_id*str

The assistant ID or graph name of the remote graph to use.

urlstr | None
Default:None

The URL of the remote API.

api_keystr | None
Default:None

The API key to use for authentication. If not provided, it will be read from the environment (LANGGRAPH_API_KEY, LANGSMITH_API_KEY, or LANGCHAIN_API_KEY).

headersdict[str, str] | None
Default:None
clientLangGraphClient | None
Default:None
sync_clientSyncLangGraphClient | None
Default:None
configRunnableConfig | None
Default:None
namestr | None
Default:None
distributed_tracingbool
Default:False
constructor
__init__
NameType
assistant_idstr
urlstr | None
api_keystr | None
headersdict[str, str] | None
clientLangGraphClient | None
sync_clientSyncLangGraphClient | None
configRunnableConfig | None
namestr | None
distributed_tracingbool
attribute
assistant_id: str
attribute
name: str | None
attribute
config: config
attribute
distributed_tracing: distributed_tracing
attribute
client: client
attribute
sync_client: sync_client
method
copy
method
with_config
method
get_graph

Get graph by graph name.

This method calls GET /assistants/{assistant_id}/graph.

method
aget_graph

Get graph by graph name.

This method calls GET /assistants/{assistant_id}/graph.

method
get_state

Get the state of a thread.

This method calls POST /threads/{thread_id}/state/checkpoint if a checkpoint is specified in the config or GET /threads/{thread_id}/state if no checkpoint is specified.

method
aget_state

Get the state of a thread.

This method calls POST /threads/{thread_id}/state/checkpoint if a checkpoint is specified in the config or GET /threads/{thread_id}/state if no checkpoint is specified.

method
get_state_history

Get the state history of a thread.

This method calls POST /threads/{thread_id}/history.

method
aget_state_history

Get the state history of a thread.

This method calls POST /threads/{thread_id}/history.

method
bulk_update_state
method
abulk_update_state
method
update_state

Update the state of a thread.

This method calls POST /threads/{thread_id}/state.

method
aupdate_state

Update the state of a thread.

This method calls POST /threads/{thread_id}/state.

method
stream

Create a run and stream the results.

This method calls POST /threads/{thread_id}/runs/stream if a thread_id is speciffed in the configurable field of the config or POST /runs/stream otherwise.

method
astream

Create a run and stream the results.

This method calls POST /threads/{thread_id}/runs/stream if a thread_id is speciffed in the configurable field of the config or POST /runs/stream otherwise.

method
astream_events
method
invoke

Create a run, wait until it finishes and return the final state.

method
ainvoke

Create a run, wait until it finishes and return the final state.

The RemoteGraph class is a client implementation for calling remote APIs that implement the LangGraph Server API specification.

For example, the RemoteGraph class can be used to call APIs from deployments on LangSmith Deployment.

RemoteGraph behaves the same way as a Graph and can be used directly as a node in another Graph.

Additional headers to include in the requests.

A LangGraphClient instance to use instead of creating a default client.

A SyncLangGraphClient instance to use instead of creating a default client.

An optional RunnableConfig instance with additional configuration.

Human-readable name to attach to the RemoteGraph instance. This is useful for adding RemoteGraph as a subgraph via graph.add_node(remote_graph). If not provided, defaults to the assistant ID.

Whether to enable sending LangSmith distributed tracing headers.