Skip to content

n8n 中的 LangChain 概念#

¥LangChain concepts in n8n

此页面解释了 LangChain 的概念和功能如何映射到 n8n 节点。

¥This page explains how LangChain concepts and features map to n8n nodes.

此页面包含 n8n 中以 LangChain 为中心的节点列表。你可以在与 LangChain 交互的工作流中使用任何 n8n 节点,以将 LangChain 链接到其他服务。LangChain 功能使用 n8n 的 集群节点

¥This page includes lists of the LangChain-focused nodes in n8n. You can use any n8n node in a workflow where you interact with LangChain, to link LangChain to other services. The LangChain features uses n8n's Cluster nodes.

n8n implements LangChain JS

此功能是 n8n 对 LangChain 的 JavaScript 框架 的实现。

¥This feature is n8n's implementation of LangChain's JavaScript framework.

触发器节点#

¥Trigger nodes

聊天触发器

¥Chat Trigger

集群节点#

¥Cluster nodes

Cluster nodes are node groups that work together to provide functionality in an n8n workflow. Instead of using a single node, you use a root node and one or more sub-nodes that extend the functionality of the node.

Screenshot of a workflow with a root node and two sub-nodes

根节点#

¥Root nodes

每个集群都以 根节点 开头。

¥Each cluster starts with one root node.

#

¥Chains

chain 是一系列 LLM 及其相关工具的集合,它们连接在一起,以支持单个 LLM 无法提供的功能。

¥A chain is a series of LLMs, and related tools, linked together to support functionality that can't be provided by a single LLM alone.

可用的节点:

¥Available nodes:

¥Basic LLM Chain

¥Retrieval Q&A Chain

¥Summarization Chain

¥Sentiment Analysis

¥Text Classifier

了解有关 LangChain 中的链式调用 的更多信息。

¥Learn more about chaining in LangChain.

代理#

¥Agents

agent 可以访问一套工具,并根据用户输入确定使用哪些工具。代理可以使用多个工具,并将一个工具的输出用作下一个工具的输入。

¥An agent has access to a suite of tools, and determines which ones to use depending on the user input. Agents can use multiple tools, and use the output of one tool as the input to the next. Source

可用的节点:

¥Available nodes:

¥Agent

了解有关 LangChain 中的代理 的更多信息。

¥Learn more about Agents in LangChain.

向量存储#

¥Vector stores

向量存储 存储嵌入数据,并对其执行向量搜索。

¥Vector stores store embedded data, and perform vector searches on it.

¥Simple Vector Store

¥PGVector Vector Store

¥Supabase Vector Store

了解有关 LangChain 中的矢量存储 的更多信息。

¥Learn more about Vector stores in LangChain.

其他#

¥Miscellaneous

实用程序节点。

¥Utility nodes.

LangChain 代码:导入 LangChain。这意味着如果你需要的功能 n8n 尚未创建相应的节点,你仍然可以使用它。

¥LangChain Code: import LangChain. This means if there is functionality you need that n8n hasn't created a node for, you can still use it.

子节点#

¥Sub-nodes

每个根节点可以附加一个或多个 sub-nodes

¥Each root node can have one or more sub-nodes attached to it.

文档加载器#

¥Document loaders

文档加载器会将数据作为文档添加到你的链中。数据源可以是文件或 Web 服务。

¥Document loaders add data to your chain as documents. The data source can be a file or web service.

可用的节点:

¥Available nodes:

¥Default Document Loader

¥GitHub Document Loader

了解有关 LangChain 中的文档加载器 的更多信息。

¥Learn more about Document loaders in LangChain.

语言模型#

¥Language models

LLM(大型语言模型) 是用于分析数据集的程序。它们是使用人工智能的关键要素。

¥LLMs (large language models) are programs that analyze datasets. They're the key element of working with AI.

可用的节点:

¥Available nodes:

¥Anthropic Chat Model

¥AWS Bedrock Chat Model

¥Cohere Model

¥Hugging Face Inference Model

¥Mistral Cloud Chat Model

¥Ollama Chat Model

¥Ollama Model

¥OpenAI Chat Model

了解有关 LangChain 中的语言模型 的更多信息。

¥Learn more about Language models in LangChain.

内存#

¥Memory

内存 保留一系列查询中先前查询的信息。例如,当用户与聊天模型交互时,如果你的应用能够记住并调用完整的对话,而不仅仅是用户输入的最新查询,这将非常有用。

¥Memory retains information about previous queries in a series of queries. For example, when a user interacts with a chat model, it's useful if your application can remember and call on the full conversation, not just the most recent query entered by the user.

可用的节点:

¥Available nodes:

¥Redis Chat Memory

了解有关 LangChain 中的内存 的更多信息。

¥Learn more about Memory in LangChain.

输出解析器#

¥Output parsers

输出解析器会获取 LLM 生成的文本,并将其格式化为符合你要求的结构。

¥Output parsers take the text generated by an LLM and format it to match the structure you require.

可用的节点:

¥Available nodes:

¥Auto-fixing Output Parser

¥Item List Output Parser

¥Structured Output Parser

了解有关 LangChain 中的输出解析器 的更多信息。

¥Learn more about Output parsers in LangChain.

检索器#

¥Retrievers

¥Contextual Compression Retriever

¥MultiQuery Retriever

¥Vector Store Retriever

¥Workflow Retriever

文本分割器#

¥Text splitters

文本拆分器将数据(文档)拆分,使 LLM 更容易处理信息并返回准确的结果。

¥Text splitters break down data (documents), making it easier for the LLM to process the information and return accurate results.

可用的节点:

¥Available nodes:

¥Character Text Splitter

¥Recursive Character Text Splitter

n8n 的文本分割节点实现了 LangChain 的 text_splitter API 的部分功能。

¥n8n's text splitter nodes implements parts of LangChain's text_splitter API.

工具#

¥Tools

实用程序 tools

¥Utility tools.

¥Calculator

¥Code Tool

¥Vector Store Tool

¥Wikipedia

¥Workflow Tool

嵌入#

¥Embeddings

嵌入 捕获 "relatedness" 中的文本、图片、视频或其他类型的信息。(source)

¥Embeddings capture the "relatedness" of text, images, video, or other types of information. (source)

可用的节点:

¥Available nodes:

¥Embeddings AWS Bedrock

¥Embeddings Cohere

¥Embeddings Google PaLM

¥Embeddings Hugging Face Inference

¥Embeddings Mistral Cloud

¥Embeddings Ollama

¥Embeddings OpenAI

了解有关 LangChain 中的文本嵌入 的更多信息。

¥Learn more about Text embeddings in LangChain.

其他#

¥Miscellaneous

¥Chat Memory Manager