langgraph
Build, run, persist, deploy, and operate LangGraph Python applications using the core runtime, prebuilt agents, checkpointing, CLI, and SDK clients.
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 11
- Forks
- 3
01 前言 Front Matter
- name
- langgraph
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Build, run, persist, deploy, and operate LangGraph Python applications using the core runtime, prebuilt agents, checkpointing, CLI, and SDK clients.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/package-map.md2.7 KB
- 参考文档references/repo-provenance.md2.3 KB
- 参考文档references/repo-routing-metadata.json506 B
- 参考文档references/troubleshooting.md3.1 KB
03 SKILL.md 正文
LangGraph
Use this skill when a task involves LangGraph, the low-level orchestration framework for building stateful agents and long-running workflows. It covers the Python monorepo packages langgraph, langgraph-prebuilt, langgraph-checkpoint, langgraph-checkpoint-sqlite, langgraph-checkpoint-postgres, langgraph-cli, and langgraph-sdk.
Quick Start
Install the core package for most application work:
pip install -U langgraph
For focused packages or deployment tooling:
pip install -U langgraph-cli
pip install -U langgraph-sdk
pip install -U langgraph-checkpoint-sqlite
pip install -U langgraph-checkpoint-postgres "psycopg[binary]"
Minimal import and graph smoke check:
from typing_extensions import TypedDict
from langgraph.graph import END, START, StateGraph
class State(TypedDict):
value: int
def inc(state: State) -> State:
return {"value": state["value"] + 1}
builder = StateGraph(State)
builder.add_node("inc", inc)
builder.add_edge(START, "inc")
builder.add_edge("inc", END)
app = builder.compile()
assert app.invoke({"value": 1})["value"] == 2
Route by Task
- Custom graphs and runtime behavior: Use
sub-skills/graph-runtime/SKILL.mdforStateGraph, reducers, node signatures, conditional edges,Command,Send, interrupts, streaming, subgraphs, low-levelPregel, and runtime debugging. - Prebuilt agents and tools: Use
sub-skills/prebuilt-agents/SKILL.mdforcreate_react_agent,ToolNode,ValidationNode, injected state/store/runtime, tool-call errors, structured responses, and human interrupt payloads. - Persistence and memory: Use
sub-skills/persistence/SKILL.mdfor checkpointers,thread_id, checkpoint resume, SQLite, Postgres, in-memory savers,InMemoryStore, semantic search, and serde hardening. - CLI and deployment: Use
sub-skills/cli-deployment/SKILL.mdforlanggraph new,dev,up,build,dockerfile,validate,langgraph.json, Docker/server configuration, and local deployment troubleshooting. - SDK clients and streaming: Use
sub-skills/sdk-clients/SKILL.mdfor Python async/sync SDK clients, assistants, threads, runs, cron, store APIs, v3 thread-centric streaming, auth headers, and JS SDK relocation status.
Shared References and Scripts
- Read
references/repo-provenance.mdwhen deciding whether this skill matches a checkout or should be refreshed. - Read
references/package-map.mdto map user requests to the monorepo packages, install commands, import modules, and common optional dependencies. - Read
references/troubleshooting.mdfor cross-cutting install, import, config, service, security, and version-mismatch failures before drilling into a sub-skill’s troubleshooting file. - Run
scripts/run_core_smokes.py --helpor selected smoke checks when validating a LangGraph environment without relying on the original repository checkout.
Common Decisions
- Choose
StateGraphwhen a task needs custom state schemas, deterministic routing, reducers, subgraphs, or precise interrupt/resume control. - Choose prebuilt agent APIs when the task is primarily a tool-calling chat agent and does not need a fully custom graph loop.
- Use an in-memory checkpointer only for tests, local demos, or debugging; use SQLite for lightweight local persistence and Postgres for durable multi-process or production persistence.
- Use
langgraph devfor local hot-reload development,langgraph upfor a local Docker API server,langgraph buildfor an image, andlanggraph dockerfilewhen a user needs to review or customize the generated container recipe. - Use the SDK only when there is a running LangGraph API server or deployment; local graph construction/invocation does not require
langgraph-sdk.
Verification Checklist
- Confirm package imports with the relevant sub-skill smoke script.
- Compile a minimal graph before adding persistence, tools, or deployment configuration.
- If persistence is involved, invoke with
config={"configurable": {"thread_id": "..."}}and verify resume/list behavior. - If serving with the CLI, validate
langgraph.jsonbefore runningdev,up, orbuild. - If using the SDK, verify URL/auth selection and streaming mode against the server being targeted.
Safety and Scope
This skill is self-contained. Do not require the original LangGraph repository checkout for runtime use. The bundled references and scripts distill repo evidence into reusable guidance; original tests and examples remain verification evidence, not runtime dependencies.
04 同仓库更多 Skills
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
obsidian-clipper-template-creator
Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.
python-api
Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP/mAP semantics, and source-style import diagnostics.
file-evaluation
Folder-based PASCAL VOC AP/mAP evaluation from ground-truth and detection text files.
object-detection-metrics
Guides legacy Object-Detection-Metrics PASCAL VOC AP/mAP evaluation from detection text folders and direct Python API classes.
nx-workspace-patterns
Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.