Agent skill · software engineering · jeremylongshore

langchain-langgraph-agents

Build a correct LangGraph 1.0 ReAct agent with create_react_agent — typed tools, error propagation, recursion caps, and stop conditions that actually stop. Use when writing a first tool-calling agent, migrating from AgentExecutor or initialize_agent, or diagnosing an agent that loops on vague prompts. Trigger with "langgraph agent", "create_react_agent", "langgraph tool calling", "AgentExecutor migration", or "agent loop cost".

Why this skill is useful

Provides specific patterns for creating LangGraph agents with error handling and recursion limits that the AI wouldn't reliably generate on its own.

What it needs

Requires langchain-anthropic, langchain-core, langchain-openai, langgraph, python installed locally. Requires anthropic, openai account access. About 8k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.

What this skill does

LangChain LangGraph Agents (Python) Overview Two failure modes hit every team writing their first LangGraph 1.0 ReAct agent: Loop-to-cap on vague prompts (P10). createreactagent defaults to recursionlimit=25. A prompt like "help me with my account" never converges — the model calls a retrieval tool, gets irrelevant results, calls another tool, and repeats until GraphRecursionError: Recursion limit of 25 reached without hitting a stop condition fires. Cost dashboards show the damage after the fact: $5-$15 per runaway loop on Sonnet with a 3-tool agent, assuming no tool is itself expensive. Silent tool errors on legacy AgentExecutor (P09). The legacy executor defaults handleparsingerrors=True and catches tool exceptions, feeding the error string back as the next observation. When the error serializes to empty (e.g., a ValueError("") or an HTTP 500 with no body), the loop continues with no signal. The agent says "I couldn't find the answer" — which was actually a silent crash three tool calls ago. This skill walks through defining typed tools with @tool + Pydantic; building an agent with createreactagent(model, tools, checkpointer=MemorySaver()); invoking with {"messages": [...]} and a thread-scoped config; setting recursionlimit per expected agent depth (5-10 interactive, 20-30 planner); adding middleware for a per-session token budget; and raise-by-default error propagation. Pin: langgraph >= 1.0, < 2.0, langchain-core >= 1.0, < 2.0. Pain-catalog anchors: P09, P10, P11, P32, P41, P42, P63. Prerequisites Python 3.10+ langgraph >= 1.0, < 2.0 and langchain-core >= 1.0, < 2.0 At least one provider package: pip install langchain-anthropic or langchain-openai Completed skill: langchain-langgraph-basics (L25) — you already know StateGraph, MessagesState, and checkpointers Provider API key: ANTHROPICAPIKEY or OPENAIAPIKEY Instructions Step 1 — Define tools with typed schemas and short docstrings Two rules that catch teams off-guard: 1. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills jeremylongshore/langchain-langgraph-agents--8c624f

View the source on GitHub

Browse the @skills marketplace