From 5850fe5b517738983dd593dbe1ec9e71f0efa195 Mon Sep 17 00:00:00 2001 From: Sam Crowder Date: Mon, 4 Aug 2025 20:57:47 -0700 Subject: [PATCH 1/4] better document what the first argument to a RemoteGraph can be --- src/langgraph-platform/use-remote-graph.mdx | 28 +++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/langgraph-platform/use-remote-graph.mdx b/src/langgraph-platform/use-remote-graph.mdx index b2257955..a199041e 100644 --- a/src/langgraph-platform/use-remote-graph.mdx +++ b/src/langgraph-platform/use-remote-graph.mdx @@ -14,7 +14,7 @@ sidebarTitle: Interact with the deployment using RemoteGraph When initializing a `RemoteGraph`, you must always specify: -* `name`: the name of the graph you want to interact with. This is the same graph name you use in `langgraph.json` configuration file for your deployment. +* `name`: the name of the graph you want to interact with OR an assistant ID. If you specify a graph name, the default assistant will be used. If you specify an assistant ID, that specific assistant will be used. The graph name is the same name you use in `langgraph.json` configuration file for your deployment. * `api_key`: a valid LangSmith API key. Can be set as an environment variable (`LANGSMITH_API_KEY`) or passed directly via the `api_key` argument. The API key could also be provided via the `client` / `sync_client` arguments, if `LangGraphClient` / `SyncLangGraphClient` were initialized with `api_key` argument. Additionally, you have to provide one of the following: @@ -35,8 +35,14 @@ Additionally, you have to provide one of the following: from langgraph.pregel.remote import RemoteGraph url = + + # Using graph name (uses default assistant) graph_name = "agent" remote-graph = RemoteGraph(graph_name, url=url) + + # Using assistant ID (uses specific assistant) + assistant_id = "assistant-123" + remote-graph = RemoteGraph(assistant_id, url=url) ``` @@ -44,8 +50,14 @@ Additionally, you have to provide one of the following: import { RemoteGraph } from "@langchain/langgraph/remote"; const url = ``; + + // Using graph name (uses default assistant) const graphName = "agent"; const remoteGraph = new RemoteGraph({ graphId: graphName, url }); + + // Using assistant ID (uses specific assistant) + const assistantId = "assistant-123"; + const remoteGraph = new RemoteGraph({ graphId: assistantId, url }); ``` @@ -59,10 +71,16 @@ Additionally, you have to provide one of the following: from langgraph.pregel.remote import RemoteGraph url = - graph_name = "agent" client = get_client(url=url) sync_client = get_sync_client(url=url) + + # Using graph name (uses default assistant) + graph_name = "agent" remote-graph = RemoteGraph(graph_name, client=client, sync_client=sync_client) + + # Using assistant ID (uses specific assistant) + assistant_id = "assistant-123" + remote-graph = RemoteGraph(assistant_id, client=client, sync_client=sync_client) ``` @@ -71,8 +89,14 @@ Additionally, you have to provide one of the following: import { RemoteGraph } from "@langchain/langgraph/remote"; const client = new Client({ apiUrl: `` }); + + // Using graph name (uses default assistant) const graphName = "agent"; const remoteGraph = new RemoteGraph({ graphId: graphName, client }); + + // Using assistant ID (uses specific assistant) + const assistantId = "assistant-123"; + const remoteGraph = new RemoteGraph({ graphId: assistantId, client }); ``` From daed07150b7e870e1a61d616893d6ce8fc5bd3ed Mon Sep 17 00:00:00 2001 From: Sam Crowder Date: Mon, 4 Aug 2025 21:00:31 -0700 Subject: [PATCH 2/4] cleaning up --- src/langgraph-platform/use-remote-graph.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/langgraph-platform/use-remote-graph.mdx b/src/langgraph-platform/use-remote-graph.mdx index a199041e..51db87cd 100644 --- a/src/langgraph-platform/use-remote-graph.mdx +++ b/src/langgraph-platform/use-remote-graph.mdx @@ -40,8 +40,8 @@ Additionally, you have to provide one of the following: graph_name = "agent" remote-graph = RemoteGraph(graph_name, url=url) - # Using assistant ID (uses specific assistant) - assistant_id = "assistant-123" + # Using assistant ID + assistant_id = remote-graph = RemoteGraph(assistant_id, url=url) ``` @@ -55,8 +55,8 @@ Additionally, you have to provide one of the following: const graphName = "agent"; const remoteGraph = new RemoteGraph({ graphId: graphName, url }); - // Using assistant ID (uses specific assistant) - const assistantId = "assistant-123"; + // Using assistant ID + const assistantId = ``; const remoteGraph = new RemoteGraph({ graphId: assistantId, url }); ``` @@ -78,8 +78,8 @@ Additionally, you have to provide one of the following: graph_name = "agent" remote-graph = RemoteGraph(graph_name, client=client, sync_client=sync_client) - # Using assistant ID (uses specific assistant) - assistant_id = "assistant-123" + # Using assistant ID + assistant_id = remote-graph = RemoteGraph(assistant_id, client=client, sync_client=sync_client) ``` @@ -94,8 +94,8 @@ Additionally, you have to provide one of the following: const graphName = "agent"; const remoteGraph = new RemoteGraph({ graphId: graphName, client }); - // Using assistant ID (uses specific assistant) - const assistantId = "assistant-123"; + // Using assistant ID + const assistantId = ; const remoteGraph = new RemoteGraph({ graphId: assistantId, client }); ``` From 19e1789ac2df3cd388b36a017ce44afb013690fb Mon Sep 17 00:00:00 2001 From: Sam Crowder Date: Mon, 4 Aug 2025 21:01:25 -0700 Subject: [PATCH 3/4] consistency --- src/langgraph-platform/use-remote-graph.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/langgraph-platform/use-remote-graph.mdx b/src/langgraph-platform/use-remote-graph.mdx index 51db87cd..b55d5474 100644 --- a/src/langgraph-platform/use-remote-graph.mdx +++ b/src/langgraph-platform/use-remote-graph.mdx @@ -95,7 +95,7 @@ Additionally, you have to provide one of the following: const remoteGraph = new RemoteGraph({ graphId: graphName, client }); // Using assistant ID - const assistantId = ; + const assistantId = ``; const remoteGraph = new RemoteGraph({ graphId: assistantId, client }); ``` From d940871825c08f05cf2ad7a85fabca0ef4685605 Mon Sep 17 00:00:00 2001 From: Sam Crowder Date: Tue, 5 Aug 2025 09:30:21 -0700 Subject: [PATCH 4/4] Update src/langgraph-platform/use-remote-graph.mdx Co-authored-by: Kathryn May <44557882+katmayb@users.noreply.github.com> --- src/langgraph-platform/use-remote-graph.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/langgraph-platform/use-remote-graph.mdx b/src/langgraph-platform/use-remote-graph.mdx index b55d5474..00067569 100644 --- a/src/langgraph-platform/use-remote-graph.mdx +++ b/src/langgraph-platform/use-remote-graph.mdx @@ -14,7 +14,7 @@ sidebarTitle: Interact with the deployment using RemoteGraph When initializing a `RemoteGraph`, you must always specify: -* `name`: the name of the graph you want to interact with OR an assistant ID. If you specify a graph name, the default assistant will be used. If you specify an assistant ID, that specific assistant will be used. The graph name is the same name you use in `langgraph.json` configuration file for your deployment. +* `name`: the name of the graph you want to interact with **or** an assistant ID. If you specify a graph name, the default assistant will be used. If you specify an assistant ID, that specific assistant will be used. The graph name is the same name you use in `langgraph.json` configuration file for your deployment. * `api_key`: a valid LangSmith API key. Can be set as an environment variable (`LANGSMITH_API_KEY`) or passed directly via the `api_key` argument. The API key could also be provided via the `client` / `sync_client` arguments, if `LangGraphClient` / `SyncLangGraphClient` were initialized with `api_key` argument. Additionally, you have to provide one of the following: