langchain README

The project's README from github.com/langchain-ai/langchain. As one markdown file: README.md.

LangChain Logo

The agent engineering platform.

PyPI - License PyPI - Downloads Version Twitter / X

LangChain 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.

Quickstart

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 LangChain.js.

[!TIP] For developing, debugging, and deploying AI agents and LLM applications, see LangSmith.

LangChain ecosystem

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.

Why use LangChain?

LangChain helps developers build applications powered by LLMs through a standard interface for models, embeddings, vector stores, and more.


Resources

langchain (langchain-ai/langchain)

Searching Database…

这是什么东西?LangChain 是一个用于构建智能体和大模型应用的开发框架:它把可互操作的组件和第三方集成串联在一起,简化 AI 应用的开发。
是要写代码集成到我自己的应用里,还是一个托管的平台?需要写代码集成:它是一个开源的 Python 框架,导入到你的项目中使用;JavaScript 方面还有一个对应的库 LangChain.js。
我怎么从零开始做出第一个能跑的智能体?Quickstart 会按你的需求指引路线:想用常见的智能体模式,就从 Deep Agents 开始;需要深度定制和编排时,再转到 LangGraph。
可以搭配 OpenAI、Anthropic 或 Gemini 这类模型使用吗?可以——集成正是它的核心思路:包括对话和嵌入模型,以及各种工具和工具集,仓库里明确列出了 OpenAI、Anthropic 和 Gemini 等模型提供商。
我可能需要的东西都在这一个包里吗?不是——这个框架可以独立使用,但它只是更大生态的一部分:Deep Agents、LangGraph 和 LangSmith 都是独立的包和产品,按需采用即可。
这是用来做快速实验的,还是能用于正式的生产应用?两者都可以:它凭借模块化组件支持快速原型开发,也能借助久经验证的模式以及内置的监控和评估支持,逐步演进到生产环境。
官方推荐起点 Deep Agents 是什么?一个构建在 LangChain 之上的更高层封装包:它的智能体自带规划、子智能体和文件系统使用能力,开箱即用,覆盖常见的智能体模式。
什么时候该改用 LangGraph?LangGraph 是这个生态中更底层的一层:一个用于构建可控智能体工作流的框架,能可靠地处理复杂任务,位于 Deep Agents 那些高层抽象之下。
LangSmith 是什么?我需要它吗?它是配套产品,用于开发、调试和部署智能体——为大模型应用提供评估、可观测性和调试功能,还提供面向长时间运行的有状态工作流的部署平台。
Size
595.5 MB
Stars
148K
Age
4y
Commits · 90 Days