Token导航 LogoToken导航TokenDH.com
开发external-servicegithub未标认证来源可访问许可证需确认审计提醒

langgraphlanggraph 图表绘制

Agent Skill

langgraph 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,263

周安装

132

GitHub Stars

161

下载量

1,024
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:langgraph(langgraph 图表绘制)
来源仓库:https://github.com/yonatangross/orchestkit
仓库路径:skills/langgraph
安装命令:
npx skills add https://github.com/yonatangross/orchestkit --skill langgraph
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill langgraph

简介

用于处理 LangGraph 工作流相关的开发协作事项。

  • 适合围绕仓库状态和代码变更进行进度管理。langgraph 属于开发类 Skill,可作为该场景下的辅助能力补充。
  • 可结合原始 README 了解图结构定义规范。
  • 安装前建议确认 Python 环境满足依赖要求。
  • 注意复杂图结构可能导致调试困难需谨慎设计。

SKILL.md

LangGraph Workflow Patterns

Comprehensive patterns for building production LangGraph workflows. LangGraph 1.x is LTS (Long Term Support) — the first stable major release, powering agents at Uber, LinkedIn, and Klarna. Each category has individual rule files in rules/ loaded on-demand.

LangGraph 1.2 (Q1 2026) — new in this bump: - Deferred nodes (defer=True on add_node) — the node runs only after all *other* upstream nodes for the current super-step have completed, which makes "aggregate once everyone else is done" patterns a one-liner instead of a custom reducer. - Pre/post model hooks on create_react_agent(...) and ToolNode — inject compression, summarization, or PII redaction without subclassing. - Node-level caching via CachePolicy(ttl=..., key_func=...) with SqliteCache and RedisCache backends (pluggable via graph.compile(cache=...)). Idempotent nodes skip recomputation on replay.

Quick Reference

CategoryRulesImpactWhen to Use
State Management4CRITICALDesigning workflow state schemas, accumulators, reducers
Routing & Branching4HIGHDynamic routing, retry loops, semantic routing, cross-graph
Parallel Execution3HIGHFan-out/fan-in, map-reduce, concurrent agents
Supervisor Patterns3HIGHCentral coordinators, round-robin, priority dispatch
Tool Calling4CRITICALBinding tools, ToolNode, dynamic selection, approvals
Checkpointing3HIGHPersistence, recovery, cross-thread Store memory
Human-in-Loop3MEDIUMApproval gates, feedback loops, interrupt/resume
Streaming3MEDIUMReal-time updates, token streaming, custom events
Subgraphs3MEDIUMModular composition, nested graphs, state mapping
Functional API3MEDIUM@entrypoint/@task decorators, migration from StateGraph
Platform3HIGHDeployment, RemoteGraph, double-texting strategies

Total: 37 rules across 11 categories

State Management

State schemas determine how data flows between nodes. Wrong schemas cause silent data loss.

RuleFileKey Pattern
TypedDict Staterules/state-typeddict.mdTypedDict + Annotated[list, add] for accumulators
Pydantic Validationrules/state-pydantic.mdBaseModel at boundaries, TypedDict internally
MessagesStaterules/state-messages.mdMessagesState or add_messages reducer
Custom Reducersrules/state-reducers.mdAnnotated[T, reducer_fn] for merge/overwrite

Routing & Branching

Control flow between nodes. Always include END fallback to prevent hangs.

RuleFileKey Pattern
Conditional Edgesrules/routing-conditional.mdadd_conditional_edges with explicit mapping
Retry Loopsrules/routing-retry-loops.mdLoop-back edges with max retry counter
Semantic Routingrules/routing-semantic.mdEmbedding similarity or Command API routing
Cross-Graph Navigationrules/routing-cross-graph.mdCommand(graph=Command.PARENT) for parent/sibling routing

Parallel Execution

Run independent nodes concurrently. Use Annotated[list, add] to accumulate results.

RuleFileKey Pattern
Fan-Out/Fan-Inrules/parallel-fanout-fanin.mdSend API for dynamic parallel branches
Map-Reducerules/parallel-map-reduce.mdasyncio.gather + result aggregation
Error Isolationrules/parallel-error-isolation.mdreturn_exceptions=True + per-branch timeout

