From 2de751d4158352b98a30de57cd7ce6bdda99a4f9 Mon Sep 17 00:00:00 2001 From: jeanpaul Date: Mon, 9 Sep 2024 11:24:06 +0200 Subject: [PATCH] Add docs for new PGVector Vector store node (#2442) Co-authored-by: freakwriter --- .../cluster-nodes/vector-store-mode.md | 4 +- docs/advanced-ai/langchain/langchain-n8n.md | 1 + ...n8n-nodes-langchain.vectorstorepgvector.md | 74 +++++++++++++++++++ .../builtin/credentials/postgres.md | 1 + mkdocs.yml | 1 + styles/config/vocabularies/default/accept.txt | 1 + 6 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 docs/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector.md diff --git a/_snippets/integrations/builtin/cluster-nodes/vector-store-mode.md b/_snippets/integrations/builtin/cluster-nodes/vector-store-mode.md index 8f16d23b7..b3ac198a3 100644 --- a/_snippets/integrations/builtin/cluster-nodes/vector-store-mode.md +++ b/_snippets/integrations/builtin/cluster-nodes/vector-store-mode.md @@ -1,6 +1,6 @@ ### Operation Mode -Vector Store nodes in n8n have three modes: **Get Many**, **Insert Documents** and **Retrieve Documents**. The mode you select determines the operations you can perform with the node and what inputs and outputs are available. +Vector Store nodes in n8n have three modes: **Get Many**, **Insert Documents**, and **Retrieve Documents**. The mode you select determines the operations you can perform with the node and what inputs and outputs are available. #### Get Many @@ -9,7 +9,7 @@ In this mode, you can retrieve multiple documents from your vector database by p #### Insert Documents -Use insert documents mode to insert new documents into your vector database. +Use Insert Documents mode to insert new documents into your vector database. #### Retrieve Documents (For Agent/Chain) diff --git a/docs/advanced-ai/langchain/langchain-n8n.md b/docs/advanced-ai/langchain/langchain-n8n.md index 70ae2299a..268c64405 100644 --- a/docs/advanced-ai/langchain/langchain-n8n.md +++ b/docs/advanced-ai/langchain/langchain-n8n.md @@ -56,6 +56,7 @@ Learn more about [Agents in LangChain](https://js.langchain.com/docs/modules/age Vector stores store embedded data, and perform vector searches on it. * [In Memory Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory/) +* [PGVector Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector/) * [Pinecone Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepinecone/) * [Qdrant Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreqdrant/) * [Supabase Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoresupabase/) diff --git a/docs/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector.md b/docs/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector.md new file mode 100644 index 000000000..7a10e6ea8 --- /dev/null +++ b/docs/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector.md @@ -0,0 +1,74 @@ +--- +#https://www.notion.so/n8n/Frontmatter-432c2b8dff1f43d4b1c8d20075510fe4 +title: PGVector Vector Store +description: Documentation for the PGVector node in n8n, a workflow automation platform. Includes details of operations and configuration, and links to examples and credentials information. +priority: medium +--- + +# PGVector Vector Store + +PGVector is an extension of Postgresql. Use this node to interact with the PGVector tables in your Postgresql database. You can insert documents into a vector table, get documents from a vector table, and retrieve documents to provide them to a retriever connected to a chain. + +On this page, you'll find the node parameters for the PGVector node, and links to more resources. + +/// note | Credentials +You can find authentication information for this node [here](/integrations/builtin/credentials/postgres/). +/// + +--8<-- "_snippets/integrations/builtin/cluster-nodes/sub-node-expression-resolution.md" + +## Node parameters + +--8<-- "_snippets/integrations/builtin/cluster-nodes/vector-store-mode.md" + + +### Get Many parameters + + +* **Table name**: Enter the name of the table you want to query. +* **Prompt**: Enter your search query. +* **Limit**: Enter a number to set 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 name of the table you want to query. + +### Retrieve Documents parameters (for Agent/Chain) + +* **Table name**: Enter the name of the table you want to query. + +## Node options + +### Collection + +A way to separate datasets in PGVector. This creates a separate table and column to keep track of which collection a vector belongs to. + +* **Use Collection**: Select whether to use a collection (turned on) or not (turned off). +* **Collection Name**: Enter the name of the collection you want to use. +* **Collection Table Name**: Enter the name of the table to store collection information in. + +### Column Names + +The following options specify the names of the columns to store the vectors and corresponding information in: + +* **ID Column Name** +* **Vector Column Name** +* **Content Column Name** +* **Metadata Column Name** + +### Metadata Filter + +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-root-nodes/vector-store-metadata-filter.md" + +## Templates and examples + + +[[ templatesWidget(title, 'pgvector-vector-store') ]] + +## Related resources + +Refer to [LangChain's PGVector documentation](https://js.langchain.com/docs/integrations/vectorstores/pgvector){:target=_blank .external-link} for more information about the service. + +--8<-- "_snippets/integrations/builtin/cluster-nodes/langchain-overview-link.md" + +--8<-- "_snippets/self-hosting/starter-kits/self-hosted-ai-starter-kit.md" diff --git a/docs/integrations/builtin/credentials/postgres.md b/docs/integrations/builtin/credentials/postgres.md index 40ef068cf..c30e8e3fa 100644 --- a/docs/integrations/builtin/credentials/postgres.md +++ b/docs/integrations/builtin/credentials/postgres.md @@ -13,6 +13,7 @@ You can use these credentials to authenticate the following nodes: - [Postgres](/integrations/builtin/app-nodes/n8n-nodes-base.postgres/) - [Agent](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent) - [Postgres Chat Memory](/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorypostgreschat/) +- [PGVector Vector Store](/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector/) /// note | Agent node users The Agent node doesn't support SSH tunnels. diff --git a/mkdocs.yml b/mkdocs.yml index bbffc6473..0a6f2a382 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -779,6 +779,7 @@ nav: - integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.sentimentanalysis.md - integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.code.md - integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreinmemory.md + - integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepgvector.md - integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstorepinecone.md - integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreqdrant.md - integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoresupabase.md diff --git a/styles/config/vocabularies/default/accept.txt b/styles/config/vocabularies/default/accept.txt index 8176fa533..b3407f661 100644 --- a/styles/config/vocabularies/default/accept.txt +++ b/styles/config/vocabularies/default/accept.txt @@ -185,6 +185,7 @@ Ortto Oura PDFs Peekalink +PGVector PhantomBuster Pinterest Pipedrive