Skip to content

Weaviate Vector Store 节点#

¥Weaviate Vector Store node

使用 Wea​​viate 节点,以 矢量商店 身份与 Weaviate 集合进行交互。你可以将文档插入向量数据库或从中检索文档。你还可以检索文档,将其提供给连接到 chain 的检索器,或者将此节点直接连接到 agent 以用作 tool。本页包含 Weaviate 节点的节点参数以及更多资源的链接。

¥Use the Weaviate node to interact with your Weaviate collection as a vector store. You can insert documents into or retrieve documents from a vector database. You can also retrieve documents to provide them to a retriever connected to a chain or connect this node directly to an agent to use as a tool. On this page, you'll find the node parameters for the Weaviate node, and links to more resources.

Credentials

你可以在 此处 中找到此节点的身份验证信息。

¥You can find authentication information for this node here.

Parameter resolution in sub-nodes

Sub-nodes behave differently to other nodes when processing multiple items using an expression.

Most nodes, including root nodes, take any number of items as input, process these items, and output the results. You can use expressions to refer to input items, and the node resolves the expression for each item in turn. For example, given an input of five name values, the expression {{ $json.name }} resolves to each name in turn.

In sub-nodes, the expression always resolves to the first item. For example, given an input of five name values, the expression {{ $json.name }} always resolves to the first name.

节点使用模式#

¥Node usage patterns

你可以在以下模式下使用 Wea​​viate 向量存储节点。

¥You can use the Weaviate Vector Store node in the following patterns.

作为常规应用使用用于插入和检索文档的节点#

¥Use as a regular node to insert and retrieve documents

你可以将 Weaviate 向量存储节点作为常规节点用于插入或获取文档。此模式将 Weaviate 向量存储置于常规连接流程中,无需使用代理。

¥You can use the Weaviate Vector Store as a regular node to insert or get documents. This pattern places the Weaviate Vector Store in the regular connection flow without using an agent.

直接连接到 AI 代理作为工具#

¥Connect directly to an AI agent as a tool

你可以将 Weaviate 矢量存储节点直接连接到 AI 代理 的工具连接器,以便在回答查询时使用矢量存储作为资源。

¥You can connect the Weaviate Vector Store node directly to the tool connector of an AI agent to use a vector store as a resource when answering queries.

在这里,连接方式如下:AI 代理(工具连接器)-> Weaviate Vector Store 节点。

¥Here, the connection would be: AI agent (tools connector) -> Weaviate Vector Store node.

使用检索器获取文档#

¥Use a retriever to fetch documents

你可以将 Vector Store 检索器 节点与 Weaviate Vector Store 节点配合使用,从 Weaviate Vector Store 节点获取文档。这通常与 Question and Answer 链 节点一起使用,用于从向量存储中获取与给定聊天输入匹配的文档。

¥You can use the Vector Store Retriever node with the Weaviate Vector Store node to fetch documents from the Weaviate Vector Store node. This is often used with the Question and Answer Chain node to fetch documents from the vector store that match the given chat input.

使用 Vector Store 问答工具回答问题#

¥Use the Vector Store Question Answer Tool to answer questions

另一种模式使用 Vector Store 问答工具 来汇总来自 Weaviate 向量存储节点的结果并回答问题。此模式并非直接连接 Weaviate 向量存储作为工具,而是使用专门用于汇总向量存储中数据的工具。

¥Another pattern uses the Vector Store Question Answer Tool to summarize results and answer questions from the Weaviate Vector Store node. Rather than connecting the Weaviate Vector Store directly as a tool, this pattern uses a tool specifically designed to summarizes data in the vector store.

节点参数#

¥Node parameters

Multitenancy

你可以将同一集合中的数据拆分到不同的独立租户中(例如,针对不同的客户)。为此,在插入和检索对象时,你必须始终提供 租户名称在 Weaviate 文档中了解更多关于多租户的信息

¥You can separate your data into isolated tenants for the same collection (for example, for different customers). For that, you must always provide a Tenant Name both when inserting and retrieving objects. Read more about multi tenancy in Weaviate docs.

Operation Mode#

