Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

langchain-fundamentals

Skill by langchain-ai

Teaches an AI assistant how to build LangChain agents with create_agent, define tools, and add middleware for human approval and custom error handling. It is aimed at developers building agents in Python or TypeScript.

  • Score 87
  • 1.4k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install langchain-fundamentals

Built from the published package, never by AI.

git clone --depth 1 https://github.com/langchain-ai/langchain-skills /tmp/langchain-skills && mkdir -p ~/.claude/skills && cp -r /tmp/langchain-skills/config/skills/langchain-fundamentals ~/.claude/skills/langchain-fundamentals

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install langchain-fundamentals in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill is a reference guide for building LangChain agents. It explains how to create an agent with create_agent, which handles the agent loop, tool execution, and state management. It shows how to define tools with the @tool decorator in Python or the tool() function in TypeScript, and how to give tools clear descriptions.

The guide covers middleware for controlling the agent loop. HumanInTheLoopMiddleware and humanInTheLoopMiddleware add approval steps for chosen tools, and wrap_tool_call or createMiddleware add custom hooks. It also covers conversation memory with a MemorySaver checkpointer, structured output with response_format, and recursion_limit to stop runaway loops. It is written for developers building production agents in Python or TypeScript.

Written from the project's SKILL.md and checked against it.

What it can do

  • create_agentBuilds an agent that handles the agent loop, tool execution, and state management.
  • @tool decorator and tool()Defines tools the agent can call, using the @tool decorator in Python or tool() in TypeScript.
  • HumanInTheLoopMiddlewareAdds human approval to selected tools, with resume after an interrupt.
  • Custom middlewareAdds custom hooks to tool calls using @wrap_tool_call or createMiddleware.
  • Conversation memoryKeeps state across calls using a MemorySaver checkpointer and thread_id.
  • Structured outputReturns typed, validated responses using response_format or with_structured_output().
  • Loop limitSets recursion_limit in the invoke config to stop runaway agent loops.

What you need

  • Python or TypeScript
  • LangChain packages for create_agent and tools
  • Access to a model such as anthropic:claude-sonnet-4-5 or gpt-4.1

Try asking

  • Build a LangChain agent with a weather tool and a system prompt
  • Add human approval before a dangerous tool runs in my agent
  • Make my LangChain agent remember the user's name across calls

Good to know

  • HumanInTheLoopMiddleware requires a checkpointer and thread_id
  • Code examples are given in Python and TypeScript only
  • The guide says create_agent is the recommended way and calls other approaches outdated

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: config/skills/langchain-fundamentals/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Alternatives to langchain-fundamentals

All alternatives →

Compare with agent-reproduce-align, google_contacts or m06-error-handling

langchain-fundamentals: common questions

What does the langchain-fundamentals skill cover?

It covers creating agents with create_agent, defining tools, and using middleware for human-in-the-loop approval and error handling. Examples are given in Python and TypeScript.

How does an agent remember earlier messages?

The guide adds a MemorySaver checkpointer and passes the same thread_id in the config on each call. The agent then keeps the conversation state across invocations.

How do I stop an agent from looping forever?

Set recursion_limit in the invoke config, for example to 10 steps. The guide presents this as the way to prevent runaway agent loops.

How do I install langchain-fundamentals?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is langchain-fundamentals free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is langchain-fundamentals safe to use?

It scores 87 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to langchain-fundamentals?

Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.

langchain-fundamentals Install

Add to stack

Loading.