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.
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-fundamentalsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/langchain-ai/langchain-skills /tmp/langchain-skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/langchain-skills/config/skills/langchain-fundamentals ~/.gemini/antigravity-cli/skills/langchain-fundamentalsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install langchain-fundamentals in Antigravity CLI
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
ANo 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 →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
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.
