页面加载中...
LangChain 社区贡献的 200+ 工具集成,覆盖搜索引擎、数据库、云存储、邮件、社交媒体等。可直接作为 Agent Tool 使用,也可封装为 MCP Server 供其他平台调用。
LangChain 社区贡献的 200+ 工具集成——Agent 工具化的最大工具库。
LangChain 社区工具是 langchain-community 包的一部分,提供了 Agent 与外部世界交互的标准化接口。每个工具都遵循 BaseTool 接口,可以在任何 LangChain Agent 中即插即用。
工具分类:
# 安装 LangChain 社区包 pip install langchain-community # 按需安装特定工具的依赖 pip install langchain-community[google-search] # Google Search pip install langchain-community[sqlite] # SQL Database pip install langchain-community[github] # GitHub Tool
from langchain_community.tools import DuckDuckGoSearchRun search = DuckDuckGoSearchRun() result = search.invoke("2026年 AI Agent 最新趋势") print(result)
from mcp.server import Server from langchain_community.tools import WikipediaQueryRun from langchain_community.utilities import WikipediaAPIWrapper server = Server("langchain-wiki-mcp") wikipedia = WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()) @server.tool() async def wiki_search(query: str) -> str: """Search Wikipedia for information.""" return wikipedia.invoke(query)
from langchain_community.tools import DuckDuckGoSearchRun, WikipediaQueryRun from langchain.agents import initialize_agent tools = [DuckDuckGoSearchRun(), WikipediaQueryRun()] agent = initialize_agent(tools, llm, agent="zero-shot-react-description") agent.run("What is the population of Tokyo in 2026?")
版本
v0.1.0
作者
langchain-ai
平台
发布时间
2026年3月15日