Supabase 向量存储节点#
使用 Supabase 向量存储与您的 Supabase 数据库作为向量存储进行交互。您可以将文档插入到向量数据库中,从向量数据库获取文档,检索文档以将它们提供给连接到链的检索器,或直接连接到智能体作为工具使用。您还可以通过 ID 更新向量存储中的项目。
在此页面上,您将找到 Supabase 节点的节点参数和更多资源的链接。
凭证
您可以在此处找到此节点的身份验证信息。
子节点中的参数解析
子节点在使用表达式处理多个项目时,与其他节点的行为不同。
大多数节点(包括根节点)接受任意数量的项目作为输入,处理这些项目,并输出结果。您可以使用表达式引用输入项目,节点会依次为每个项目解析表达式。例如,给定五个 name
值的输入,表达式 {{ $json.name }}
会依次解析为每个名称。
在子节点中,表达式始终解析为第一个项目。例如,给定五个 name
值的输入,表达式 {{ $json.name }}
始终解析为第一个名称。
Supabase provides a quickstart for setting up your vector store. If you use settings other than the defaults in the quickstart, this may affect parameter settings in n8n. Make sure you understand what you're doing.
Node usage patterns#
You can use the Supabase Vector Store node in the following patterns.
Use as a regular node to insert, update, and retrieve documents#
You can use the Supabase Vector Store as a regular node to insert, update, or get documents. This pattern places the Supabase Vector Store in the regular connection flow without using an agent.
You can see an example of this in scenario 1 of this template.
Connect directly to an AI agent as a tool#
You can connect the Supabase Vector Store node directly to the tool connector of an AI agent to use a vector store as a resource when answering queries.
Here, the connection would be: AI agent (tools connector) -> Supabase Vector Store node.
Use a retriever to fetch documents#
You can use the Vector Store Retriever node with the Supabase Vector Store node to fetch documents from the Supabase 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 (the example uses Pinecone, but the pattern in the same) would be: Question and Answer Chain (Retriever connector) -> Vector Store Retriever (Vector Store connector) -> Supabase Vector Store.
Use the Vector Store Question Answer Tool to answer questions#
Another pattern uses the Vector Store Question Answer Tool to summarize results and answer questions from the Supabase Vector Store node. Rather than connecting the Supabase Vector Store directly as a tool, this pattern uses a tool specifically designed to summarizes data in the vector store.
The connections flow in this case would look like this: AI agent (tools connector) -> Vector Store Question Answer Tool (Vector Store connector) -> Supabase Vector store.
Node parameters#
Operation Mode#
此向量存储节点有五种模式:获取多个、插入文档、检索文档(作为链/工具的向量存储)、检索文档(作为 AI 代理的工具)和更新文档。您选择的模式决定了您可以使用节点执行的操作以及可用的输入和输出。
获取多个#
在此模式下,您可以通过提供提示从向量数据库中检索多个文档。提示将被嵌入并用于相似性搜索。节点将返回与提示最相似的文档及其相似度分数。如果您想检索相似文档列表并将其作为额外上下文传递给代理,这非常有用。
插入文档#
使用插入文档模式将新文档插入到向量数据库中。
检索文档(作为链/工具的向量存储)#
使用检索文档(作为链/工具的向量存储)模式与向量存储检索器一起从向量数据库检索文档,并将其提供给连接到链的检索器。在此模式下,您必须将节点连接到检索器节点或根节点。
检索文档(作为 AI 代理的工具)#
使用检索文档(作为 AI 代理的工具)模式在回答查询时将向量存储用作工具资源。在制定响应时,当向量存储名称和描述与问题详细信息匹配时,代理会使用向量存储。
更新文档#
使用更新文档模式通过 ID 更新向量数据库中的文档。在 ID 中填入要更新的嵌入条目的 ID。
Rerank Results#
启用重新排序。如果您启用此选项,必须将重新排序节点连接到向量存储。该节点然后将对查询结果进行重新排序。您可以在 获取多个
、检索文档(作为链/工具的向量存储)
和 检索文档(作为 AI 代理的工具)
模式下使用此选项。
Get Many parameters#
- Table Name: Enter the Supabase table to use.
- Prompt: Enter the search query.
- 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#
- Table Name: Enter the Supabase table to use.
Retrieve Documents (As Vector Store for Chain/Tool) parameters#
- Table Name: Enter the Supabase table to use.
Retrieve Documents (As Tool for AI Agent) parameters#
- Name: The name of the vector store.
- Description: Explain to the LLM what this tool does. A good, specific description allows LLMs to produce expected results more often.
- Table Name: Enter the Supabase table to use.
- Limit: Enter how many results to retrieve from the vector store. For example, set this to
10
to get the ten best results.
Update Documents#
- Table Name: Enter the Supabase table to use.
- ID: The ID of an embedding entry.
Parameters for Update Documents
- ID
Node options#
Query Name#
The name of the matching function you set up in Supabase. If you follow the Supabase quickstart, this will be match_documents
.
Metadata Filter#
在获取多个模式下可用。搜索数据时,使用此选项与文档相关的元数据进行匹配。
这是一个 AND
查询。如果您指定多个元数据过滤器字段,所有字段都必须匹配。
插入数据时,元数据是使用文档加载器设置的。有关加载文档的更多信息,请参阅默认数据加载器。
Templates and examples#
Related resources#
Refer to LangChain's Supabase documentation for more information about the service.
查看 n8n 的高级 AI 文档。
🚀 与作者交流

📚 教程 💡 案例 🔧 技巧

⚡ 快答 🎯 定制 🚀 支持