Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计异常

langchainLangChain 开发

Agent Skill

langchain 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

339

周安装

14

GitHub Stars

4

下载量

111
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:langchain(LangChain 开发)
来源仓库:https://github.com/alphaonedev/openclaw-graph
仓库路径:skills/langchain
安装命令:
npx skills add https://github.com/alphaonedev/openclaw-graph --skill langchain
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/alphaonedev/openclaw-graph --skill langchain

简介

该技能用于 LangChain 框架集成,支持 LLM 工作流链式组合与外部工具调用。

  • 适用于构建 AI 应用原型、问答系统或多模型协同处理复杂查询。
  • 通过 GitHub 仓库安装,兼容 Codex、Claude、Cursor、Gemini CLI。
  • 使用时应注意 API 密钥管理及外部数据源的安全接入。
  • 适合快速搭建 AI 代理,但需评估生产环境下的稳定性与成本。

SKILL.md

langchain

Purpose

LangChain is a Python framework for developing applications that integrate large language models (LLMs) into workflows, enabling the creation of chains that combine multiple LLMs or tools for tasks like question answering or data processing.

When to Use

Use LangChain when building AI-powered apps that require chaining LLMs, such as integrating multiple models for complex queries, or when you need to handle external data sources with LLMs. Apply it for rapid prototyping of AI agents, like chatbots that fetch real-time data, or for ML operations in aimlops clusters where scalable LLM workflows are needed.

Key Capabilities

  • Chain Building: Create sequences of LLMs using classes like LLMChain; for example, combine a prompt template with an LLM call.
  • Tool Integration: Supports integrations with APIs like OpenAI via OpenAI class; handle vector stores with FAISS for semantic search.
  • Prompt Management: Use PromptTemplate to define and render prompts dynamically, e.g., with variables for user input.
  • Agent Frameworks: Build agents with tools using AgentType.ZERO_SHOT_REACT, allowing dynamic tool selection based on LLM output.
  • Async Support: Leverage asynchronous chains for scalable applications, such as processing multiple queries concurrently.

Usage Patterns

To use LangChain, install it via pip install langchain, then import and configure components. For basic chains, create an LLM instance and link it to prompts or tools. Pattern: Initialize an LLM with an API key, build a chain, and run it in a loop for iterative tasks. For agents, define tools and let the agent decide actions based on input.

Common Commands/API

  • Installation and Setup: Run pip install langchain[all] to include extras; set environment variables like export OPENAI_API_KEY=your_key for authentication.
  • Basic Chain Example: from langchain.llms import OpenAI from langchain.chains import LLMChain llm = OpenAI(model_name="gpt-3.5-turbo") chain = LLMChain(llm=llm, prompt="What is {topic}?") result = chain.run(topic="LangChain")
  • API Endpoints: When using LangChain with external services, call endpoints like https://api.openai.com/v1/chat/completions via LangChain wrappers; pass headers with auth tokens.
  • Config Formats: Use YAML for chain configurations, e.g., in a file: chains: - name: simple_chain llm: OpenAI prompt: "Summarize {text}" Load with from langchain.utilities import load_config.
  • CLI Commands: For LangChain CLI (if extended), use langchain serve to run chains as services, or debug with langchain debug --chain my_chain to trace executions.

Integration Notes

Integrate LangChain with other tools by wrapping them as callable functions. For example, to add a database query tool, use Tool.from_function and pass it to an agent. Set env vars for keys, e.g., $OPENAI_API_KEY for OpenAI models or $SERPAPI_API_KEY for search integrations. When combining with aimlops cluster tools, ensure compatibility by using LangChain's callback system for logging; import from langchain.callbacks import get_openai_callback to track token usage. For vector databases, integrate with Pinecone by initializing from langchain.vectorstores import Pinecone and providing your API key via env var.

Error Handling

Handle errors by wrapping chain runs in try-except blocks, e.g.:

try:
    result = chain.run(input_data)
except ValueError as e:
    print(f"Invalid input: {e}")
except Exception as e:
    print(f"General error: {e} - Check API key or network")

Common issues include API rate limits (check with if e.status_code == 429: retry()), invalid API keys (verify $OPENAI_API_KEY is set), or chain misconfigurations (use chain.validate() if available). Log errors using LangChain's handlers for debugging in production.

Concrete Usage Examples

  1. Simple Question-Answering Chain: Build a chain to answer questions using an LLM and a vector store. First, set export OPENAI_API_KEY=your_key. Then: from langchain.chains import RetrievalQA from langchain.llms import OpenAI qa_chain = RetrievalQA.from_chain_type(llm=OpenAI(), chain_type="stuff") answer = qa_chain.run({"query": "What is LangChain?"}) This fetches relevant documents and generates a response.
  2. Agent for Web Search: Create an agent that uses tools for web searches. Set export SERPAPI_API_KEY=your_key. Code: from langchain.agents import AgentType, load_tools, initialize_agent from langchain.llms import OpenAI tools = load_tools(["serpapi"]) agent = initialize_agent(tools, OpenAI(), agent=AgentType.ZERO_SHOT_REACT) response = agent.run("Search for latest AI news") The agent dynamically queries the web and returns results.

Graph Relationships

  • Related to cluster: aimlops (e.g., shares tools for ML operations).
  • Connected via tags: langchain (self), llm (links to other LLM tools), ai-framework (connects to frameworks like Hugging Face).
  • Dependencies: Requires OpenAI or similar APIs, integrates with vector stores like FAISS or Pinecone.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.46%
按下载量换算36

Claude

30.78%
按下载量换算34

Cursor

19.21%
按下载量换算21

Gemini CLI

9.02%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills