LangChain 是一个用于构建智能体和大模型应用的 Python 框架。它把模型、嵌入、向量库、检索器与各类工具封装成可互换的标准接口,让开发者像搭积木一样把第三方集成串成完整链路。相比直接调用各家 API,它更强调模型可替换性:换供应商或换模型只需调整配置,不必重写业务逻辑。框架提供从高层链式编排到底层组件的不同抽象层级,便于先快速做出原型,再逐步细化控制。配套生态包括面向复杂任务的 Deep Agents、专注可控编排的 LangGraph,以及负责评测、观测与部署的 LangSmith,同时也有 JS/TS 版本供前端团队使用。
pip install langchainLangChain is a framework for building agents and LLM-powered applications. It helps you chain together interoperable components and third-party integrations to simplify AI application development — all while future-proofing decisions as the underlying technology evolves.
[!TIP] Just getting started? Check out Deep Agents — a higher-level package built on LangChain for agents that have built-in capabilities for common usage patterns such as planning, subagents, file system usage, and more.
uv add langchain
from langchain.chat_models import init_chat_model
model = init_chat_model("openai:gpt-5.5")
result = model.invoke("Hello, world!")
If you're looking for more advanced customization or agent orchestration, check out LangGraph, our framework for building controllable agent workflows.
For an equivalent JS/TS library, check out .
[!TIP] For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.
While the LangChain framework can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools when building LLM applications.
LangChain helps developers build applications powered by LLMs through a standard interface for models, embeddings, vector stores, and more.
内容由编辑整理,部分信息来自 GitHub 与项目官网,版权归原作者所有。发现错误?报告问题