langgraph-fundamentals

Implements LangGraph agent workflows using StateGraph, nodes, edges, Command, and Send.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/orezek/monorepo_template --skill langgraph-fundamentals-orezek
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: langgraph-fundamentals
Source: https://github.com/orezek/monorepo_template/tree/main/.agents/skills/langgraph-fundamentals
Command: npx skills add https://github.com/orezek/monorepo_template --skill langgraph-fundamentals-orezek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing LangGraph code involves many subtle pitfalls: forgotten reducers that silently overwrite state, uncompiled graphs that fail at runtime, infinite loops without exit conditions, and confusion between Command and Send for routing. This Skill provides the correct patterns and common fixes for building stateful agent graphs in both Python and TypeScript. ## Core Features & Use Cases - Graph Construction Patterns: Covers StateGraph, state schemas with reducers, node function signatures, static and conditional edges, and the mandatory compile() step. - Routing & Parallelism: Explains Command for combined state updates and routing, and the Send API for fan-out orchestrator-worker patterns with result aggregation. - Execution & Error Handling: Details invoke and stream modes (values, updates, messages, custom), RetryPolicy for transient errors, and ToolNode error recovery. - Use Case: You are building a multi-step agent that classifies queries, fans out to parallel workers, and streams LLM tokens to a chat UI. Use this Skill to get the correct state schema, conditional edges, Send-based fan-out, and streaming configuration without hitting the common mistakes. ## Quick Start Use the langgraph-fundamentals skill to help me build a LangGraph workflow with a classifier node, conditional routing, and parallel workers that aggregate results.

Frequently Asked Questions about langgraph-fundamentals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a LangGraph workflow with StateGraph?▼

Define a state schema, add node functions that return partial state updates, connect them with add_edge or add_conditional_edges, then call compile() before invoking. Follow the five-step design process: map steps, identify node types, design state, build nodes, and wire edges.

When should I use LangGraph vs LangChain agents?▼

Use LangGraph when you need fine-grained control over orchestration, complex workflows with branching or loops, or human-in-the-loop and persistence features. Use LangChain agents for quick prototyping and simple stateless workflows, or Deep Agents for batteries-included features.

Why is my LangGraph state list being overwritten instead of appended?▼

List fields without a reducer are overwritten by each node update, so only the last write survives. In Python use Annotated[list, operator.add]; in TypeScript use ReducedValue with a concat reducer to accumulate values across nodes.

How do I stream LLM tokens from a LangGraph graph?▼

Call graph.stream with stream_mode set to "messages" to receive LLM tokens plus metadata as they are generated. Other modes include values for full state, updates for state deltas, and custom for user-defined progress data emitted via a stream writer.

What is the difference between Command and Send in LangGraph?▼

Command combines a state update and a goto routing decision in a single node return value. Send is returned from a conditional edge to fan out to multiple parallel workers with dynamic inputs, and requires a reducer on the results field to aggregate outputs.

Why does my LangGraph graph fail with AttributeError when I call invoke?▼

The graph builder is not executable until you call compile(). Invoke the compiled graph returned by builder.compile(), not the builder itself, and in TypeScript remember to await the invoke call since it returns a Promise.