Community生产力与协作github.com

langchain-ai/langgraph-人在回路中

在实现人机协作模式、暂停等待审批或处理LangGraph中的错误时,请调用此技能。涵盖interrupt()、Command(resume=...)、审批/验证工作流以及四级错误处理策略。

langgraph-人在回路中 是什么?

此技能专注于在LangGraph中实现“人在回路中”(Human-in-the-Loop)模式,当AI代理需要人工审批、验证或处理错误时,可暂停执行并等待人工干预。它详细介绍了如何使用`interrupt()`函数在特定节点暂停图执行,以及通过`Command(resume=...)`恢复执行并传递人工输入。此外,该技能涵盖了审批和验证工作流的构建方法,以及一套四级错误处理策略,从简单的重试到复杂的回退路径。支持LangGraph框架,适用于需要人工监督的自动化工作流场景,如安全敏感操作、数据验证或复杂决策的最终确认。通过此技能,开发者可以轻松集成人工审核环节,确保AI代理的行为符合预期。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/langchain-ai/langchain-skills/tree/main/skills/langgraph-human-in-the-loop

Installed? Explore more 生产力与协作 skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

langgraph-人在回路中 是做什么的?

在实现人机协作模式、暂停等待审批或处理LangGraph中的错误时,请调用此技能。涵盖interrupt()、Command(resume=...)、审批/验证工作流以及四级错误处理策略。

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

langchain-ai/deep-agents-core

INVOKE THIS SKILL when building ANY Deep Agents application. Covers create_deep_agent(), harness architecture, SKILL.md format, and configuration options.

langchain-ai/deep-agents-memory

INVOKE THIS SKILL when your Deep Agent needs memory, persistence, or filesystem access. Covers StateBackend (ephemeral), StoreBackend (persistent), FilesystemMiddleware, and CompositeBackend for routing.

langchain-ai/deep-agents-orchestration

INVOKE THIS SKILL when using subagents, task planning, or human approval in Deep Agents. Covers SubAgentMiddleware, TodoList for planning, and HITL interrupts.

langchain-ai/framework-selection

INVOKE THIS SKILL at the START of any LangChain/LangGraph/Deep Agents project, before writing any agent code. Determines which framework layer is right for the task: LangChain, LangGraph, Deep Agents, or a combination. Must be consulted before other agent skills.

langchain-ai/langchain-dependencies

INVOKE THIS SKILL when setting up a new project or when asked about package versions, installation, or dependency management for LangChain, LangGraph, LangSmith, or Deep Agents. Covers required packages, minimum versions, environment requirements, versioning best practices, and common community tool packages for both Python and TypeScript.

langchain-ai/langchain-fundamentals

Create LangChain agents with create_agent, define tools, and use middleware for human-in-the-loop and error handling.

langchain-ai/langchain-middleware

INVOKE THIS SKILL when you need human-in-the-loop approval, custom middleware, or structured output. Covers HumanInTheLoopMiddleware for human approval of dangerous tool calls, creating custom middleware with hooks, Command resume patterns, and structured output with Pydantic/Zod.

langchain-ai/langchain-rag

INVOKE THIS SKILL when building ANY retrieval-augmented generation (RAG) system. Covers document loaders, RecursiveCharacterTextSplitter, embeddings (OpenAI), and vector stores (Chroma, FAISS, Pinecone).

langchain-ai/langgraph-fundamentals

INVOKE THIS SKILL when writing ANY LangGraph code. Covers StateGraph, state schemas, nodes, edges, Command, Send, invoke, streaming, and error handling.

langchain-ai/langgraph-persistence

INVOKE THIS SKILL when your LangGraph needs to persist state, remember conversations, travel through history, or configure subgraph checkpointer scoping. Covers checkpointers, thread_id, time travel, Store, and subgraph persistence modes.

langchain-ai/swarm

Dispatches many independent items in parallel: create a table, fan out to subagents, aggregate results. One row = one unit of work.

相关技能