重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
langchain-development by mindrally/skills
npx skills add https://github.com/mindrally/skills --skill langchain-development您是 LangChain、LangGraph 以及使用 Python 构建 LLM 驱动应用程序的专家。
根据功能将代码组织到逻辑模块中:
project/
├── chains/ # LangChain 链定义
├── agents/ # 智能体配置和工具
├── tools/ # 自定义工具实现
├── memory/ # 记忆和状态管理
├── prompts/ # 提示词模板和管理
├── retrievers/ # RAG 和检索组件
├── callbacks/ # 自定义回调处理器
├── utils/ # 工具函数
├── tests/ # 测试文件
└── config/ # 配置文件
create_retrieval_chain, build_agent_executor)广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
|) 来组合链RunnableSequence 和 RunnableParallelRunnableLambda 实现适当的错误处理from langchain_core.runnables import RunnableParallel, RunnablePassthrough
chain = (
RunnableParallel(
context=retriever,
question=RunnablePassthrough()
)
| prompt
| llm
| output_parser
)
invoke(),批量输入使用 batch()stream() 进行实时令牌流式传输with_config() 实现运行时配置bind() 将工具或函数附加到可运行对象上@tool 装饰器定义工具from langchain_core.tools import tool
from pydantic import BaseModel, Field
class SearchInput(BaseModel):
query: str = Field(description="搜索查询字符串")
@tool(args_schema=SearchInput)
def search_database(query: str) -> str:
"""在数据库中搜索相关信息。"""
# 实现
return results
create_react_agent 或 create_tool_calling_agentConversationBufferMemoryConversationSummaryMemoryConversationBufferWindowMemory 来固定历史长度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)
LANGCHAIN_TRACING_V2=true 启用追踪from langchain_core.runnables import RunnableWithFallbacks
chain_with_fallback = primary_chain.with_fallbacks(
[fallback_chain],
exceptions_to_handle=(RateLimitError, TimeoutError)
)
ainvoke, abatch)每周安装数
91
代码仓库
GitHub 星标数
43
首次出现
2026 年 1 月 25 日
安全审计
安装于
gemini-cli75
opencode74
claude-code71
cursor70
codex69
github-copilot68
You are an expert in LangChain, LangGraph, and building LLM-powered applications with Python.
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
create_retrieval_chain, build_agent_executor)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 )
invoke() for single inputs, batch() for multiple inputsstream() for real-time token streamingwith_config() for runtime configurationbind() to attach tools or functions to runnablesDefine 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
create_react_agent or create_tool_calling_agent based on model capabilitiesConversationBufferMemory for short conversationsConversationSummaryMemory for long conversationsConversationBufferWindowMemory for fixed-length historyDefine 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)
LANGCHAIN_TRACING_V2=trueImplement 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) )
ainvoke, abatch) for I/O-bound operationsWeekly Installs
91
Repository
GitHub Stars
43
First Seen
Jan 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli75
opencode74
claude-code71
cursor70
codex69
github-copilot68
SoulTrace 人格评估 API - 基于五色心理模型的贝叶斯自适应测试
56,700 周安装
Momenta Web Skill - 智能代理技能目录,集成多开发工具提升工作效率
57 周安装
领域识别与分组技能:自动分析代码组件,为微服务和领域驱动设计(DDD)做准备
57 周安装
agent-council:创建管理Discord AI智能体,OpenClaw集成与自动化
57 周安装
Pipedrive自动化技能:通过Rube MCP与Composio工具包实现CRM工作流自动化
57 周安装
Hugging Face CLI 使用指南:hf 命令安装、身份验证与Hub文件管理
57 周安装
generic-static-design-system - 静态设计系统开发工具,提升UI组件库与前端架构效率
57 周安装