Skip to main content

介绍

¥Introduction

LangChain 是一个用于开发由大型语言模型 (LLM) 驱动的应用的框架。

¥LangChain is a framework for developing applications powered by large language models (LLMs).

LangChain 简化了 LLM 应用生命周期的每个阶段:

¥LangChain simplifies every stage of the LLM application lifecycle:

  • 开发:使用 LangChain 的开源 构建区块components第三方集成 构建你的应用。使用 LangGraph.js 构建具有一流流式传输和人机交互支持的状态代理。

    ¥Development: Build your applications using LangChain's open-source building blocks, components, and third-party integrations. Use LangGraph.js to build stateful agents with first-class streaming and human-in-the-loop support.

  • 生产化:使用 LangSmith 检查、监控和评估你的链,以便你可以自信地持续优化和部署。

    ¥Productionization: Use LangSmith to inspect, monitor and evaluate your chains, so that you can continuously optimize and deploy with confidence.

  • 部署:使用 LangGraph 云 将你的 LangGraph 应用转换为可用于生产的 API 和助手。

    ¥Deployment: Turn your LangGraph applications into production-ready APIs and Assistants with LangGraph Cloud.

Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.Diagram outlining the hierarchical organization of the LangChain framework, displaying the interconnected parts across multiple layers.

具体来说,该框架包含以下开源库:

¥Concretely, the framework consists of the following open-source libraries:

  • @langchain/core:基础抽象和 LangChain 表达式语言。

    ¥@langchain/core: Base abstractions and LangChain Expression Language.

  • @langchain/community:第三方集成。

    ¥@langchain/community: Third party integrations.

    • 合作伙伴包(例如 @langchain/openai@langchain/anthropic 等):某些集成已进一步拆分为仅依赖于 @langchain/core 的轻量级包。

      ¥Partner packages (e.g. @langchain/openai, @langchain/anthropic, etc.): Some integrations have been further split into their own lightweight packages that only depend on @langchain/core.

  • langchain:构成应用认知架构的链、代理和检索策略。

    ¥langchain: Chains, agents, and retrieval strategies that make up an application's cognitive architecture.

  • LangGraph.js:通过将步骤建模为图中的边和节点,使用 LLM 构建健壮且有状态的多参与者应用。

    ¥LangGraph.js: Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph.

  • LangSmith:一个开发者平台,可用于调试、测试、评估和监控 LLM 应用。

    ¥LangSmith: A developer platform that lets you debug, test, evaluate, and monitor LLM applications.

note

这些文档重点介绍 JavaScript LangChain 库。Head 链接 提供 Python LangChain 库的文档。

¥These docs focus on the JavaScript LangChain library. Head here for docs on the Python LangChain library.

教程

¥Tutorials

如果你正在寻找一个特定用途的数据库,或者你更喜欢实践学习,请查看我们的 tutorials。这是最佳入门点。

¥If you're looking to build something specific or are more of a hands-on learner, check out our tutorials. This is the best place to get started.

这些是入门的最佳选择:

¥These are the best ones to get started with:

浏览 LangChain 教程 此处 的完整列表,并查看其他 LangGraph 教程(此处)

¥Explore the full list of LangChain tutorials here, and check out other LangGraph tutorials here.

操作指南

¥How-To Guides

链接 为你提供“我如何……?”等问题的简短答案。这些操作指南未深入涵盖主题 - 你可以在 教程API 参考 中找到相关内容。但是,这些指南将帮助你快速完成常见任务。

¥Here you'll find short answers to “How do I….?” types of questions. These how-to guides don't cover topics in depth - you'll find that material in the Tutorials and the API Reference. However, these guides will help you quickly accomplish common tasks.

查看 LangGraph 专用操作指南(此处)

¥Check out LangGraph-specific how-tos here.

概念指南

¥Conceptual Guide

介绍你需要了解的 LangChain 的所有关键部分!链接 为你提供所有 LangChain 概念的高级解释。

¥Introductions to all the key parts of LangChain you'll need to know! Here you'll find high level explanations of all LangChain concepts.

要深入了解 LangGraph 概念,请查看 此页面

¥For a deeper dive into LangGraph concepts, check out this page.

API 参考

¥API reference

前往参考资料部分,获取 LangChain JavaScript 包中所有类和方法的完整文档。

¥Head to the reference section for full documentation of all classes and methods in the LangChain JavaScript packages.

生态系统

¥Ecosystem

🦜🛠️ LangSmith

跟踪和评估你的语言模型应用和智能代理,帮助你从原型阶段过渡到生产阶段。

¥Trace and evaluate your language model applications and intelligent agents to help you move from prototype to production.

🦜🕸️ LangGraph

使用 LLM 构建有状态的多参与者应用。与 LangChain 顺利集成,但也可以独立使用。LangGraph 为生产级代理提供支持,深受 Linkedin、Uber、Klarna、GitLab 等众多公司的信赖。

¥Build stateful, multi-actor applications with LLMs. Integrates smoothly with LangChain, but can be used without it. LangGraph powers production-grade agents, trusted by Linkedin, Uber, Klarna, GitLab, and many more.

其他资源

¥Additional resources

安全

¥Security

阅读我们的 安全 最佳实践,确保你使用 LangChain 安全开发。

¥Read up on our Security best practices to make sure you're developing safely with LangChain.

集成

¥Integrations

LangChain 是一个丰富的工具生态系统的一部分,这些工具与我们的框架集成并在此基础上构建。查看我们不断更新的 integrations 列表。

¥LangChain is part of a rich ecosystem of tools that integrate with our framework and build on top of it. Check out our growing list of integrations.

贡献

¥Contributing

查看开发者指南,获取贡献指南并帮助你设置开发环境。

¥Check out the developer's guide for guidelines on contributing and help getting your dev environment set up.