langchain-fundamentals

Orchestrate LangChain agents with create_agent(), tools, and middleware patterns.

Updated Jul 13, 2025
One-click install
npx skills add https://github.com/Reofdev07/osai --skill langchain-fundamentals-reofdev07
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: langchain-fundamentals
Source: https://github.com/Reofdev07/osai/tree/main/.windsurf/skills/langchain-fundamentals
Command: npx skills add https://github.com/Reofdev07/osai --skill langchain-fundamentals-reofdev07

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Build production-ready LangChain agents by standardizing agent creation via create_agent(), tool wiring with @tool decorator or tool(), and middleware for human-in-the-loop and error handling.

Core Features & Use Cases

  • Agent orchestration with create_agent() handling the loop, state, and tool execution.
  • Tool definition via Python decorators or TypeScript tool() with clear schemas.
  • Middleware patterns for approval workflows, error handling, and logging, including memory persistence.

Quick Start

Create an agent with create_agent(), wire a tool, and apply middleware for a human-in-the-loop workflow.

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 approval to LangChain agents?

You can implement human-in-the-loop approval by applying middleware patterns to create_agent(), which intercepts the agent loop to pause tool execution and request manual approval before proceeding.

What's the best way to wire tools into a LangChain agent?

Wire tools into a LangChain agent by defining them with the @tool decorator in Python or the tool() function in TypeScript, passing these schema-defined tools directly to create_agent().

How does middleware handle errors and persistent state in LangChain?

Middleware handles errors and persistent state by wrapping the create_agent() loop, enabling logging, error recovery, and memory persistence to maintain context across multiple agent interactions.

Do I need LangChain installed to use create_agent for production workflows?

Yes, LangChain is required to use create_agent(). The framework provides the core orchestration loop, state management, and tool execution capabilities required to build and run production-grade agent workflows.

Can I use create_agent with custom Python decorators for tool schemas?

Yes, create_agent works with custom Python decorators. You can use the @tool decorator to define custom tools with clear input schemas, which are then automatically wired into the agent's execution loop.