Supervisor Patterns

Central coordinator routes to specialized workers. Workers return to supervisor.

RuleFileKey Pattern
Basic Supervisorrules/supervisor-basic.mdCommand API for state update + routing
Priority Routingrules/supervisor-priority.mdPriority dict ordering agent execution
Round-Robinrules/supervisor-round-robin.mdCompletion tracking with agents_completed

Tool Calling

Integrate function calling into LangGraph agents. Keep tools under 10 per agent.

RuleFileKey Pattern
Tool Bindingrules/tools-bind.mdmodel.bind_tools(tools) + tool_choice
ToolNode Executionrules/tools-toolnode.mdToolNode(tools) prebuilt parallel executor
Dynamic Selectionrules/tools-dynamic.mdEmbedding-based tool relevance filtering
Tool Interruptsrules/tools-interrupts.mdinterrupt() for approval gates on tools

Checkpointing

Persist workflow state for recovery and debugging.

RuleFileKey Pattern
Checkpointer Setuprules/checkpoints-setup.mdMemorySaver dev / PostgresSaver prod
State Recoveryrules/checkpoints-recovery.mdthread_id resume + get_state_history
Cross-Thread Storerules/checkpoints-store.mdStore for long-term memory across threads

Node-Level Caching (1.2+)

Independent of checkpointing. Cache individual node output so re-runs with identical inputs skip execution entirely.

from langgraph.graph import StateGraph
from langgraph.cache import CachePolicy, SqliteCache

graph = StateGraph(State)
graph.add_node(
    "expensive_fetch",
    fetch_fn,
    cache_policy=CachePolicy(ttl=3600, key_func=lambda s: s["query"]),
)
# RedisCache(url=...) for distributed workers
compiled = graph.compile(cache=SqliteCache("cache.db"))

Use when a node is idempotent and expensive (embeddings, external APIs). Do not use for nodes whose output depends on wall-clock time or mutable external state unless key_func captures that variance.

Deferred Nodes & Model Hooks (1.2+)

# defer=True — node waits for every other upstream node at this super-step
graph.add_node("aggregate", aggregate_fn, defer=True)

# Pre/post model hooks — no subclassing required
from langgraph.prebuilt import create_react_agent

agent = create_react_agent(
    model=model,
    tools=tools,
    pre_model_hook=compress_history,   # e.g. summarize if > N tokens
    post_model_hook=redact_pii,        # e.g. scrub emails/SSNs before persist
)

Human-in-Loop

Pause workflows for human intervention. Requires checkpointer for state persistence.

RuleFileKey Pattern
Interrupt/Resumerules/human-in-loop-interrupt.mdinterrupt() function + Command(resume=)
Approval Gaterules/human-in-loop-approval.mdinterrupt_before + state update + resume
Feedback Looprules/human-in-loop-feedback.mdIterative interrupt until approved

Streaming

Real-time updates and progress tracking for workflows. LangGraph 1.1 introduces version="v2" — an opt-in streaming format with full type safety on stream(), astream(), invoke(), and ainvoke().

RuleFileKey Pattern
Stream Modesrules/streaming-modes.md5 modes: values, updates, messages, custom, debug
Token Streamingrules/streaming-tokens.mdmessages mode with node/tag filtering
Custom Eventsrules/streaming-custom-events.mdget_stream_writer() for progress events
Streaming v2rules/streaming-v2-format.mdversion="v2" for typed streaming (LG 1.1+)

Subgraphs

Compose modular, reusable workflow components with nested graphs.

RuleFileKey Pattern
Invoke from Noderules/subgraphs-invoke.mdDifferent schemas, explicit state mapping
Add as Noderules/subgraphs-add-as-node.mdShared state, add_node(name, compiled_graph)
State Mappingrules/subgraphs-state-mapping.mdBoundary transforms between parent/child

Functional API

Build workflows using @entrypoint and @task decorators instead of explicit graph construction.