This Vector Store node has four modes: Get Many, Insert Documents, Retrieve Documents (As Vector Store for Chain/Tool), and Retrieve Documents (As Tool for AI Agent). The mode you select determines the operations you can perform with the node and what inputs and outputs are available.

Get Many#

In this mode, you can retrieve multiple documents from your vector database by providing a prompt. The prompt is embedded and used for similarity search. The node returns the documents that are most similar to the prompt with their similarity score. This is useful if you want to retrieve a list of similar documents and pass them to an agent as additional context.

Insert Documents#

Use insert documents mode to insert new documents into your vector database.

Retrieve Documents (as Vector Store for Chain/Tool)#

Use Retrieve Documents (As Vector Store for Chain/Tool) mode with a vector-store retriever to retrieve documents from a vector database and provide them to the retriever connected to a chain. In this mode you must connect the node to a retriever node or root node.

Retrieve Documents (as Tool for AI Agent)#

Use Retrieve Documents (As Tool for AI Agent) mode to use the vector store as a tool resource when answering queries. When formulating responses, the agent uses the vector store when the vector store name and description match the question details.

获取多个参数#

¥Get Many parameters

  • Weaviate 集合:输入要使用的 Weaviate 集合的名称。

¥Weaviate Collection: Enter the name of the Weaviate collection to use.

  • 提示:输入搜索查询。

¥Prompt: Enter the search query.

  • 限制:输入要从向量存储中检索的结果数量。例如,将其设置为 10 以获取十个最佳结果。

¥Limit: Enter how many results to retrieve from the vector store. For example, set this to 10 to get the ten best results.

插入文档参数#

¥Insert Documents parameters

  • Weaviate 集合:输入要使用的 Weaviate 集合的名称。

¥Weaviate Collection: Enter the name of the Weaviate collection to use.

  • 嵌入批量大小:单个批次中要嵌入的文档数。默认值为 200 个文档。

¥Embedding Batch Size: The number of documents to embed in a single batch. The default is 200 documents.

检索文档(作为链/工具的向量存储)参数#

¥Retrieve Documents (As Vector Store for Chain/Tool) parameters

  • Weaviate 集合:输入要使用的 Weaviate 集合的名称。

¥Weaviate Collection: Enter the name of the Weaviate collection to use.

检索文档(作为工具) (适用于 AI 代理)参数#

¥Retrieve Documents (As Tool for AI Agent) parameters

  • Weaviate 集合:向量存储的名称。

¥Weaviate Collection: The name of the vector store.

  • 描述:向 LLM 解释此工具的功能。良好的、具体的描述有助于 LLM 更频繁地生成预期结果。

¥Description: Explain to the LLM what this tool does. A good, specific description allows LLMs to produce expected results more often.

  • Weaviate 集合:输入要使用的 Weaviate 集合的名称。

¥Weaviate Collection: Enter the name of the Weaviate collection to use.

  • 限制:输入要从向量存储中检索的结果数量。例如,将其设置为 10 以获取十个最佳结果。

¥Limit: Enter how many results to retrieve from the vector store. For example, set this to 10 to get the ten best results.

包含元数据#

¥Include Metadata

是否包含文档元数据。

¥Whether to include document metadata.

此功能可用于 获取多个检索文档(作为 AI 代理的工具) 模式。

¥You can use this with the Get Many and Retrieve Documents (As Tool for AI Agent) modes.

重新排序结果#

¥Rerank Results

Enables reranking. If you enable this option, you must connect a reranking node to the vector store. That node will then rerank the results for queries. You can use this option with the Get Many, Retrieve Documents (As Vector Store for Chain/Tool) and Retrieve Documents (As Tool for AI Agent) modes.

节点选项#

¥Node options

搜索过滤器#

¥Search Filters

适用于 获取多个检索文档(作为链/工具的向量存储)检索文档(作为 AI 代理的工具) 操作模式。

¥Available for the Get Many, Retrieve Documents (As Vector Store for Chain/Tool), and Retrieve Documents (As Tool for AI Agent) operation modes.

