Skip to main content

架构

¥Architecture

LangChain 是一个由多个包组成的框架。

¥LangChain is a framework that consists of a number of packages.

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.

@langchain/core

此包包含不同组件的基本抽象以及将它们组合在一起的方法。此处定义了聊天模型、向量存储、工具等核心组件的接口。此处未定义任何第三方集成。依赖非常轻量。

¥This package contains base abstractions for different components and ways to compose them together. The interfaces for core components like chat models, vector stores, tools and more are defined here. No third-party integrations are defined here. The dependencies are very lightweight.

langchain

主要的 langchain 包包含构成应用认知架构的链和检索策略。这些不是第三方集成。此处的所有链、代理和检索策略并非特定于某个集成,而是所有集成的通用方法。

¥The main langchain package contains chains and retrieval strategies that make up an application's cognitive architecture. These are NOT third-party integrations. All chains, agents, and retrieval strategies here are NOT specific to any one integration, but rather generic across all integrations.

集成包

¥Integration packages

常用的集成都有自己的软件包(例如 @langchain/openai@langchain/anthropic 等),以便它们能够进行正确的版本控制并实现适当的轻量级。

¥Popular integrations have their own packages (e.g. @langchain/openai, @langchain/anthropic, etc) so that they can be properly versioned and appropriately lightweight.

更多信息请参见:

¥For more information see:

@langchain/community

此包包含由 LangChain 社区维护的第三方集成。关键集成包已分离(见上文)。本概述包含各种组件(聊天模型、向量存储、工具等)的集成。此软件包中的所有依赖都是可选的,以尽可能保持软件包的轻量级。

¥This package contains third-party integrations that are maintained by the LangChain community. Key integration packages are separated out (see above). This contains integrations for various components (chat models, vector stores, tools, etc). All dependencies in this package are optional to keep the package as lightweight as possible.

@langchain/langgraph

@langchain/langgraph 是一个编排框架,旨在通过将步骤建模为图中的边和节点,使用 LLM 构建健壮且有状态的多参与者应用。

¥@langchain/langgraph is an orchestration framework aimed at building robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph.

LangGraph 公开了用于创建常见代理类型的高级接口,以及用于编写自定义流程的低级 API。

¥LangGraph exposes high level interfaces for creating common types of agents, as well as a low-level API for composing custom flows.

[Further reading]
  • 请参阅我们的 LangGraph 概述 此处

    ¥See our LangGraph overview here.

  • 请参阅我们的 LangGraph 学院课程 此处

    ¥See our LangGraph Academy Course here.

LangSmith

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

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

更多信息,请参阅 LangSmith 文档

¥For more information, see the LangSmith documentation