RuleFileKey Pattern
@entrypointrules/functional-entrypoint.mdWorkflow entry point with optional checkpointer
@taskrules/functional-task.mdReturns futures, .result() to block
Migrationrules/functional-migration.mdStateGraph to Functional API conversion

Platform

Deploy graphs as managed APIs with persistence, streaming, and multi-tenancy.

RuleFileKey Pattern
Deploymentrules/platform-deployment.mdlanggraph.json + CLI + Assistants API
RemoteGraphrules/platform-remote-graph.mdRemoteGraph for calling deployed graphs
Double Textingrules/platform-double-texting.md4 strategies: reject, rollback, enqueue, interrupt

Quick Start Example

from langgraph.graph import StateGraph, START, END
from langgraph.types import Command
from typing import TypedDict, Annotated, Literal
from operator import add

class State(TypedDict):
    input: str
    results: Annotated[list[str], add]

def supervisor(state) -> Command[Literal["worker", END]]:
    if not state.get("results"):
        return Command(update={"input": state["input"]}, goto="worker")
    return Command(goto=END)

def worker(state) -> dict:
    return {"results": [f"Processed: {state['input']}"]}

graph = StateGraph(State)
graph.add_node("supervisor", supervisor)
graph.add_node("worker", worker)
graph.add_edge(START, "supervisor")
graph.add_edge("worker", "supervisor")
app = graph.compile()

2026 Key Patterns

  • Streaming v2 (LG 1.1): Use version="v2" for type-safe streaming — fully typed stream() and astream() returns. Default remains "v1" for backwards compat.
  • Command API: Use Command(update=..., goto=...) when updating state AND routing together
  • context_schema: Pass runtime config (temperature, provider) without polluting state
  • CachePolicy: Cache expensive node results with TTL via InMemoryCache
  • RemainingSteps: Proactively handle recursion limits
  • Store: Cross-thread memory separate from Checkpointer (thread-scoped)
  • interrupt(): Dynamic interrupts inside node logic (replaces interrupt_before for conditional cases)
  • add_edge(START, node): Not set_entry_point() (deprecated)
  • LTS release: LangGraph 1.x is LTS — will remain ACTIVE until v2.0

Key Decisions

DecisionRecommendation
State typeTypedDict internally, Pydantic at boundaries
Entry pointadd_edge(START, node) not set_entry_point()
Routing + state updateCommand API
Routing onlyConditional edges
AccumulatorsAnnotated[list[T], add] always
Dev checkpointerMemorySaver
Prod checkpointerPostgresSaver
Short-term memoryCheckpointer (thread-scoped)
Long-term memoryStore (cross-thread, namespaced)
Max parallel branches5-10 concurrent
Tools per agent5-10 max (dynamic selection for more)
Approval gatesinterrupt() for high-risk operations
Stream modes["updates", "custom"] for most UIs
Subgraph patternInvoke for isolation, Add-as-Node for shared state
Functional vs GraphFunctional for simple flows, Graph for complex topology

Common Mistakes

  1. Forgetting add reducer (overwrites instead of accumulates)
  2. Mutating state in place (breaks checkpointing)
  3. No END fallback in routing (workflow hangs)
  4. Infinite retry loops (no max counter)
  5. Side effects in router functions
  6. Too many tools per agent (context overflow)
  7. Raising exceptions in tools (crashes agent loop)
  8. No checkpointer in production (lose progress on crash)
  9. Wrapping interrupt() in try/except (breaks the mechanism)
  10. Not transforming state at subgraph boundaries
  11. Forgetting .result() on Functional API tasks
  12. Using set_entry_point() (deprecated, use add_edge(START,...))

Evaluations

See test-cases.json for consolidated test cases across all categories.

Related Skills

  • ork:agent-orchestration - Higher-level multi-agent coordination, ReAct loop patterns, and framework comparisons
  • temporal-io - Durable execution alternative
  • ork:llm-integration - General LLM function calling
  • type-safety-validation - Pydantic model patterns

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.81%
按下载量换算377

Claude

32.72%
按下载量换算335

Cursor

17.77%
按下载量换算182

Gemini CLI

9.5%
按下载量换算97

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills