
Langchain Fundamentals
langchain-ai/langchain-skillsOfficial
If you're building LangChain agents, this cuts through the API confusion and focuses on create_agent(), which is what actually works in production. It covers the middleware patterns you'll need for human-in-the-loop workflows and error handling, plus proper tool definition with the @tool decorator. The examples show real patterns like state persistence with MemorySaver and structured output validation. Most LangChain tutorials still reference deprecated agent classes, so this keeps you on the current approach that won't break in six months.
- skills.sh installs
- 18.2K
- GitHub stars
- 1.3K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add langchain-ai/langchain-skills --skill langchain-fundamentals --agent claude-codeInstalls into .claude/skills of the current project.
Files
Build production agents using `create_agent()`, middleware patterns, and the `@tool` decorator / `tool()` function. When creating LangChain agents, you MUST use create_agent(), with middleware for custom flows. All other alternatives are outdated.
<create_agent>
Creating Agents with create_agent
create_agent() is the recommended way to build agents. It handles the agent loop, tool execution, and state management.
Agent Configuration Options
| Parameter | Purpose | Example |
|---|---|---|
model | LLM to use | "anthropic:claude-sonnet-4-5" or model instance |
tools | List of tools | [search, calculator] |
system_prompt / systemPrompt | Agent instructions | "You are a helpful assistant" |
checkpointer | State persistence | MemorySaver() |
middleware | Processing hooks | [HumanInTheLoopMiddleware] (Python) / [humanInTheLoopMiddleware({...})] (TypeScript) |
| </create_agent> |
from langchain.agents import create_agent
from langchain_core.tools import tool
@tool
def get_weather(location: str) -> str:
"""Get current weather for a location.
Sponsors
Promote your product hereReach 125k+ visitors monthlyPromote your product hereReach 125k+ visitors monthly
Agent CaffeineSponsoredClose your lid, come back to finished work
SnugSponsoredThe clipboard manager for the AI eraPromote your product hereReach 125k+ visitors monthly
WaxSponsoredBlock anything with supervision, without erasing your iPhonePromote your product hereReach 125k+ visitors monthly
knobsSponsoredSee your site on any phone, any day, in any language
Details
- Repository
- github.com/langchain-ai/langchain-skills
- Categories
- Backend & APIs, AI & Agent Building, Debugging
More from langchain-ai/langchain-skills
All 15- Langgraph Human In The Loop18K
- Langchain Middleware17K
- Deep Agents Orchestration16.8K
- Langchain Dependencies16.8K
- Deep Agents Core16.7K
- Managed Deep Agents10K
- Langgraph Cli9.7K
- Swarm9.5K
- Ecosystem Primer8.8K
- Framework Selection7.7K
- Deep Agents Memory19.8K
- Langgraph Fundamentals18.9K
- Langgraph Persistence18.8K
- Langchain Rag18.4K
Recommended
More Backend & APIs1
openapi-spec-generationwshobson/agentsGenerate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns. Use when creating API documentation, generating SDKs, o17Kskills.sh installs
2
gpt-image-2gargantuax/openskillsFull OpenAI-compatible GPT Image 2 coverage across images/generations, images/edits, and responses with the image_generation tool. Use when the one-shot image h16.8Kskills.sh installs
3
okx-agent-payments-protocolokx/onchainos-skillsUse when an agent hits HTTP 402 / payment-required, or the user mentions x402, x402Version, X-PAYMENT, PAYMENT-REQUIRED, PAYMENT-SIGNATURE, WWW-Authenticate: Pa15.9Kskills.sh installs
4
clerk-swiftclerk/skillsImplement Clerk authentication for native Swift and iOS apps using ClerkKit and ClerkKitUI source-guided patterns. Use for prebuilt AuthView or custom native fl15Kskills.sh installs
5
clerk-expoclerk/skillsAdd Clerk authentication to Expo and React Native apps using @clerk/expo. Use for Expo setup, prebuilt native components (AuthView, UserButton), custom sign-in/14.8Kskills.sh installs
6
base44-sdkbase44/skillsThe base44 SDK is the library to communicate with base44 services. In projects, you use it to communicate with remote resources (entities, backend functions, ai13.3Kskills.sh installs