Milvus 向量存储节点(Milvus Vector Store node)#
使用 Milvus 节点与你的 Milvus 数据库作为向量存储进行交互。你可以将文档插入向量数据库,从向量数据库获取文档,将文档检索后提供给连接到链的检索器,或者直接连接到作为工具的代理。
🌐 Use the Milvus node to interact with your Milvus database as vector store. You can insert documents into a vector database, get documents from a vector database, retrieve documents to provide them to a retriever connected to a chain, or connect directly to an agent as a tool.
本页包含 Milvus 节点的节点参数以及更多资源的链接。
🌐 On this page, you'll find the node parameters for the Milvus node, and links to more resources.
凭证
你可以在此处找到此节点的认证信息。
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)#
你可以按以下模式使用“Milvus 矢量存储”节点。
🌐 You can use the Milvus Vector Store node in the following patterns.
作为常规应用使用用于插入和检索文档的节点(Use as a regular node to insert and retrieve documents)#
您可以将 Milvus 向量存储作为常规节点来插入或获取文档。这种模式将 Milvus 向量存储放置在常规连接流程中,而无需使用代理。
🌐 You can use the Milvus Vector Store as a regular node to insert, or get documents. This pattern places the Milvus Vector Store in the regular connection flow without using an agent.
查看此 示例模板,了解如何构建一个系统,将文档存储在 Milvus 中,并检索它们以支持带引用的聊天式回答。
🌐 See this example template for how to build a system that stores documents in Milvus and retrieves them to support cited, chat-based answers.
直接连接到 AI 代理作为工具(Connect directly to an AI agent as a tool)#
你可以将 Milvus 向量存储节点直接连接到 AI 代理 的工具连接器,以在回答查询时将向量存储作为资源使用。
🌐 You can connect the Milvus Vector Store node directly to the tool connector of an AI agent to use a vector store as a resource when answering queries.
这里,连接方式是:AI 代理(工具连接器)-> Milvus 向量存储节点。参见这个示例模板,其中数据被嵌入并在 Milvus 中建立索引,AI 代理将向量存储用作问答的知识工具。
🌐 Here, the connection would be: AI agent (tools connector) -> Milvus Vector Store node. See this example template where data is embedded and indexed in Milvus, and the AI Agent uses the vector store as a knowledge tool for question-answering.
使用检索器获取文档(Use a retriever to fetch documents)#
你可以将 Vector Store Retriever 节点与 Milvus 向量存储节点一起使用,从 Milvus 向量存储节点获取文档。这通常与 Question and Answer Chain 节点一起使用,从向量存储中获取与给定聊天输入匹配的文档。
🌐 You can use the Vector Store Retriever node with the Milvus Vector Store node to fetch documents from the Milvus 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.
一个典型的节点连接流程如下:问答链(检索器连接器)-> 向量存储检索器(向量存储连接器)-> Milvus 向量存储。
🌐 A typical node connection flow looks like this: Question and Answer Chain (Retriever connector) -> Vector Store Retriever (Vector Store connector) -> Milvus Vector Store.
查看这个工作流程示例,了解如何将外部数据导入 Milvus 并构建基于聊天的语义问答系统。
🌐 Check out this workflow example to see how to ingest external data into Milvus and build a chat-based semantic Q&A system.
使用 Vector Store 问答工具回答问题(Use the Vector Store Question Answer Tool to answer questions)#
另一种模式使用 Vector Store Question Answer Tool 来总结结果并回答来自 Milvus 向量存储节点的问题。与直接将 Milvus 向量存储作为工具连接不同,这种模式使用了一个专门设计用于总结向量存储中数据的工具。
🌐 Another pattern uses the Vector Store Question Answer Tool to summarize results and answer questions from the Milvus Vector Store node. Rather than connecting the Milvus Vector Store directly as a tool, this pattern uses a tool specifically designed to summarizes data in the vector store.
连接流程如下:AI 代理(工具连接器)-> 向量存储问答工具(向量存储连接器)-> Milvus 向量存储。
🌐 The connections flow would look like this: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Milvus Vector store.
节点参数(Node parameters)#
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.
重新排序结果(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.
获取多个参数(Get Many parameters)#
- Milvus 集合:选择或输入要使用的 Milvus 集合。
- 提示:请输入你的搜索查询。
- 限制:输入要从向量存储中获取的结果数量。例如,将其设置为
10可获取十个最佳结果。
插入文档参数(Insert Documents parameters)#
- Milvus 集合:选择或输入要使用的 Milvus 集合。
- 清空集合:指定在插入新文档之前是否清空集合。
检索文档(作为链/工具的向量存储)参数(Retrieve Documents (As Vector Store for Chain/Tool) parameters)#
- Milvus 集合:选择或输入要使用的 Milvus 集合。
检索文档(作为工具) (适用于 AI 代理)参数(Retrieve Documents (As Tool for AI Agent) parameters)#
- 名称:向量存储的名称。
- 描述:向大型语言模型(LLM)解释此工具的功能。具体而清晰的描述可以让大型语言模型更频繁地产生预期的结果。
- Milvus 集合:选择或输入要使用的 Milvus 集合。
- 限制:输入要从向量存储中获取的结果数量。例如,将其设置为
10可获取十个最佳结果。
节点选项(Node options)#
元数据筛选器(Metadata Filter)#
Available in Get Many mode. When searching for data, use this to match with metadata associated with the document.
This is an AND query. If you specify more than one metadata filter field, all of them must match.
When inserting data, the metadata is set using the document loader. Refer to Default Data Loader for more information on loading documents.
清除集合(Clear Collection)#
可在 插入文档 模式下使用。插入新数据前会删除集合中的所有数据。
🌐 Available in Insert Documents mode. Deletes all data from the collection before inserting the new data.
相关资源(Related resources)#
有关该服务的更多信息,请参阅 LangChain 的 Milvus 文档。
🌐 Refer to LangChain's Milvus documentation for more information about the service.
View n8n's Advanced AI documentation.