Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计通过

langchain-developmentLangChain 开发

Agent Skill

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

总安装

5,739

周安装

244

GitHub Stars

87

下载量

2,011
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mindrally/skills --skill langchain-development

简介

langchain-development 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定仓库安装并使用该技能。
  • 安装前需确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

LangChain Development

You are an expert in LangChain, LangGraph, and building LLM-powered applications with Python.

Key Principles

  • Write concise, technical responses with accurate Python examples
  • Use functional, declarative programming; avoid classes where possible
  • Prefer iteration and modularization over code duplication
  • Use descriptive variable names with auxiliary verbs (e.g., is_active, has_context)
  • Follow PEP 8 style guidelines strictly

Code Organization

Directory Structure

Organize code into logical modules based on functionality:

project/
├── chains/           # LangChain chain definitions
├── agents/           # Agent configurations and tools
├── tools/            # Custom tool implementations
├── memory/           # Memory and state management
├── prompts/          # Prompt templates and management
├── retrievers/       # RAG and retrieval components
├── callbacks/        # Custom callback handlers
├── utils/            # Utility functions
├── tests/            # Test files
└── config/           # Configuration files

Naming Conventions

  • Use snake_case for files, functions, and variables
  • Use PascalCase for classes
  • Prefix private functions with underscore
  • Use descriptive names that indicate purpose (e.g., create_retrieval_chain, build_agent_executor)

LangChain Expression Language (LCEL)

Chain Composition

  • Use LCEL for composing chains with the pipe operator (|)
  • Prefer RunnableSequence and RunnableParallel for complex workflows
  • Implement proper error handling with RunnableLambda
from langchain_core.runnables import RunnableParallel, RunnablePassthrough

chain = (
    RunnableParallel(
        context=retriever,
        question=RunnablePassthrough()
    )
    | prompt
    | llm
    | output_parser
)

Best Practices

  • Always use invoke() for single inputs, batch() for multiple inputs
  • Use stream() for real-time token streaming
  • Implement with_config() for runtime configuration
  • Use bind() to attach tools or functions to runnables

Agents and Tools

Tool Development

  • Define tools using the @tool decorator with clear docstrings
  • Include type hints for all tool parameters
  • Implement proper input validation
  • Return structured outputs when possible
from langchain_core.tools import tool
from pydantic import BaseModel, Field

class SearchInput(BaseModel):
    query: str = Field(description="Search query string")

@tool(args_schema=SearchInput)
def search_database(query: str) -> str:
    """Search the database for relevant information."""
    # Implementation
    return results

Agent Configuration

  • Use create_react_agent or create_tool_calling_agent based on model capabilities
  • Implement proper agent executors with max iterations
  • Add callbacks for monitoring and debugging
  • Use structured chat agents for complex tool interactions

Memory and State Management

Conversation Memory

  • Use ConversationBufferMemory for short conversations
  • Implement ConversationSummaryMemory for long conversations
  • Consider ConversationBufferWindowMemory for fixed-length history
  • Use persistent storage backends for production (Redis, PostgreSQL)

LangGraph State

  • Define explicit state schemas using TypedDict
  • Implement proper state reducers for complex state updates
  • Use checkpointing for resumable workflows
  • Handle state persistence across sessions
from typing import TypedDict, Annotated
from langgraph.graph import StateGraph
from operator import add

class AgentState(TypedDict):
    messages: Annotated[list, add]
    context: str
    next_step: str

graph = StateGraph(AgentState)

RAG (Retrieval-Augmented Generation)

Document Processing

  • Use appropriate text splitters (RecursiveCharacterTextSplitter, MarkdownTextSplitter)
  • Implement proper chunk sizing with overlap
  • Preserve metadata during splitting
  • Use document loaders appropriate for file types

Vector Stores

  • Choose vector stores based on scale requirements
  • Implement proper embedding caching
  • Use hybrid search when available (dense + sparse)
  • Configure appropriate similarity metrics

Retrieval Strategies

  • Implement multi-query retrieval for complex questions
  • Use contextual compression to reduce noise
  • Consider parent document retrieval for better context
  • Implement re-ranking for improved relevance

LangSmith Integration

Monitoring

  • Enable tracing with LANGCHAIN_TRACING_V2=true
  • Add run names for easy identification
  • Implement custom metadata for filtering
  • Use tags for categorization

Debugging

  • Review traces for performance bottlenecks
  • Analyze token usage patterns
  • Monitor latency across chain components
  • Set up alerts for error rates

Error Handling

  • Implement retry logic with exponential backoff
  • Handle rate limits from LLM providers gracefully
  • Use fallback chains for critical paths
  • Log errors with sufficient context
from langchain_core.runnables import RunnableWithFallbacks

chain_with_fallback = primary_chain.with_fallbacks(
    [fallback_chain],
    exceptions_to_handle=(RateLimitError, TimeoutError)
)

Performance Optimization

  • Use async methods (ainvoke, abatch) for I/O-bound operations
  • Implement caching for expensive operations
  • Batch requests when possible
  • Use streaming for better user experience

Testing

  • Write unit tests for individual chain components
  • Implement integration tests for full chains
  • Use mocking for LLM calls in unit tests
  • Test edge cases and error conditions

Dependencies

  • langchain
  • langchain-core
  • langchain-community
  • langgraph
  • langsmith
  • python-dotenv
  • pydantic

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

26.2%
按下载量换算527

OpenCode

22.26%
按下载量换算448

Antigravity

16.78%
按下载量换算337

Gemini CLI

12.73%
按下载量换算256

Cursor

7.23%
按下载量换算145

Codex

3.46%
按下载量换算70

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills