langgraph-human-in-the-loop

仓库创建 2026年1月22日最近提交 7 小时前SkillHot 收录 1 小时前
▸ 精选理由

便于在关键步骤加入人工审批与回溯恢复流程。

▸ 风险提示

涉及保存执行状态与用户输入,注意隐私与持久化安全。

这个 Skill 做什么

在 LangGraph 中实现人类审批、暂停/恢复与分层错误处理模式。

在 LangGraph 流程里插入人工审批或暂停/恢复的机制,把当前状态抛给人来审核再继续执行。适合需要人工核准、验证输入或分层错误处理的工作流。关键点是用 interrupt()/Command(resume=...) 配合 Checkpointer 和线程 ID 来保存、展示并恢复运行状态。

▸ 展开 SKILL.md 英文原文

INVOKE THIS SKILL when implementing human-in-the-loop patterns, pausing for approval, or handling errors in LangGraph. Covers interrupt(), Command(resume=...), approval/validation workflows, and the 4-tier error handling strategy.

开发编程人机协同中断与恢复错误分层通用
1.1k
Stars
85
Forks
22
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/langchain-ai/langchain-skills/main/config/skills/langgraph-human-in-the-loop/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/langchain-ai/langchain-skills/main/config/skills/langgraph-human-in-the-loop/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
<overview>
LangGraph's human-in-the-loop patterns let you pause graph execution, surface data to users, and resume with their input:

- **`interrupt(value)`** — pauses execution, surfaces a value to the caller
- **`Command(resume=value)`** — resumes execution, providing the value back to `interrupt()`
- **Checkpointer** — required to save state while paused
- **Thread ID** — required to identify which paused execution to resume
</overview>

---

## Requirements

Three things are required for interrupts to work:

1. **Checkpointer** — compile with `checkpointer=InMemorySaver()` (dev) or `PostgresSaver` (prod)
2. **Thread ID** — pass `{"configurable": {"thread_id": "..."}}` to every `invoke`/`
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有