class RemoteGraphRunnable<PregelInputType, PregelOutputType, PregelOptions<Nn, Cc, ContextType>>import { RemoteGraph } from "@langchain/langgraph/remote";
// Can also pass a LangGraph SDK client instance directly
const remoteGraph = new RemoteGraph({
graphId: process.env.LANGGRAPH_REMOTE_GRAPH_ID!,
apiKey: process.env.LANGGRAPH_REMOTE_GRAPH_API_KEY,
url: process.env.LANGGRAPH_REMOTE_GRAPH_API_URL,
});
const input = {
messages: [
{
role: "human",
content: "Hello world!",
},
],
};
const config = {
configurable: { thread_id: "threadId1" },
};
await remoteGraph.invoke(input, config);The default configuration for graph execution, can be overridden on a per-invocation basis
The graph ID for the current execution.
Optional array of node names or "all" to interrupt after executing these nodes. Used for implementing human-in-the-loop workflows.
Optional array of node names or "all" to interrupt before executing these nodes. Used for implementing human-in-the-loop workflows.
A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.
The node name extracted from the last segment of the namespace path (everything before the final colon, or the full segment if no colon).
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 StateGraph and can be used directly as
a node in another StateGraph.
Creates a new instance of the Pregel graph with updated configuration. This method follows the immutable pattern - instead of modifying the current instance, it returns a new instance with the merged configuration.