Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add znlgis/opengis-skills --skill langchaingit clone --depth 1 https://github.com/znlgis/opengis-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/znlgis/opengis-skills/langchain)<a href="https://agentmods.dev/skills/znlgis/opengis-skills/langchain"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/langchain/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/znlgis/opengis-skills/langchain"><img src="https://agentmods.dev/badge/skills/znlgis/opengis-skills/langchain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00093 | $0.04998 |
| Opus 5.5 | $0.00037 | $0.01999 |
| Sonnet 5.5 | $0.00019 | $0.01000 |
| Haiku 4.5 | $0.00009 | $0.00500 |
Grade A, and why
langchain scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
proc = subprocess.run(args, capture_output=True, text=True, timeout=120) How it starts
The opening of the file, as written. The whole thing — 442 lines — stays where its author put it; the contents beside it link to each section on GitHub.
项目地址: https://github.com/langchain-ai/langchain
官方文档: https://python.langchain.com/(现重定向至 https://docs.langchain.com/oss/python/langchain/overview)
许可证: MIT 最新版本: langchain 1.4.6、langchain-core 1.6.10(PyPI,2026-10;GitHub 最新 Release 标签为
langchain-core==1.6.10,LangChain 已按包独立发版)
概述
LangChain 是用于构建 LLM 应用的 Python 框架,1.x 起以 LangGraph 为运行时,官方推荐入口为 create_agent 与 LCEL 管道语法。
- 模型层:
init_chat_model统一初始化 OpenAI / Anthropic / Google / DeepSeek / Ollama 等模型 - LCEL:
prompt | model | parser声明式组合 Runnable,天然支持invoke / batch / stream - Agents:
create_agent构建工具调用循环(Tool Calling Loop),基于 LangGraph 图执行 - Tools:
@tool装饰器把 Python 函数暴露给模型 - RAG:文档加载(langchain-community)→ 切分(langchain-text-splitters)→ 向量库 → 检索器
- 记忆:短期会话用 checkpointer +
thread_id;长期记忆用 store(均来自 LangGraph) - 包拆分:主包 langchain、接口层 langchain-core、社区集成 langchain-community、各 provider 独立包
包家族与版本(2026-10):
| 包 | 内容 | 当前版本 |
|---|---|---|
| langchain | 主包:agents、chat_models、tools | 1.4.6 |
| langchain-core | Runnable/LCEL、消息、提示词、解析器、向量库接口 | 1.6.10 |
| langgraph | 运行时:checkpointer、store | 1.2.15 |
| langchain-community | 社区集成:文档加载器、向量库 | 0.4.2 |
| langchain-openai | OpenAI / Azure 集成 | 1.7.2 |
| langchain-text-splitters | 文本切分器 | 1.1.3 |
| langchain-classic | 旧版链与 memory(兼容维护) | 1.0.8 |
环境准备
安装
# pip(要求 Python >= 3.10,官方 quickstart 建议 3.11)
pip install -U langchain
# provider 集成是 extras,按需安装
pip install -U "langchain[openai]"
pip install -U "langchain[deepseek]"
pip install -U "langchain[community]" # 文档加载器等社区集成
# RAG 常用配套
pip install -U langchain-text-splitters langchain-postgres pypdf
# uv(官方推荐流程)
uv python pin 3.11
uv init
uv add langchain
uv sync
API Key 配置
export OPENAI_API_KEY="sk-..."
export DEEPSEEK_API_KEY="sk-..." # 使用 DeepSeek 时
export ANTHROPIC_API_KEY="sk-ant-..." # 使用 Claude 时
在代码中加载 .env(需 pip install python-dotenv):
from dotenv import load_dotenv
load_dotenv()
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- today First seen · 442 lines · 93 tokens per session scan A 62f3bfd31234
langchain is a skill published in the GitHub repository znlgis/opengis-skills (64 stars, last pushed yesterday), licensed MIT. It adds 93 tokens to every session and 4,998 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-16.
Other skills, from other repositories
awesome-chatgpt
Search this repository's awesome-ChatGPT-repositories list for open-source ChatGPT and LLM projects such as RAG frameworks, agents, chatbots, CLIs, prompts, and browser extensions. Use when the user asks to find tools, libraries, or repos related to ChatGPT, LLMs, or AI development; not for editing or adding list…
ai-ml
AI and machine learning workflow covering LLM application development, RAG implementation, agent architecture, ML pipelines, and AI-powered features.
dspy
DSPy: declarative LM programs, auto-optimize prompts, RAG.
dspy
DSPy: declarative LM programs, auto-optimize prompts, RAG.
ai-engineering-toolkit
Overview of six AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.
memory-rag-poisoning-detection
Detect persistent-memory poisoning and RAG/knowledge-base contamination via dialogue testing. Use when the agent has long-term memory, a user/preference store, or writes to a retrievable knowledge base.