Skip to content

ChrisLally/langgraph-remote-graph

Repository files navigation

LangGraph RemoteGraph Example

This example demonstrates how to use LangGraph's RemoteGraph as a subgraph in a parent graph, including thread-level persistence.

Setup

  1. Create and activate a virtual environment:
python -m venv venv
.\venv\Scripts\activate  # On Windows
source venv/bin/activate  # On Unix/MacOS
  1. Install dependencies:
pip install -r requirements.txt
  1. Configure environment variables:
    • Copy .env.example to .env
    • Update the following variables in .env:
      • DEPLOYMENT_URL: Your LangGraph deployment URL
      • LANGSMITH_API_KEY: Your LangSmith API key

Features

The example demonstrates:

  1. Using RemoteGraph as a subgraph in a parent graph
  2. Invoking the graph synchronously
  3. Streaming outputs from both parent and child graphs
  4. Thread-level persistence for maintaining state

Usage

Run the example:

python remote_graph_example.py

File Structure

  • remote_graph_example.py: Main example code
  • requirements.txt: Project dependencies
  • .env: Environment variables (not in version control)
  • README.md: This documentation

Requirements

  • Python 3.8+
  • LangGraph deployment URL
  • LangSmith API key

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published