Official agent skill

Langchain

by langchain-ai in langchain-ai/docs

Build agents with a prebuilt architecture and integrations for any model or tool.

OfficialMITAuto-check passedAI & LLM Engineering

Install Langchain

skills CLI
$ npx skills add langchain-ai/docs --skill langchain -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install langchain-ai/docs langchain --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/langchain-ai/docs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/.mintlify/skills/langchain .claude/skills/langchain && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
langchain
GitHub stars
426
Token cost
~1.1k tokens
SKILL.md length
301 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Build agents with a prebuilt architecture and integrations for any model or tool.

  • Works in 4 steps: Snake_case tool names—Tool function… → Reserved parameters—Do not name tool… → Provider packages—Models live in… → …
  • Creating tool-calling agents
  • SKILL.md covers When to use, When NOT to use, Install and Quick reference, plus 4 more sections
  • Calls pip and npm; reaches reference.langchain.com

What it does

Langchain is an agent skill from langchain-ai/docs, published by the product's own GitHub organization. Build agents with a prebuilt architecture and integrations for any model or tool. Use when creating tool-calling agents, switching model providers, or adding structured output.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Python 3.10+, Node.js 22+

It sits in AI & LLM Engineering, covering Building AI agents and Structured output and tool calling. It works with LangChain, LangGraph and OpenAI. The repository describes itself as: Unified LangChain documentation. The licence is MIT.

When your agent uses it

  • Creating tool-calling agents
  • Switching model providers
  • Adding structured output

Example prompts

  • “/langchain”

Requirements

  • Python 3
  • Node.js
  • Compatibility (from SKILL.md): Python 3.10+, Node.js 22+

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Snake_case tool names—Tool function names must be valid Python identifiers. Use get_weather, not get-weather.
  2. Reserved parameters—Do not name tool parameters type, name, or description as these conflict with the tool schema.
  3. Provider packages—Models live in separate packages (e.g., langchain-openai). The base langchain package does not include providers.
  4. Model string format—Use "provider:model-name" format with init_chat_model() (e.g., "openai:gpt-5.5").

What it can do on your machine

Read from SKILL.md and the folder at commit be3028f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pip
    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • reference.langchain.com

    Also links to:

    • docs.langchain.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Python 3.10+, Node.js 22+

    From compatibility in the SKILL.md frontmatter.

Context cost

Langchain loads about 1.1k tokens when it runs. Until then it costs about 47 tokens; SKILL.md has 301 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~47
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from langchain-ai/docs at commit be3028f, republished under its MIT licence (© langchain-ai). 301 words, ~1,118 tokens.