搜索数据时,使用此选项匹配与文档关联的元数据。你可以在 Weaviate 条件过滤器文档 页面上了解更多关于运算符和查询结构的信息。

¥When searching for data, use this to match metadata associated with documents. You can learn more about the operators and query structure in Weaviate's conditional filters documentation.

你可以将 ANDOR 与不同的运算符一起使用。操作符不区分大小写:

¥You can use both AND and OR with different operators. Operators are case insensitive:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
  "OR": [
    {
        "path": ["source"],
        "operator": "Equal",
        "valueString": "source1"
    },
    {
        "path": ["source"],
        "operator": "Equal",
        "valueString": "source1"
    }
  ]
}

支持的运算符:

¥Supported operators:

操作符: 必填字段 描述
'equal' valueStringvalueNumber 检查属性是否等于给定的字符串或数字
'like' valueString 检查字符串属性是否与某个模式匹配(例如,子字符串匹配)
'containsAny' valueTextArray(字符串数组) 检查属性是否包含任何给定值
'containsAll' valueTextArray(字符串数组) 检查属性是否包含所有给定值
'greaterThan' valueNumber 检查属性值是否大于给定数字
'lessThan' valueNumber 检查属性值是否小于给定数字
'isNull' valueBoolean(真假) 检查属性是否为空(必须先启用才能导入)
'withinGeoRange' valueGeoCoordinates(包含地理位置数据的对象) 按地理坐标的接近程度筛选。

插入数据时,文档加载器会设置元数据。有关加载文档的更多信息,请参阅 默认数据加载器

¥When inserting data, the document loader sets the metadata. Refer to Default Data Loader for more information on loading documents.

元数据键#

¥Metadata Keys

你可以定义 Weaviate 在查询中返回哪些元数据键。这可以降低网络负载,因为你只会获取已定义的属性。默认情况下,返回服务器提供的所有属性。

¥You can define which metadata keys you want Weaviate to return on your queries. This can reduce network load, as you will only get properties you have defined. Returns all properties from the server by default.

适用于 获取多个检索文档(作为链/工具的向量存储)检索文档(作为 AI 代理的工具) 操作模式。

¥Available for the Get Many, Retrieve Documents (As Vector Store for Chain/Tool), and Retrieve Documents (As Tool for AI Agent) operation modes.

租户名称#

¥Tenant Name

要存储或检索文档的特定租户。

¥The specific tenant to store or retrieve documents for.

Must enable at creation

首次导入数据时,你必须传递租户名称以启用集合的多租户功能。创建后无法启用或禁用多租户。

¥You must pass a tenant name at first ingestion to enable multitenancy for a collection. You can't enable or disable multitenancy after creation.

文本键#

¥Text Key

包含嵌入文本的文档中的键。

¥The key in the document that contains the embedded text.

跳过初始化检查#

¥Skip Init Checks

实例化客户端时是否使用 跳过初始化检查

¥Whether to skip initialization checks when instantiating the client.

初始化超时#

¥Init Timeout

初始检查期间,执行 超时 前等待的秒数。

¥Number of seconds to wait before timing out during initial checks.

插入超时#

¥Insert Timeout

插入操作期间,执行 超时 前等待的秒数。

¥Number of seconds to wait before timing out during inserts.

查询超时#

¥Query Timeout

查询操作期间,执行 超时 前等待的秒数。

¥Number of seconds to wait before timing out during queries.

gRPC 代理#

¥GRPC Proxy

用于 gRPC 请求的代理。

¥A proxy to use for gRPC requests.

清除数据#

¥Clear Data

适用于 插入文档 操作模式。

¥Available for the Insert Documents operation mode.

是否在插入新数据之前清除集合或租户。

¥Whether to clear the collection or tenant before inserting new data.

模板和示例#

¥Templates and examples

Template widget placeholder.

相关资源#

¥Related resources

有关服务的更多信息,请参阅 LangChain 的 Weaviate 文档

¥Refer to LangChain's Weaviate documentation for more information about the service.

有关自托管 Weaviate 集群,请参阅 Weaviate 安装

¥Refer to Weaviate Installation for a self hosted Weaviate Cluster.

View n8n's Advanced AI documentation.