langchain-ai avatar

Langgraph Fundamentals

A comprehensive reference for building agent workflows with LangGraph's state-based approach. Covers the essential patterns you'll need: designing state schemas with proper reducers (so your message lists actually append instead of overwrite), implementing nodes that return partial state updates, and wiring together conditional edges. The 5-step design methodology is solid for mapping complex workflows to graphs. Includes TypeScript and Python examples for StateGraph basics, Command/Send for advanced routing, and streaming patterns. Most useful when you need fine-grained control over agent orchestration beyond what basic LangChain agents provide.

skills.sh installs
18.9K
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add langchain-ai/langchain-skills --skill langgraph-fundamentals --agent claude-code

Installs into .claude/skills of the current project.

Files

LangGraph models agent workflows as **directed graphs**:
  • StateGraph: Main class for building stateful graphs
  • Nodes: Functions that perform work and update state
  • Edges: Define execution order (static or conditional)
  • START/END: Special nodes marking entry and exit points
  • State with Reducers: Control how state updates are merged

Graphs must be compile()d before execution.

Designing a LangGraph application

Follow these 5 steps when building a new graph:

  1. Map out discrete steps — sketch a flowchart of your workflow. Each step becomes a node.
  2. Identify what each step does — categorize nodes: LLM step, data step, action step, or user input step. For each, determine static context (prompt), dynamic context (from state), retry strategy, and desired outcome.
  3. Design your state — state is shared memory for all nodes. Store raw data, format prompts on-demand inside nodes.
  4. Build your nodes — implement each step as a function that takes state and returns partial updates.
  5. Wire it together — connect nodes with edges, add conditional routing, compile with a checkpointer if needed.

Sponsors

Details

Repository
github.com/langchain-ai/langchain-skills
Categories
Documentation, AI & Agent Building, Debugging

More from langchain-ai/langchain-skills

All 15
1ejirocodes avatarsvelte5-best-practicesejirocodes/agent-skillsSvelte 5 runes, snippets, SvelteKit patterns, and modern best practices for TypeScript and component development. Use when writing, reviewing, or refactoring Sv18.6Kskills.sh installs
2yuan1z0825 avatarnature-polishingyuan1z0825/nature-skillsPolish, restructure, or translate academic prose into Nature-leaning English using writing-strategy principles, curated Nature/Nature Communications article pat18.6Kskills.sh installs
3tavily-ai avatartavily-clitavily-ai/skillsWeb search, content extraction, crawling, and deep research via the Tavily CLI. Use this skill whenever the user wants to search the web, find articles, researc18.4Kskills.sh installs
4avdlee avatarswift-concurrencyavdlee/swift-concurrency-agent-skillDiagnose Swift Concurrency issues, refactor callback-based code to async/await, and guide Swift 6 migration when working with tasks, actors, @MainActor, Sendabl17.5Kskills.sh installs
5yuan1z0825 avatarnature-citationyuan1z0825/nature-skillsAdd strict Nature/CNS citations to manuscript text by splitting long passages into citable segments, searching only accepted flagship and subjournal titles from16.6Kskills.sh installs
6jackwener avataropencli-adapter-authorjackwener/opencliUse when writing an OpenCLI adapter for a new site or adding a new command to an existing site. Guides end-to-end from first recon through field decoding, adapt16.5Kskills.sh installs