Download SKILL.mdSave it as .claude/skills/langchain/SKILL.md (or your agent's skills folder).
name
langchain
description
Build agents with a prebuilt architecture and integrations for any model or tool. Use when creating tool-calling agents, switching model providers, or adding structured output.
compatibility
Python 3.10+, Node.js 22+
license
MIT
metadata.author
langchain-ai
metadata.version
1.0

LangChain

LangChain is an open-source framework with a prebuilt agent architecture and integrations for any model or tool. Build agents and LLM-powered applications in under 10 lines of code, with integrations for OpenAI, Anthropic, Google, and hundreds more.

When to use

Use LangChain when you need to:

  • Build tool-calling agents with create_agent() and a prebuilt agent loop
  • Switch model providers without changing application code via init_chat_model()
  • Add structured output to parse LLM responses into typed objects
  • Integrate with any model or tool using LangChain's provider packages
  • Use middleware for cross-cutting concerns like rate limiting and caching

When NOT to use

  • For complex multi-step workflows with custom control flow, use LangGraph instead
  • For a batteries-included agent with planning, subagents, and context management, use Deep Agents instead
  • LangChain provides the core building blocks; LangGraph adds orchestration; Deep Agents adds high-level capabilities on top

Install

bash
# Python
pip install -U langchain

# JavaScript/TypeScript
npm install langchain @langchain/core

Install a provider integration:

bash
# Python
pip install -U langchain-openai       # or langchain-anthropic, langchain-google-genai

# JavaScript/TypeScript
npm install @langchain/openai         # or @langchain/anthropic, @langchain/google-genai

Quick reference

Create an agent
python
from langchain.agents import create_agent

def get_weather(city: str) -> str:
    """Get weather for a given city."""
    return f"It's always sunny in {city}!"

agent = create_agent(
    model="openai:gpt-5.5",
    tools=[get_weather],
    system_prompt="You are a helpful assistant",
)

result = agent.invoke(
    {"messages": [{"role": "user", "content": "What is the weather in SF?"}]}
)
Initialize a chat model
python
from langchain.chat_models import init_chat_model

# Switch providers by changing the string
model = init_chat_model("openai:gpt-5.5")
model = init_chat_model("anthropic:claude-opus-4-8")
model = init_chat_model("google_genai:gemini-3.6-flash")
Define a tool
python
from langchain.tools import tool

@tool
def search(query: str) -> str:
    """Search the web for information."""
    return "search results"

Gotchas

  1. Snake_case tool names—Tool function names must be valid Python identifiers. Use get_weather, not get-weather.
  2. Reserved parameters—Do not name tool parameters type, name, or description as these conflict with the tool schema.
  3. Provider packages—Models live in separate packages (e.g., langchain-openai). The base langchain package does not include providers.
  4. Model string format—Use "provider:model-name" format with init_chat_model() (e.g., "openai:gpt-5.5").

Key documentation

API reference

For SDK class and method details, use the LangChain API Reference site:

  • Browse: https://reference.langchain.com/python/langchain-core
  • MCP server: https://reference.langchain.com/mcp
  • langgraph—Low-level orchestration for stateful, durable agent workflows
  • deep-agents—Batteries-included agent harness built on LangChain
  • langsmith—Trace, evaluate, and deploy your LangChain agents

© langchain-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in src/.mintlify/skills/langchain of langchain-ai/docs.

Open the folder on GitHubat commit be3028f

Compare with similar skills

Langchain next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Langchain compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Langchain this skilllangchain-ai/docs426—~1.1kAutomated safety check: PassMIT
Tool Designagentailor/fullstack-langgraph-nextjs-agent132—~3.2kAutomated safety check: PassMIT
Add Example AgentGetBindu/Bindu10k—~1.1kAutomated safety check: NotesCustom licence
Agent Prompt Engineeringagentailor/fullstack-langgraph-nextjs-agent132—~3.6kAutomated safety check: PassMIT
Llmobs IntegrationDataDog/dd-trace-js837—~1.4kAutomated safety check: PassCustom licence
Agent Inspectrajudandigam/agent-inspect165—~424Automated safety check: PassMIT

Similar skills

  • Tool Design

    agentailor/fullstack-langgraph-nextjs-agent

    Design and verify tools that AI agents can actually use — for any framework or language (MCP servers, LangChain/LangGraph, function-calling, raw JSON schema; TypeScript, Python, or otherwise).

    132 GitHub stars~3.2k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Add Example Agent

    GetBindu/Bindu

    Add a new self-contained example agent under examples/. An agent skill from GetBindu/Bindu.

    10k GitHub stars~1.1k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check: notes
  • Agent Prompt Engineering

    agentailor/fullstack-langgraph-nextjs-agent

    Comprehensive guide for designing, refining, and auditing system prompts for autonomous AI agents based on Anthropic's production practices.

    132 GitHub stars~3.6k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Llmobs Integration

    DataDog/dd-trace-js

    Official

    A skill your agent uses when adding, debugging, or modifying LLMObs plugins for an LLM library in dd-trace-js.

    837 GitHub stars~1.4k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Agent Inspect

    rajudandigam/agent-inspect

    Local evidence debugger and trajectory-test toolkit for TypeScript AI agents.

    165 GitHub stars~424 tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • LangGraph Decision Models

    langchain-ai/langchain-skills

    Official

    Routes LangGraph agents with typed decision models that return probabilities, and finds LLM calls that only exist to produce a routing decision.

    1.3k GitHub stars~2.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from langchain-ai/docs

All 17 skills in this repo
  • Add Docs Page

    langchain-ai/docs

    Official

    Add, move, rename, or delete a page on the LangChain docs site.

    426 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Deep Agents

    langchain-ai/docs

    Official

    Build batteries-included agents with planning, context management, subagent delegation, and sandboxed execution.

    426 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Docs Code Samples

    langchain-ai/docs

    Official

    A skill your agent uses when migrating inline code samples from LangChain docs (MDX files) into external, testable code files that are extracted by this repo’s snippet scripts and used as Mintlify…

    426 GitHub stars~4.6k tokensUpdated today
    Auto-check passed
  • Docs Edit

    langchain-ai/docs

    Official

    Edit a docs page that already has an open pull request, or revise a page in place.

    426 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Docs Restructure

    langchain-ai/docs

    Official

    Restructure documentation that spans several pages. An agent skill from langchain-ai/docs.

    426 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Docs Team Voice

    langchain-ai/docs

    Official

    Write or revise documentation prose so it reads like the rest of this site, in the docs team's shared voice.

    426 GitHub stars~1.5k tokensUpdated today
    Auto-check passed

Questions about Langchain

What does Langchain do?

Build agents with a prebuilt architecture and integrations for any model or tool. Langchain is an agent skill from langchain-ai/docs, published by the product's own GitHub organization. Build agents with a prebuilt architecture and integrations for any model or tool.

When should I use Langchain?

Langchain fits situations like: creating tool-calling agents; switching model providers; adding structured output.

How do I install Langchain in Claude Code?

Run `npx skills add langchain-ai/docs --skill langchain -a claude-code`. Or copy the skill folder (src/.mintlify/skills/langchain in langchain-ai/docs) into .claude/skills/langchain in your project. Claude Code loads it when a task matches its description.

How do I install Langchain in Codex?

Run `npx skills add langchain-ai/docs --skill langchain -a codex`. Or copy the skill folder (src/.mintlify/skills/langchain in langchain-ai/docs) into .agents/skills/langchain in your project. Codex loads it when a task matches its description.

Can I use Langchain in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add langchain-ai/docs --skill langchain -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/langchain, .gemini/skills/langchain, .github/skills/langchain and .opencode/skills/langchain in your project.

What does Langchain need to run?

Going by SKILL.md and its folder, Langchain needs the command-line tools its instructions call (pip and npm). Our summary lists: Python 3; Node.js. Compatibility (from SKILL.md): Python 3.10+, Node.js 22+.

Does Langchain access the network?

SKILL.md names 2 domains. In commands or code: reference.langchain.com; the agent is likely to contact it when it follows the instructions. As links in the text: docs.langchain.com. This is read from the text; nothing was executed.

Is Langchain safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Langchain use?

Langchain is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Langchain use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Langchain?

Skills that share tags, products or a category with Langchain: Tool Design (agentailor/fullstack-langgraph-nextjs-agent, 132 stars), Add Example Agent (GetBindu/Bindu, 10k stars), Agent Prompt Engineering (agentailor/fullstack-langgraph-nextjs-agent, 132 stars) and Llmobs Integration (DataDog/dd-trace-js, 837 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Langchain?

langchain-ai (a GitHub organization, an official publisher) maintains it in langchain-ai/docs, which has 426 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 9, 2026.

Source: langchain-ai/docs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.