langchain-fundamentals

Design and deploy LangChain agents with create_agent(), tools, and middleware.

Updated May 25, 2026
One-click install
npx skills add https://github.com/lguibr/fh --skill langchain-fundamentals-lguibr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: langchain-fundamentals
Source: https://github.com/lguibr/fh/tree/main/.agents/skills/langchain-fundamentals
Command: npx skills add https://github.com/lguibr/fh --skill langchain-fundamentals-lguibr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline building robust LangChain agents by using create_agent(), defining tools with the @tool decorator or tool(), and applying middleware for human-in-the-loop and error handling across Python and TypeScript.

Core Features & Use Cases

  • Use create_agent() to manage the agent loop, tools, and state with optional memory checkpointer.
  • Define reusable tools with clear descriptions using Python @tool or TypeScript tool(), enabling clean collaboration between tools and agents.
  • Integrate middleware (e.g., HumanInTheLoopMiddleware) to add approval flows, error handling, and logging for production-grade agents.
  • Explore representative examples like basic agents, persistence-enabled agents, and tool definitions to illustrate end-to-end workflows.

Quick Start

Create a simple LangChain agent using create_agent with a weather tool and run a user query.

Frequently Asked Questions about langchain-fundamentals

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build LangChain agents with create_agent for production?

Build LangChain agents by using create_agent() to manage the agent loop, tools, and state. It supports optional memory checkpointer persistence and middleware integration for production-grade workflows across Python and TypeScript environments.

How do I define tools for LangChain agents using Python and TypeScript?

Define reusable tools for LangChain agents using the Python @tool decorator or TypeScript tool() function. Providing clear descriptions enables clean collaboration and correct routing between tools and agents during interactive use.

How does middleware handle human-in-the-loop and error handling in LangChain agents?

Middleware like HumanInTheLoopMiddleware adds approval flows, error handling, and logging to LangChain agents. Safe middleware integration ensures robust production behavior by intercepting agent actions for validation before execution.

Can I use LangChain memory checkpointer for agent state persistence?

You can use a memory checkpointer with create_agent() to enable agent state persistence. This optional feature allows agents to maintain context and resume interactive tool workflows across multiple user sessions reliably.

What is the best way to add approval flows to LangChain agents?

The best way to add approval flows is integrating HumanInTheLoopMiddleware into your LangChain agent. This middleware pattern intercepts tool execution, allowing human operators to review, approve, or reject actions before they run.