Skip to main content
Back to registry

langchain-middleware

langchain-ai/langchain-skills

Requirements: Checkpointer + thread_id config for all HITL workflows.

Installs1
Install command
npx skills add https://github.com/langchain-ai/langchain-skills --skill langchain-middleware
Security audits
Gen Agent Trust HubPASS
SocketPASS
SnykPASS
About this skill
Requirements: Checkpointer + thread_id config for all HITL workflows. @tool def send_email(to: str, subject: str, body: str) -> str: """Send an email.""" return f"Email sent to {to}" agent = create_agent( model="gpt-4.1", tools=[send_email], checkpointer=MemorySaver(), # Required for HITL middleware=[ HumanInTheLoopMiddleware( interrupt_on={ "send_email": {"allowed_decisions": ["approve", "edit", "reject"]}, } ) ], ) config = {"configurable": {"thread_id": "session-1"}} result1 = agent.invoke({ "messages": [{"role": "user", "content": "Send email to john@example.com "}] }, config=config) if " interrupt " in result1: print(f"Waiting for approval: {result1[' interrupt ']}") result2 = agent.invoke( Command(resume={"decisions": [{"type": "approve"}]}), config=config ) agent = create_agent( model="gpt-4.1", tools=[send_email], checkpointer=MemorySaver(), # Required middleware=[HumanInTheLoopMiddleware({...})] ) agent.invoke(input, config={"configurable": {"thread_id": "user-123"}}) // CORRECT import { Command } from "@langchain/langgraph"; await agent.invoke(new Command({ resume: { decisions: [{ type: "approve" }] } }), config); - HumanInTheLoopMiddleware / humanInTheLoopMiddleware : Pause before dangerous tool calls for human approval - Custom middleware : Intercept tool calls for error handling, logging, retry logic - Command resume : Continue execution after human decisions...

Source description provided by the upstream skill listing. Community reviews and install context appear in the sections below.

Community Reviews

Latest reviews

Sign in to review

No community reviews yet. Be the first to review.

Browse this skill in context
FAQ
What does langchain-middleware do?

Requirements: Checkpointer + thread_id config for all HITL workflows.

Is langchain-middleware good?

langchain-middleware does not have approved reviews yet, so SkillJury cannot publish a community verdict.

What agent does langchain-middleware work with?

langchain-middleware currently lists compatibility with codex, gemini-cli, opencode, cursor, github-copilot, claude-code.

What are alternatives to langchain-middleware?

Skills in the same category include telegram-bot-builder, flutter-app-size, sharp-edges, iterative-retrieval.

How do I install langchain-middleware?

npx skills add https://github.com/langchain-ai/langchain-skills --skill langchain-middleware

Related skills

More from langchain-ai/langchain-skills

Related skills

Alternatives in Software Engineering