Skip to content

Conversation

katmayb
Copy link
Contributor

@katmayb katmayb commented Sep 3, 2025

DOC-40

  • Adds more detail on use case for the RemoteGraph feature — a couple of recent comments suggested that users/internal folks weren't understanding what you could use this for.
  • Updates to <CodeGroup> for global page syncing of code blocks.
  • Updates language for docs style.
  • Makes headings consistent.
  • Updates possible python variable error.

Preview

https://langchain-5e9cc07a-preview-improv-1756931698-528fb72.mintlify.app/langgraph-platform/use-remote-graph

Copy link

github-actions bot commented Sep 3, 2025

Preview ID generated: preview-improv-1756931698-528fb72

@katmayb katmayb requested a review from samecrowder September 3, 2025 20:45
@mdrxy mdrxy added the langgraph-platform For docs changes to LangGraph Platform label Sep 8, 2025
@katmayb katmayb marked this pull request as ready for review September 16, 2025 20:31
@katmayb katmayb requested a review from lnhsingh as a code owner September 16, 2025 20:31
</Info>

`RemoteGraph` is an interface that allows you to interact with your LangGraph Platform deployment as if it were a regular, locally-defined LangGraph graph (e.g. a `CompiledGraph`). This guide shows you how you can initialize a `RemoteGraph` and interact with it.
[`RemoteGraph`](https://langchain-ai.github.io/langgraph/reference/remote_graph) is a client-side interface that allows you to interact with your [deployment](/langgraph-platform/deployment-options) as if it were a local graph. It provides API parity with [`CompiledGraph`](/oss/python/langgraph/graph-api#compiling-your-graph), which means that you can use the same methods (`invoke`, `stream`, `get_state`, etc.) in your development and production environments. This page describes how to initialize a `RemoteGraph` and interact with it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/oss/python/langgraph/graph-api#compiling-your-graph returns a 404 page in the preview.

Really weird, but when I click the link, the URL contains an extra /python in the path, which is causing the 404 page. Maybe this is just a bug in the preview.

- Separation of development and deployment: Build and test a graph locally with `CompiledGraph`, deploy it to LangGraph Platform, and then [use `RemoteGraph`](#initialize-the-graph) to call it in production while working with the same API interface.
- Thread-level persistence: [Persist and fetch the state](#persist-state-at-the-thread-level) of a conversation across calls with a thread ID.
- Subgraph embedding: Compose modular graphs for a multi-agent workflow by embedding a `RemoteGraph` as a [subgraph](#use-as-a-subgraph) within another graph.
- Reusable workflows: Use deployed graphs as nodes or [tools](https://langchain-ai.github.io/langgraph/reference/remote_graph#meth-as-tool), so that you can reuse and expose complex logic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL for tool might be better: https://langchain-ai.github.io/langgraph/reference/remote_graph/#langgraph.pregel.remote.RemoteGraph.as_tool

This URL actually scrolled down the page to the as_tool method for me.

</Info>

`RemoteGraph` is an interface that allows you to interact with your LangGraph Platform deployment as if it were a regular, locally-defined LangGraph graph (e.g. a `CompiledGraph`). This guide shows you how you can initialize a `RemoteGraph` and interact with it.
[`RemoteGraph`](https://langchain-ai.github.io/langgraph/reference/remote_graph) is a client-side interface that allows you to interact with your [deployment](/langgraph-platform/deployment-options) as if it were a local graph. It provides API parity with [`CompiledGraph`](/oss/python/langgraph/graph-api#compiling-your-graph), which means that you can use the same methods (`invoke`, `stream`, `get_state`, etc.) in your development and production environments. This page describes how to initialize a `RemoteGraph` and interact with it.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the rest of the page, can we append () to the method names: invoke().

remote_graph = RemoteGraph(graph_name, url=url)

# Using assistant ID
assistant_id = <ASSISTANT_ID>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quotation marks for string: assistant_id = <ASSISTANT_ID> --> assistant_id = "<ASSISTANT_ID>"

We did the same in the JS example.

```python
from langgraph_sdk import get_client, get_sync_client
from langgraph.pregel.remote import RemoteGraph
url = <DEPLOYMENT_URL>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url = <DEPLOYMENT_URL> --> url = "<DEPLOYMENT_URL>"


```python Python
from langgraph_sdk import get_sync_client
url = <DEPLOYMENT_URL>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url = <DEPLOYMENT_URL> --> url = "<DEPLOYMENT_URL>"

<CodeGroup>

```python Python
from langgraph_sdk import get_sync_client
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a blank line after this line (e.g. nice Python code formatting)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Done!


<Note>
If you need to use a `checkpointer` with a graph that has a `RemoteGraph` subgraph node, make sure to use UUIDs as thread IDs.
If you need to use a `checkpointer` with a graph that has a `RemoteGraph` subgraph node, make sure to use UUIDs as thread IDs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double text. We can remove this line.

```
</Tab>
</Tabs>
A graph can also call out to multiple `RemoteGraph` instances as [_subgraph_](/oss/python/langgraph/subgraphs) nodes. This allows for modular, scalable workflows where different responsibilities are split across separate graphs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _subgraph_ link has the same issue with the extra /python in the path.

from langgraph.graph import StateGraph, MessagesState, START
from typing import TypedDict

url = <DEPLOYMENT_URL>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

url = <DEPLOYMENT_URL> --> url = "<DEPLOYMENT_URL>"

Copy link

Preview ID generated: preview-improv-1758633637-f9cd3e5

@katmayb
Copy link
Contributor Author

katmayb commented Sep 23, 2025

TFTRs! Incorporated all of your feedback!

@katmayb katmayb merged commit 98ef500 into main Sep 23, 2025
12 checks passed
@katmayb katmayb deleted the improve-remote-graph branch September 23, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
langgraph-platform For docs changes to LangGraph Platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants