Chroma 向量存储节点(Chroma Vector Store node)#
使用 Chroma 节点与你的 Chroma 数据库作为向量存储进行交互。你可以将文档插入向量数据库,从向量数据库获取文档,将文档检索出来以提供给连接到链的检索器,或者直接作为工具连接到代理。
🌐 Use the Chroma node to interact with your Chroma 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.
在此页面,你将找到 Chroma 节点的节点参数,以及更多资源的链接。
🌐 On this page, you'll find the node parameters for the Chroma node, and links to more resources.
凭证
你可以在这里找到此节点的认证信息。
节点使用模式(Node usage patterns)#
你可以在以下模式中使用 Chroma 向量存储节点。
🌐 You can use the Chroma Vector Store node in the following patterns.
作为常规应用使用用于插入和检索文档的节点(Use as a regular node to insert and retrieve documents)#
你可以将 Chroma 向量存储用作常规节点来插入或获取文档。这种模式将 Chroma 向量存储放置在常规连接流程中,而不使用代理。
🌐 You can use the Chroma Vector Store as a regular node to insert or get documents. This pattern places the Chroma Vector Store in the regular connection flow without using an agent.
直接连接到 AI 代理作为工具(Connect directly to an AI agent as a tool)#
你可以将 Chroma 向量存储节点直接连接到 AI 代理 的工具连接器,以在回答查询时使用向量存储作为资源。
🌐 You can connect the Chroma Vector Store node directly to the tool connector of an AI agent to use a vector store as a resource when answering queries.
这里,连接将是:AI 代理(工具连接器)-> Chroma 向量存储节点。
🌐 Here, the connection would be: AI agent (tools connector) -> Chroma Vector Store node.
使用检索器获取文档(Use a retriever to fetch documents)#
你可以将 Vector Store Retriever 节点与 Chroma Vector Store 节点一起使用,从 Chroma Vector Store 节点中获取文档。这通常与 Question and Answer Chain 节点一起使用,以获取与给定聊天输入匹配的向量存储中的文档。
🌐 You can use the Vector Store Retriever node with the Chroma Vector Store node to fetch documents from the Chroma 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.
连接流程的一个示例如下:
🌐 An example of the connection flow would be as follows:
问答链(检索器连接器) -> 向量存储检索器(向量存储连接器) -> Chroma 向量存储。
🌐 Question and Answer Chain (Retriever connector) -> Vector Store Retriever (Vector Store connector) -> Chroma Vector Store.
使用 Vector Store 问答工具回答问题(Use the Vector Store Question Answer Tool to answer questions)#
另一种模式使用向量存储问答工具来总结结果并回答来自Chroma向量存储节点的问题。与其将Chroma向量存储直接连接为工具,这种模式使用一个专门设计用于总结向量存储中数据的工具。
🌐 Another pattern uses the Vector Store Question Answer Tool to summarize results and answer questions from the Chroma Vector Store node. Rather than connecting the Chroma Vector Store directly as a tool, this pattern uses a tool specifically designed to summarize data in the vector store.
在这种情况下,连接流将如下所示:AI代理(工具连接器)-> 向量存储问答工具(向量存储连接器)-> Chroma向量存储。
🌐 The connections flow in this case would look like this: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Chroma Vector store.
节点参数(Node parameters)#
操作模式(Operation Mode)#
这个向量存储节点有四种模式:获取多个(Get Many)、插入文档(Insert Documents)、检索文档(作为用于链/工具的向量存储)(Retrieve Documents (As Vector Store for Chain/Tool))和检索文档(作为 AI 代理的工具)(Retrieve Documents (As Tool for AI Agent))。你选择的模式决定了可以使用节点执行的操作以及可用的输入和输出。
🌐 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.
检索文档(作为 AI 代理的工具)(Retrieve Documents (as Tool for AI Agent))#
使用“检索文档(作为AI代理工具)”模式,在回答查询时将向量存储作为工具资源使用。在生成回答时,当向量存储的名称和描述与问题细节匹配时,代理会使用该向量存储。
🌐 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)#
启用 重新排名。如果启用此选项,你必须将一个重新排名节点连接到向量存储。然后,该节点将对查询结果进行重新排名。你可以在 Get Many、Retrieve Documents (As Vector Store for Chain/Tool) 和 Retrieve Documents (As Tool for AI Agent) 模式下使用此选项。
🌐 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)#
- Chroma 集合名称:从获取的集合列表中选择你的集合。
- 提示:请输入搜索查询。
- 限制:输入要从向量存储中检索的结果数量。例如,将此设置为
5以获取五个最佳结果。
此操作模式包括一个节点选项,即元数据过滤器
🌐 This Operation Mode includes one Node option, the Metadata Filter
插入文档参数(Insert Documents parameters)#
- Chroma 集合名称:从获取的集合列表中选择你的集合。
检索文档(作为链/工具的向量存储)参数(Retrieve Documents (As Vector Store for Chain/Tool) parameters)#
- Chroma 集合名称:从获取的集合列表中选择你的集合。
此操作模式包括一个节点选项,即元数据过滤器
🌐 This Operation Mode includes one Node option, the Metadata Filter
检索文档(作为工具) (适用于 AI 代理)参数(Retrieve Documents (As Tool for AI Agent) parameters)#
- 描述:向大型语言模型(LLM)解释此工具的功能。具体而清晰的描述可以让大型语言模型更频繁地产生预期的结果。
- Chroma 集合名称:从获取的集合列表中选择你的集合。
- 限制:输入要从向量存储中检索的结果数量。例如,将此设置为
5以获取五个最佳结果。
节点选项(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.
相关资源(Related resources)#
有关该服务的更多信息,请参阅 LangChain 的 Chroma 文档。
🌐 Refer to LangChain's Chroma documentation for more information about the service.
查看 n8n 的 高级 AI 文档。
🌐 View n8n's Advanced AI documentation.