samples-python icon indicating copy to clipboard operation
samples-python copied to clipboard

LangGraph Samples

Open mfateev opened this issue 3 weeks ago • 0 comments

Summary

Add LangGraph samples demonstrating the Temporal LangGraph integration for durable AI agent workflows.

Samples Included

Sample Description
hello_world Minimal starter example - basic plugin setup and graph registration
react_agent ReAct agent with tool calling and multi-step reasoning
approval_workflow Human-in-the-loop with interrupt/resume for approvals
supervisor Multi-agent supervisor pattern coordinating specialized agents
agentic_rag Retrieval-augmented generation with document grading
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

Key Features Demonstrated

  • Durable execution: Each graph node runs as a Temporal activity with automatic retries
  • Human-in-the-loop: Interrupt/resume workflows for human approval
  • Multi-agent coordination: Supervisor patterns for agent orchestration
  • RAG patterns: Document retrieval, grading, and query rewriting
  • Planning patterns: Structured plan-and-execute workflows

Prerequisites

  • Temporal server running locally
  • Python 3.9+
  • OpenAI API key (for LLM-based samples)

Running

# Install dependencies
uv sync --group langgraph

# Install SDK from langgraph-plugin branch
uv pip install "temporalio @ git+https://github.com/mfateev/sdk-python.git@langgraph-plugin"

# Run a sample (e.g., hello_world)
uv run langgraph_samples/hello_world/run_worker.py  # Terminal 1
uv run langgraph_samples/hello_world/run_workflow.py  # Terminal 2

Related PR

  • SDK: https://github.com/temporalio/sdk-python/pull/1263

mfateev avatar Dec 29 '25 23:12 mfateev