langgraph-state-graph
LangGraph StateGraph builder with state schema design. Create stateful agent workflows with cycles, conditionals, and persistence.
Install / Use
npx skills add a5c-ai/babysitter --skill langgraph-state-graphInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
AutomationSupported Platforms
Our assessment of langgraph-state-graph
langgraph-state-graph scores 92/100 on our quality scale, 881st of 2,790 Automation skills we index (top 32%).
Its SKILL.md is 6.9 KB long, well organised into 31 sections with 5 code examples: a thorough specification that gives an agent plenty to work with.
With 1,809 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated about 2 months ago, so langgraph-state-graph is actively maintained.
- Our last check on 2026-10-27 found the source still online.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.
AI review by kimi-k2.7-code on 2026-09-30. Automated pattern scan on 2026-09-30. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
langgraph-state-graph compared with similar skills
All 4 of these similar skills score higher than langgraph-state-graph; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| langgraph-state-graph (this skill)by a5c-ai | 92 | 1.8k | 2mo ago | SKILL.md |
| taste-skillby Leonxlnx | 100 | 116.8k | 8d ago | CLAUDE.md |
| Agent-Reachby Panniantong | 100 | 112.3k | 8d ago | CLAUDE.md |
| rufloby ruvnet | 100 | 81.9k | today | CLAUDE.md |
| Claude-Code-Game-Studiosby Donchitos | 100 | 39.7k | 7d ago | CLAUDE.md |
Frequently asked questions
- How do I install langgraph-state-graph?
- Run
npx skills add a5c-ai/babysitter --skill langgraph-state-graph. The install tabs above show the steps for each supported agent. - Which AI agents does langgraph-state-graph work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is langgraph-state-graph safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is langgraph-state-graph still maintained?
- The repository was last updated about 2 months ago, so langgraph-state-graph is actively maintained.
Skill content
View source on GitHubname: langgraph-state-graph description: LangGraph StateGraph builder with state schema design. Create stateful agent workflows with cycles, conditionals, and persistence. allowed-tools: Read, Grep, Write, Edit, Bash, Glob, WebFetch graph: domains: [domain:software-engineering] specializations: [specialization:ai-agents-conversational] skillAreas: [skill-area:agentic-loops, skill-area:agent-planning-reasoning] roles: [role:ml-engineer, role:backend-engineer] workflows: [workflow:feature-development, workflow:ml-model-lifecycle] topics: [topic:design-patterns, topic:event-driven-architecture]
langgraph-state-graph
Build stateful agent workflows using LangGraph's StateGraph pattern. Design state schemas, create nodes, define edges with conditional routing, and enable persistence.
Overview
LangGraph is a library for building stateful, multi-actor applications with LLMs. The StateGraph is the core abstraction that enables:
- Cyclical computation graphs (unlike DAGs)
- State persistence and checkpointing
- Human-in-the-loop interaction patterns
- Conditional branching and routing
- Multi-agent coordination
Capabilities
State Schema Design
- Define typed state schemas with TypedDict or Pydantic
- Configure state channels for message passing
- Set up reducer functions for state updates
- Design accumulator patterns for conversation history
Graph Construction
- Create nodes as functions or runnables
- Define edges (normal, conditional, entry points)
- Configure start and end nodes
- Implement routing logic for conditional edges
Persistence & Checkpointing
- Configure checkpoint backends (SQLite, PostgreSQL, Redis)
- Enable state snapshots at each step
- Support for resuming interrupted workflows
- Thread-based conversation persistence
Human-in-the-Loop
- Insert interrupt points in workflows
- Collect human feedback before continuing
- Support approval gates and input collection
- Resume from interrupt with updated state
Usage
Basic StateGraph Pattern
from typing import TypedDict, Annotated
from langgraph.graph import StateGraph, END
from langgraph.graph.message import add_messages
# Define state schema
class AgentState(TypedDict):
messages: Annotated[list, add_messages]
current_step: str
iteration: int
# Create nodes
def agent_node(state: AgentState) -> AgentState:
# Process state and return updates
return {"current_step": "processed", "iteration": state["iteration"] + 1}
def tool_node(state: AgentState) -> AgentState:
# Execute tools based on agent decisions
return {"current_step": "tools_executed"}
# Build graph
graph = StateGraph(AgentState)
graph.add_node("agent", agent_node)
graph.add_node("tools", tool_node)
# Define edges
graph.set_entry_point("agent")
graph.add_edge("agent", "tools")
graph.add_conditional_edges(
"tools",
lambda state: "end" if state["iteration"] >= 3 else "continue",
{"end": END, "continue": "agent"}
)
# Compile
app = graph.compile()
Conditional Routing
def router(state: AgentState) -> str:
"""Route based on state conditions."""
last_message = state["messages"][-1]
if hasattr(last_message, "tool_calls") and last_message.tool_calls:
return "tools"
elif state["iteration"] >= state.get("max_iterations", 10):
return "end"
else:
return "agent"
graph.add_conditional_edges(
"agent",
router,
{
"tools": "tool_executor",
"agent": "agent",
"end": END
}
)
Persistence with Checkpointing
from langgraph.checkpoint.sqlite import SqliteSaver
# Configure checkpointer
memory = SqliteSaver.from_conn_string(":memory:")
# Compile with persistence
app = graph.compile(checkpointer=memory)
# Run with thread_id for persistence
config = {"configurable": {"thread_id": "conversation-1"}}
result = app.invoke(initial_state, config=config)
# Resume from checkpoint
result = app.invoke(None, config=config) # Continues from last state
Human-in-the-Loop
from langgraph.graph import StateGraph
graph = StateGraph(AgentState)
# ... add nodes ...
# Compile with interrupt points
app = graph.compile(
checkpointer=memory,
interrupt_before=["tool_executor"] # Pause before tool execution
)
# First invocation - pauses at interrupt
result = app.invoke(initial_state, config)
# After human approval, resume
result = app.invoke(None, config) # Continues past interrupt
Task Definition
const langgraphStateGraphTask = defineTask({
name: 'langgraph-state-graph-design',
description: 'Design and implement a LangGraph StateGraph workflow',
inputs: {
workflowName: { type: 'string', required: true },
stateSchema: { type: 'object', required: true },
nodes: { type: 'array', required: true },
edges: { type: 'array', required: true },
enablePersistence: { type: 'boolean', default: true },
interruptPoints: { type: 'array', default: [] }
},
outputs: {
graphCode: { type: 'string' },
stateSchemaCode: { type: 'string' },
compiledGraph: { type: 'boolean' },
artifacts: { type: 'array' }
},
async run(inputs, taskCtx) {
return {
kind: 'skill',
title: `Design StateGraph: ${inputs.workflowName}`,
skill: {
name: 'langgraph-state-graph',
context: {
workflowName: inputs.workflowName,
stateSchema: inputs.stateSchema,
nodes: inputs.nodes,
edges: inputs.edges,
enablePersistence: inputs.enablePersistence,
interruptPoints: inputs.interruptPoints,
instructions: [
'Analyze workflow requirements and state needs',
'Design state schema with proper typing',
'Create node functions with state transformations',
'Define edges and conditional routing logic',
'Configure persistence if enabled',
'Add interrupt points for human-in-the-loop',
'Compile and validate the graph'
]
}
},
io: {
inputJsonPath: `tasks/${taskCtx.effectId}/input.json`,
outputJsonPath: `tasks/${taskCtx.effectId}/result.json`
}
};
}
});
Applicable Processes
- langgraph-workflow-design
- multi-agent-system
- plan-and-execute-agent
- conversational-memory-system
External Dependencies
- langgraph Python package
- langchain-core
- Optional: langgraph-checkpoint-sqlite, langgraph-checkpoint-postgres
References
Related Skills
- SK-LG-002 langgraph-checkpoint
- SK-LG-003 langgraph-hitl
- SK-LG-004 langgraph-routing
- SK-LG-005 langgraph-subgraph
Related Agents
- AG-AA-004 langgraph-workflow-designer
- AG-MEM-004 state-machine-designer
Related Skills
taste-skill
116.8kAgent skills that give coding agents taste: art direction, reference images and a browser check instead of generic AI pages
Agent-Reach
112.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
ruflo
81.9k🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated
Claude-Code-Game-Studios
39.7kTurn Claude Code into a full game dev studio — 49 AI agents, 72 workflow skills, and a complete coordination system mirroring real studio hierarchy.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
