langchain-fundamentals

Construct LangChain agents with create_agent, middleware, and tool decorators.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enable developers to rapidly construct robust LangChain agents by combining create_agent, middleware patterns, and tool definitions, reducing boilerplate and improving reliability.

Core Features & Use Cases

  • Create agents with create_agent() to manage the agent loop, tool execution, and state.
  • Integrate middleware for human-in-the-loop approvals, error handling, and logging.
  • Define tools with the @tool decorator (Python) or tool() (TypeScript) and enable memory via checkpointers for persistence.
  • Support structured output, model configuration, and flexible tool orchestration for production-grade assistants.
  • Use cases include agents that require approvals, long-running tasks with memory, and robust tool coordination.

Quick Start

Create an agent with create_agent(), wire tools using @tool or tool(), and run a simple user query to validate the flow.

Frequently Asked Questions about langchain-fundamentals

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

FAQPage Schema
How do I add human-in-the-loop approvals to LangChain agents?

LangChain agents support human-in-the-loop approvals by integrating middleware into the agent loop. This pattern intercepts tool execution, pausing the process to request manual approval before proceeding with the action.

What is the best way to build production LangChain agents with memory?

The best way to build production LangChain agents with memory is using create_agent with checkpointers. This combination manages the agent loop, tool execution, and persistent state across multiple invocations safely.

How do I configure structured output for a LangChain agent?

Configuring structured output for a LangChain agent involves using create_agent with model configuration options. This enforces best practices and safe defaults while ensuring the assistant returns data in the required structured format.

Can I use middleware for error handling and logging in LangChain?

Yes, you can use middleware for error handling and logging in LangChain. Middleware patterns intercept the agent loop to manage exceptions systematically and track execution behavior during long-running tasks.

How do I define custom tools for a LangChain agent?

You define custom tools for a LangChain agent using the @tool decorator in Python or the tool() function in TypeScript. This enables flexible tool orchestration and integration within the agent loop.