Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 2.8 KB

File metadata and controls

66 lines (48 loc) · 2.8 KB

Temporal LangGraph Samples

These samples demonstrate the Temporal LangGraph integration - combining LangGraph's agent framework with Temporal's durable execution.

Note: The LangGraph integration is currently available as a preview feature in the langgraph_plugin branch of the SDK repository.

Overview

The integration combines:

  • Temporal workflows for orchestrating agent control flow and state management
  • LangGraph for defining agent graphs with conditional logic, cycles, and state

This approach ensures that AI agent workflows are durable, observable, and can handle failures gracefully.

Prerequisites

Installation

Since the LangGraph integration is currently in a branch, you need to install from the branch repositories.

Running the Samples

  1. Clone this samples repository:

    git clone -b langgraph_plugin https://github.com/mfateev/samples-python.git
    cd samples-python
  2. Install dependencies:

    uv sync --group langgraph
  3. Install the SDK from the langgraph-plugin branch:

    uv pip install "temporalio @ git+https://github.com/mfateev/sdk-python.git@langgraph-plugin"
  4. Start a local Temporal server:

    temporal server start-dev
  5. Navigate to a sample directory and follow its README for specific instructions

Examples

Each directory contains a complete example with its own README for detailed instructions:

Sample Description
hello_world Simple starter example demonstrating basic plugin setup and graph registration
activity_from_node Calling Temporal activities from a graph node using run_in_workflow
react_agent ReAct agent pattern with tool calling and multi-step reasoning
human_in_the_loop Human-in-the-loop approval workflows using two approaches
approval_graph_interrupt Uses LangGraph's interrupt() function
approval_wait_condition Uses run_in_workflow=True with workflow.wait_condition()
supervisor Multi-agent supervisor pattern coordinating specialized agents
agentic_rag Retrieval-augmented generation with document grading and query rewriting
deep_research Multi-step research with web search and iterative refinement
plan_and_execute Plan-and-execute pattern with structured step execution
reflection Self-reflection pattern for iterative improvement