Index of every page on this site: llms.txt
All skills
jeremylongshore avatar

/langchain-langgraph-basics

@0d57af8
Run it yourself

Build a correct LangGraph 1.0 StateGraph — typed TypedDict state with reducers, nodes, edges, compile, and recursion budgets — without hitting the silent-termination and state-replacement traps. Use when writing your first LangGraph StateGraph, diagnosing why a graph halted without reaching END, or picking recursion_limit. Trigger with "langgraph statgraph", "langgraph basics", "GraphRecursionError", "langgraph conditional edges".

Use this Skill: https://skilld.dev/gh/jeremylongshore/tons-of-skills-marketplace/langchain-langgraph-basics

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesone-pager.md

≈680 tokens on demand. Your agent reads this file only when SKILL.md points to it.

langchain-langgraph-basics — One-Pager

Build a correct LangGraph 1.0 StateGraph without silent halts, list replacement, or mystery GraphRecursionErrors.

The Problem

A conditional edge whose router returns a string that isn't in path_map halts the graph without reaching END — no exception, no log line, just a silent stop (P56). A Command(update={"messages": [msg]}) wipes your entire message history because the messages field wasn't annotated with an add_messages reducer (P18). GraphRecursionError: Recursion limit of 25 reached fires on a graph with no loop because the limit counts supersteps, not iterations (P55). And a langgraph minor version bump silently reads old PostgresSaver rows as empty state because checkpoint schemas don't auto-migrate (P20).

The Solution

This skill walks through a LangGraph 1.0 StateGraph end to end: a TypedDict state with Annotated[list, add_messages] reducers on every list field, node functions that return partial-state dicts, edges plus conditional edges with a path_map that always includes END, compilation with a checkpointer, a recursion_limit sized to the graph's superstep count, and invocation with an explicit thread_id in config["configurable"]. Pinned to langgraph 1.0.x with four deep references.

Who / What / When

Aspect Details
Who Python engineers and researchers building their first LangGraph 1.0 agent or multi-step workflow. Comfortable with LangChain, new to StateGraph.
What Typed state with reducers, node/edge wiring, conditional-edge defensive patterns, recursion-limit sizing, checkpointer compile, thread-scoped invocation, 4 references (state-reducers, conditional-edges, recursion-limits, first-graph-walkthrough)
When Writing your first StateGraph, diagnosing why a graph halted without reaching END, picking recursion_limit, or migrating from legacy AgentExecutor to create_react_agent from LangGraph

Key Features

  1. Reducer-safe TypedDict state — Every list field uses Annotated[list, add_messages] (or operator.add, or a custom merger), so Command(update=...) appends instead of replaces (fixes P18)
  2. Defensive conditional edges — Router functions are explicitly typed to return keys from a bounded Literal set, and path_map always maps an END fallback so unknown returns land there instead of halting silently (fixes P56)
  3. Recursion-limit sizing guide — Superstep counts for common shapes (simple ReAct ~15, planner+executor ~30, deep-agent 50+) with a runbook for diagnosing GraphRecursionError (fixes P55)

Quick Start

See SKILL.md for full instructions.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill is a comprehensive educational resource for building LangGraph 1.0 agents. It correctly implements state management, error handling, and persistence best practices without any detected security risks.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 0d57af8. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
What it can do
Reads files Edits files Runs commands
version
2.7.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
compatibility
Designed for Claude Code
All 4 allowed tools
ReadWriteEditBash(python:*)
Other metadata
tags
[
  "saas",
  "langchain",
  "langgraph",
  "python",
  "langchain-1.0",
  "statgraph"
]

README badge

README badge for jeremylongshore/tons-of-skills-marketplace/langchain-langgraph-basics