@n8n/n8n-nodes-langchain 1.114.0 → 1.115.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js +1 -1
  2. package/dist/credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.js.map +1 -1
  3. package/dist/known/credentials.json +1 -0
  4. package/dist/known/nodes.json +8 -0
  5. package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js +339 -0
  6. package/dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js.map +1 -0
  7. package/dist/nodes/vector_store/VectorStoreRedis/redis.dark.svg +37 -0
  8. package/dist/nodes/vector_store/VectorStoreRedis/redis.svg +37 -0
  9. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +15 -1
  10. package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -1
  11. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js +3 -1
  12. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/index.js.map +1 -1
  13. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js +98 -0
  14. package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js.map +1 -0
  15. package/dist/nodes/vendors/Ollama/Ollama.node.js +42 -0
  16. package/dist/nodes/vendors/Ollama/Ollama.node.js.map +1 -0
  17. package/dist/nodes/vendors/Ollama/actions/descriptions.js +52 -0
  18. package/dist/nodes/vendors/Ollama/actions/descriptions.js.map +1 -0
  19. package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js +412 -0
  20. package/dist/nodes/vendors/Ollama/actions/image/analyze.operation.js.map +1 -0
  21. package/dist/nodes/vendors/Ollama/actions/image/index.js +64 -0
  22. package/dist/nodes/vendors/Ollama/actions/image/index.js.map +1 -0
  23. package/dist/nodes/vendors/Ollama/actions/node.type.js +17 -0
  24. package/dist/nodes/vendors/Ollama/actions/node.type.js.map +1 -0
  25. package/dist/nodes/vendors/Ollama/actions/router.js +78 -0
  26. package/dist/nodes/vendors/Ollama/actions/router.js.map +1 -0
  27. package/dist/nodes/vendors/Ollama/actions/text/index.js +64 -0
  28. package/dist/nodes/vendors/Ollama/actions/text/index.js.map +1 -0
  29. package/dist/nodes/vendors/Ollama/actions/text/message.operation.js +440 -0
  30. package/dist/nodes/vendors/Ollama/actions/text/message.operation.js.map +1 -0
  31. package/dist/nodes/vendors/Ollama/actions/versionDescription.js +107 -0
  32. package/dist/nodes/vendors/Ollama/actions/versionDescription.js.map +1 -0
  33. package/dist/nodes/vendors/Ollama/helpers/index.js +17 -0
  34. package/dist/nodes/vendors/Ollama/helpers/index.js.map +1 -0
  35. package/dist/nodes/vendors/Ollama/helpers/interfaces.js +17 -0
  36. package/dist/nodes/vendors/Ollama/helpers/interfaces.js.map +1 -0
  37. package/dist/nodes/vendors/Ollama/methods/index.js +39 -0
  38. package/dist/nodes/vendors/Ollama/methods/index.js.map +1 -0
  39. package/dist/nodes/vendors/Ollama/methods/listSearch.js +39 -0
  40. package/dist/nodes/vendors/Ollama/methods/listSearch.js.map +1 -0
  41. package/dist/nodes/vendors/Ollama/ollama.svg +1 -0
  42. package/dist/nodes/vendors/Ollama/transport/index.js +56 -0
  43. package/dist/nodes/vendors/Ollama/transport/index.js.map +1 -0
  44. package/dist/types/credentials.json +2 -2
  45. package/dist/types/nodes.json +2 -0
  46. package/package.json +11 -8
@@ -28,7 +28,7 @@ class AzureEntraCognitiveServicesOAuth2Api {
28
28
  // eslint-disable-next-line n8n-nodes-base/cred-class-field-display-name-missing-oauth2
29
29
  this.displayName = "Azure Entra ID (Azure Active Directory) API";
30
30
  this.extends = ["oAuth2Api"];
31
- this.documentationUrl = "azureEntraCognitiveServicesOAuth2Api";
31
+ this.documentationUrl = "azureentracognitiveservicesoauth2api";
32
32
  this.properties = [
33
33
  {
34
34
  displayName: "Grant Type",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.ts"],"sourcesContent":["import type { ICredentialType, INodeProperties } from 'n8n-workflow';\n\nconst defaultScopes = ['openid', 'offline_access'];\n\nexport class AzureEntraCognitiveServicesOAuth2Api implements ICredentialType {\n\tname = 'azureEntraCognitiveServicesOAuth2Api';\n\n\t// eslint-disable-next-line n8n-nodes-base/cred-class-field-display-name-missing-oauth2\n\tdisplayName = 'Azure Entra ID (Azure Active Directory) API';\n\n\textends = ['oAuth2Api'];\n\n\tdocumentationUrl = 'azureEntraCognitiveServicesOAuth2Api';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'Grant Type',\n\t\t\tname: 'grantType',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'authorizationCode',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Resource Name',\n\t\t\tname: 'resourceName',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'API Version',\n\t\t\tname: 'apiVersion',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '2025-03-01-preview',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Endpoint',\n\t\t\tname: 'endpoint',\n\t\t\ttype: 'string',\n\t\t\tdefault: undefined,\n\t\t\tplaceholder: 'https://westeurope.api.cognitive.microsoft.com',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Tenant ID',\n\t\t\tname: 'tenantId',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'common',\n\t\t\tdescription:\n\t\t\t\t'Enter your Azure Tenant ID (Directory ID) or keep \"common\" for multi-tenant apps. Using a specific Tenant ID is generally recommended and required for certain authentication flows.',\n\t\t\tplaceholder: 'e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or common',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authorization URL',\n\t\t\tname: 'authUrl',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/authorize',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Access Token URL',\n\t\t\tname: 'accessTokenUrl',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/token',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Additional Body Properties',\n\t\t\tname: 'additionalBodyProperties',\n\t\t\ttype: 'hidden',\n\t\t\tdefault:\n\t\t\t\t'{\"grant_type\": \"client_credentials\", \"resource\": \"https://cognitiveservices.azure.com/\"}',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: 'authentication',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'body',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Custom Scopes',\n\t\t\tname: 'customScopes',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription:\n\t\t\t\t'Define custom scopes. You might need this if the default scopes are not sufficient or if you want to minimize permissions. Ensure you include \"openid\" and \"offline_access\".',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Auth URI Query Parameters',\n\t\t\tname: 'authQueryParameters',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '',\n\t\t\tdescription:\n\t\t\t\t'For some services additional query parameters have to be set which can be defined here',\n\t\t\tplaceholder: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Enabled Scopes',\n\t\t\tname: 'enabledScopes',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tcustomScopes: [true],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefault: defaultScopes.join(' '),\n\t\t\tplaceholder: 'openid offline_access',\n\t\t\tdescription: 'Space-separated list of scopes to request.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Scope',\n\t\t\tname: 'scope',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '={{ $self.customScopes ? $self.enabledScopes : \"' + defaultScopes.join(' ') + '\"}}',\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,gBAAgB,CAAC,UAAU,gBAAgB;AAE1C,MAAM,qCAAgE;AAAA,EAAtE;AACN,gBAAO;AAGP;AAAA,uBAAc;AAEd,mBAAU,CAAC,WAAW;AAEtB,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,QACD,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,MACF;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,QACT,aACC;AAAA,QACD,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,gBAAgB;AAAA,UACf,MAAM;AAAA,YACL,cAAc,CAAC,IAAI;AAAA,UACpB;AAAA,QACD;AAAA,QACA,SAAS,cAAc,KAAK,GAAG;AAAA,QAC/B,aAAa;AAAA,QACb,aAAa;AAAA,MACd;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS,qDAAqD,cAAc,KAAK,GAAG,IAAI;AAAA,MACzF;AAAA,IACD;AAAA;AACD;","names":[]}
1
+ {"version":3,"sources":["../../credentials/AzureEntraCognitiveServicesOAuth2Api.credentials.ts"],"sourcesContent":["import type { ICredentialType, INodeProperties } from 'n8n-workflow';\n\nconst defaultScopes = ['openid', 'offline_access'];\n\nexport class AzureEntraCognitiveServicesOAuth2Api implements ICredentialType {\n\tname = 'azureEntraCognitiveServicesOAuth2Api';\n\n\t// eslint-disable-next-line n8n-nodes-base/cred-class-field-display-name-missing-oauth2\n\tdisplayName = 'Azure Entra ID (Azure Active Directory) API';\n\n\textends = ['oAuth2Api'];\n\n\tdocumentationUrl = 'azureentracognitiveservicesoauth2api';\n\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'Grant Type',\n\t\t\tname: 'grantType',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'authorizationCode',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Resource Name',\n\t\t\tname: 'resourceName',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'API Version',\n\t\t\tname: 'apiVersion',\n\t\t\ttype: 'string',\n\t\t\trequired: true,\n\t\t\tdefault: '2025-03-01-preview',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Endpoint',\n\t\t\tname: 'endpoint',\n\t\t\ttype: 'string',\n\t\t\tdefault: undefined,\n\t\t\tplaceholder: 'https://westeurope.api.cognitive.microsoft.com',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Tenant ID',\n\t\t\tname: 'tenantId',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'common',\n\t\t\tdescription:\n\t\t\t\t'Enter your Azure Tenant ID (Directory ID) or keep \"common\" for multi-tenant apps. Using a specific Tenant ID is generally recommended and required for certain authentication flows.',\n\t\t\tplaceholder: 'e.g., xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx or common',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authorization URL',\n\t\t\tname: 'authUrl',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/authorize',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Access Token URL',\n\t\t\tname: 'accessTokenUrl',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '=https://login.microsoftonline.com/{{$self[\"tenantId\"]}}/oauth2/token',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Additional Body Properties',\n\t\t\tname: 'additionalBodyProperties',\n\t\t\ttype: 'hidden',\n\t\t\tdefault:\n\t\t\t\t'{\"grant_type\": \"client_credentials\", \"resource\": \"https://cognitiveservices.azure.com/\"}',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authentication',\n\t\t\tname: 'authentication',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: 'body',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Custom Scopes',\n\t\t\tname: 'customScopes',\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tdescription:\n\t\t\t\t'Define custom scopes. You might need this if the default scopes are not sufficient or if you want to minimize permissions. Ensure you include \"openid\" and \"offline_access\".',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Auth URI Query Parameters',\n\t\t\tname: 'authQueryParameters',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '',\n\t\t\tdescription:\n\t\t\t\t'For some services additional query parameters have to be set which can be defined here',\n\t\t\tplaceholder: '',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Enabled Scopes',\n\t\t\tname: 'enabledScopes',\n\t\t\ttype: 'string',\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tcustomScopes: [true],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdefault: defaultScopes.join(' '),\n\t\t\tplaceholder: 'openid offline_access',\n\t\t\tdescription: 'Space-separated list of scopes to request.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Scope',\n\t\t\tname: 'scope',\n\t\t\ttype: 'hidden',\n\t\t\tdefault: '={{ $self.customScopes ? $self.enabledScopes : \"' + defaultScopes.join(' ') + '\"}}',\n\t\t},\n\t];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,MAAM,gBAAgB,CAAC,UAAU,gBAAgB;AAE1C,MAAM,qCAAgE;AAAA,EAAtE;AACN,gBAAO;AAGP;AAAA,uBAAc;AAEd,mBAAU,CAAC,WAAW;AAEtB,4BAAmB;AAEnB,sBAAgC;AAAA,MAC/B;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SAAS;AAAA,MACV;AAAA,MACA;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,MAAM;AAAA,QACN,UAAU;AAAA,QACV,SA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"className": "OllamaApi",
93
93
  "sourcePath": "dist/credentials/OllamaApi.credentials.js",
94
94
  "supportedNodes": [
95
+ "ollama",
95
96
  "embeddingsOllama",
96
97
  "lmChatOllama",
97
98
  "lmOllama"
@@ -7,6 +7,10 @@
7
7
  "className": "GoogleGemini",
8
8
  "sourcePath": "dist/nodes/vendors/GoogleGemini/GoogleGemini.node.js"
9
9
  },
10
+ "ollama": {
11
+ "className": "Ollama",
12
+ "sourcePath": "dist/nodes/vendors/Ollama/Ollama.node.js"
13
+ },
10
14
  "openAi": {
11
15
  "className": "OpenAi",
12
16
  "sourcePath": "dist/nodes/vendors/OpenAi/OpenAi.node.js"
@@ -351,6 +355,10 @@
351
355
  "className": "VectorStorePineconeLoad",
352
356
  "sourcePath": "dist/nodes/vector_store/VectorStorePineconeLoad/VectorStorePineconeLoad.node.js"
353
357
  },
358
+ "vectorStoreRedis": {
359
+ "className": "VectorStoreRedis",
360
+ "sourcePath": "dist/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.js"
361
+ },
354
362
  "vectorStoreQdrant": {
355
363
  "className": "VectorStoreQdrant",
356
364
  "sourcePath": "dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js"
@@ -0,0 +1,339 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var VectorStoreRedis_node_exports = {};
20
+ __export(VectorStoreRedis_node_exports, {
21
+ VectorStoreRedis: () => VectorStoreRedis,
22
+ getParameter: () => getParameter,
23
+ getParameterAsNumber: () => getParameterAsNumber,
24
+ getRedisClient: () => getRedisClient,
25
+ listIndexes: () => listIndexes,
26
+ redisConfig: () => redisConfig
27
+ });
28
+ module.exports = __toCommonJS(VectorStoreRedis_node_exports);
29
+ var import_redis = require("@langchain/redis");
30
+ var import_n8n_workflow = require("n8n-workflow");
31
+ var import_redis2 = require("redis");
32
+ var import_createVectorStoreNode = require("../shared/createVectorStoreNode/createVectorStoreNode");
33
+ const REDIS_CREDENTIALS = "redis";
34
+ const REDIS_INDEX_NAME = "redisIndex";
35
+ const REDIS_KEY_PREFIX = "keyPrefix";
36
+ const REDIS_OVERWRITE_DOCUMENTS = "overwriteDocuments";
37
+ const REDIS_METADATA_KEY = "metadataKey";
38
+ const REDIS_METADATA_FILTER = "metadataFilter";
39
+ const REDIS_CONTENT_KEY = "contentKey";
40
+ const REDIS_EMBEDDING_KEY = "vectorKey";
41
+ const REDIS_TTL = "ttl";
42
+ const redisIndexRLC = {
43
+ displayName: "Redis Index",
44
+ name: REDIS_INDEX_NAME,
45
+ type: "resourceLocator",
46
+ default: { mode: "list", value: "" },
47
+ required: true,
48
+ modes: [
49
+ {
50
+ displayName: "From List",
51
+ name: "list",
52
+ type: "list",
53
+ typeOptions: {
54
+ searchListMethod: "redisIndexSearch"
55
+ }
56
+ },
57
+ {
58
+ displayName: "ID",
59
+ name: "id",
60
+ type: "string"
61
+ }
62
+ ]
63
+ };
64
+ const metadataFilterField = {
65
+ displayName: "Metadata Filter",
66
+ name: REDIS_METADATA_FILTER,
67
+ type: "string",
68
+ description: "The comma-separated list of words by which to apply additional full-text metadata filtering",
69
+ placeholder: "Item1,Item2,Item3",
70
+ default: ""
71
+ };
72
+ const metadataKeyField = {
73
+ displayName: "Metadata Key",
74
+ name: REDIS_METADATA_KEY,
75
+ type: "string",
76
+ description: "The hash key to be used to store the metadata of the document",
77
+ placeholder: "metadata",
78
+ default: ""
79
+ };
80
+ const contentKeyField = {
81
+ displayName: "Content Key",
82
+ name: REDIS_CONTENT_KEY,
83
+ type: "string",
84
+ description: "The hash key to be used to store the content of the document",
85
+ placeholder: "content",
86
+ default: ""
87
+ };
88
+ const embeddingKeyField = {
89
+ displayName: "Embedding Key",
90
+ name: REDIS_EMBEDDING_KEY,
91
+ type: "string",
92
+ description: "The hash key to be used to store the embedding of the document",
93
+ placeholder: "content_vector",
94
+ default: ""
95
+ };
96
+ const overwriteDocuments = {
97
+ displayName: "Overwrite Documents",
98
+ name: REDIS_OVERWRITE_DOCUMENTS,
99
+ type: "boolean",
100
+ description: "Whether existing documents and the index should be overwritten",
101
+ default: false
102
+ };
103
+ const keyPrefixField = {
104
+ displayName: "Key Prefix",
105
+ name: REDIS_KEY_PREFIX,
106
+ type: "string",
107
+ description: "Prefix for Redis keys storing the documents",
108
+ placeholder: "doc",
109
+ default: ""
110
+ };
111
+ const ttlField = {
112
+ displayName: "Time-To-Live",
113
+ name: REDIS_TTL,
114
+ description: "Time-to-live for the documents in seconds",
115
+ placeholder: "0",
116
+ type: "number",
117
+ default: ""
118
+ };
119
+ const sharedFields = [redisIndexRLC];
120
+ const insertFields = [
121
+ {
122
+ displayName: "Options",
123
+ name: "options",
124
+ type: "collection",
125
+ placeholder: "Add Option",
126
+ default: {},
127
+ options: [
128
+ keyPrefixField,
129
+ overwriteDocuments,
130
+ metadataKeyField,
131
+ contentKeyField,
132
+ embeddingKeyField,
133
+ ttlField
134
+ ]
135
+ }
136
+ ];
137
+ const retrieveFields = [
138
+ {
139
+ displayName: "Options",
140
+ name: "options",
141
+ type: "collection",
142
+ placeholder: "Add Option",
143
+ default: {},
144
+ options: [
145
+ metadataFilterField,
146
+ keyPrefixField,
147
+ metadataKeyField,
148
+ contentKeyField,
149
+ embeddingKeyField
150
+ ]
151
+ }
152
+ ];
153
+ const redisConfig = {
154
+ client: null,
155
+ connectionString: ""
156
+ };
157
+ async function getRedisClient(context) {
158
+ const credentials = await context.getCredentials(REDIS_CREDENTIALS);
159
+ const config = {
160
+ socket: {
161
+ host: credentials.host || "localhost",
162
+ port: credentials.port || 6379,
163
+ tls: credentials.ssl === true
164
+ },
165
+ username: credentials.user,
166
+ password: credentials.password,
167
+ database: credentials.database,
168
+ clientInfoTag: "n8n"
169
+ };
170
+ if (!redisConfig.client || redisConfig.connectionString !== JSON.stringify(config)) {
171
+ if (redisConfig.client) {
172
+ await redisConfig.client.disconnect();
173
+ }
174
+ redisConfig.connectionString = JSON.stringify(config);
175
+ redisConfig.client = (0, import_redis2.createClient)(config);
176
+ if (redisConfig.client) {
177
+ redisConfig.client.on("error", (error) => {
178
+ context.logger.error(`[Redis client] ${error.message}`, { error });
179
+ });
180
+ await redisConfig.client.connect();
181
+ }
182
+ }
183
+ return redisConfig.client;
184
+ }
185
+ function isStringArray(value) {
186
+ return Array.isArray(value) && value.every((item) => typeof item === "string");
187
+ }
188
+ async function listIndexes() {
189
+ const client = await getRedisClient(this);
190
+ if (client === null) {
191
+ return { results: [] };
192
+ }
193
+ try {
194
+ const indexes = await client.ft._list();
195
+ if (!isStringArray(indexes)) {
196
+ this.logger.warn("FT._LIST returned unexpected data type");
197
+ return { results: [] };
198
+ }
199
+ const results = indexes.map((index) => ({
200
+ name: index,
201
+ value: index
202
+ }));
203
+ return { results };
204
+ } catch (error) {
205
+ this.logger.info("Failed to get Redis indexes: " + error.message);
206
+ return { results: [] };
207
+ }
208
+ }
209
+ function getParameter(key, context, itemIndex) {
210
+ return context.getNodeParameter(key, itemIndex, "", {
211
+ extractValue: true
212
+ });
213
+ }
214
+ function getParameterAsNumber(key, context, itemIndex) {
215
+ return context.getNodeParameter(key, itemIndex, "", {
216
+ extractValue: true
217
+ });
218
+ }
219
+ class ExtendedRedisVectorSearch extends import_redis.RedisVectorStore {
220
+ constructor(embeddings, options, filter) {
221
+ super(embeddings, options);
222
+ this.defaultFilter = filter;
223
+ }
224
+ async similaritySearchVectorWithScore(query, k) {
225
+ return await super.similaritySearchVectorWithScore(query, k, this.defaultFilter);
226
+ }
227
+ }
228
+ const getIndexName = getParameter.bind(null, REDIS_INDEX_NAME);
229
+ const getKeyPrefix = getParameter.bind(null, `options.${REDIS_KEY_PREFIX}`);
230
+ const getOverwrite = getParameter.bind(null, `options.${REDIS_OVERWRITE_DOCUMENTS}`);
231
+ const getContentKey = getParameter.bind(null, `options.${REDIS_CONTENT_KEY}`);
232
+ const getMetadataFilter = getParameter.bind(null, `options.${REDIS_METADATA_FILTER}`);
233
+ const getMetadataKey = getParameter.bind(null, `options.${REDIS_METADATA_KEY}`);
234
+ const getEmbeddingKey = getParameter.bind(null, `options.${REDIS_EMBEDDING_KEY}`);
235
+ const getTtl = getParameterAsNumber.bind(null, `options.${REDIS_TTL}`);
236
+ class VectorStoreRedis extends (0, import_createVectorStoreNode.createVectorStoreNode)({
237
+ meta: {
238
+ displayName: "Redis Vector Store",
239
+ name: "vectorStoreRedis",
240
+ description: "Work with your data in a Redis vector index",
241
+ icon: { light: "file:redis.svg", dark: "file:redis.dark.svg" },
242
+ docsUrl: "https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreredis/",
243
+ credentials: [
244
+ {
245
+ name: REDIS_CREDENTIALS,
246
+ required: true
247
+ }
248
+ ],
249
+ operationModes: ["load", "insert", "retrieve", "update", "retrieve-as-tool"]
250
+ },
251
+ methods: { listSearch: { redisIndexSearch: listIndexes } },
252
+ retrieveFields,
253
+ loadFields: retrieveFields,
254
+ insertFields,
255
+ sharedFields,
256
+ async getVectorStoreClient(context, _filter, embeddings, itemIndex) {
257
+ const client = await getRedisClient(context);
258
+ const indexField = getIndexName(context, itemIndex).trim();
259
+ const keyPrefixField2 = getKeyPrefix(context, itemIndex).trim();
260
+ const metadataField = getMetadataKey(context, itemIndex).trim();
261
+ const contentField = getContentKey(context, itemIndex).trim();
262
+ const embeddingField = getEmbeddingKey(context, itemIndex).trim();
263
+ const filter = getMetadataFilter(context, itemIndex).trim();
264
+ if (client === null) {
265
+ throw new import_n8n_workflow.NodeOperationError(context.getNode(), "Redis client not initialized", {
266
+ itemIndex,
267
+ description: "Please check your Redis connection details"
268
+ });
269
+ }
270
+ try {
271
+ await client.ft.info(indexField);
272
+ } catch (error) {
273
+ throw new import_n8n_workflow.NodeOperationError(context.getNode(), `Index ${indexField} not found`, {
274
+ itemIndex,
275
+ description: "Please check that the index exists in your Redis instance"
276
+ });
277
+ }
278
+ const filterTerms = filter ? filter.split(",").map((s) => s.trim()).filter((s) => s) : [];
279
+ return new ExtendedRedisVectorSearch(
280
+ embeddings,
281
+ {
282
+ redisClient: client,
283
+ indexName: indexField,
284
+ ...keyPrefixField2 ? { keyPrefix: keyPrefixField2 } : {},
285
+ ...metadataField ? { metadataKey: metadataField } : {},
286
+ ...contentField ? { contentKey: contentField } : {},
287
+ ...embeddingField ? { vectorKey: embeddingField } : {}
288
+ },
289
+ filterTerms.length > 0 ? filterTerms : void 0
290
+ );
291
+ },
292
+ async populateVectorStore(context, embeddings, documents, itemIndex) {
293
+ const client = await getRedisClient(context);
294
+ if (client === null) {
295
+ throw new import_n8n_workflow.NodeOperationError(context.getNode(), "Redis client not initialized", {
296
+ itemIndex,
297
+ description: "Please check your Redis connection details"
298
+ });
299
+ }
300
+ try {
301
+ const indexField = getIndexName(context, itemIndex).trim();
302
+ const overwrite = getOverwrite(context, itemIndex);
303
+ const keyPrefixField2 = getKeyPrefix(context, itemIndex).trim();
304
+ const metadataField = getMetadataKey(context, itemIndex).trim();
305
+ const contentField = getContentKey(context, itemIndex).trim();
306
+ const embeddingField = getEmbeddingKey(context, itemIndex).trim();
307
+ const ttl = getTtl(context, itemIndex);
308
+ if (overwrite) {
309
+ await client.ft.dropIndex(indexField, { DD: true });
310
+ }
311
+ await ExtendedRedisVectorSearch.fromDocuments(documents, embeddings, {
312
+ redisClient: client,
313
+ indexName: indexField,
314
+ ...keyPrefixField2 ? { keyPrefix: keyPrefixField2 } : {},
315
+ ...metadataField ? { metadataKey: metadataField } : {},
316
+ ...contentField ? { contentKey: contentField } : {},
317
+ ...embeddingField ? { vectorKey: embeddingField } : {},
318
+ ...ttl ? { ttl } : {}
319
+ });
320
+ } catch (error) {
321
+ context.logger.info(`Error while populating the store: ${error.message}`);
322
+ throw new import_n8n_workflow.NodeOperationError(context.getNode(), `Error: ${error.message}`, {
323
+ itemIndex,
324
+ description: "Please check your index/schema and parameters"
325
+ });
326
+ }
327
+ }
328
+ }) {
329
+ }
330
+ // Annotate the CommonJS export names for ESM import in node:
331
+ 0 && (module.exports = {
332
+ VectorStoreRedis,
333
+ getParameter,
334
+ getParameterAsNumber,
335
+ getRedisClient,
336
+ listIndexes,
337
+ redisConfig
338
+ });
339
+ //# sourceMappingURL=VectorStoreRedis.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.ts"],"sourcesContent":["import type { EmbeddingsInterface } from '@langchain/core/embeddings';\nimport { RedisVectorStore } from '@langchain/redis';\nimport type { RedisVectorStoreConfig } from '@langchain/redis/dist/vectorstores';\nimport {\n\ttype IExecuteFunctions,\n\ttype ILoadOptionsFunctions,\n\ttype INodeProperties,\n\ttype ISupplyDataFunctions,\n\tNodeOperationError,\n} from 'n8n-workflow';\nimport type { RedisClientOptions } from 'redis';\nimport { createClient } from 'redis';\n\nimport { createVectorStoreNode } from '../shared/createVectorStoreNode/createVectorStoreNode';\n\n/**\n * Constants for the name of the credentials and Node parameters.\n */\nconst REDIS_CREDENTIALS = 'redis';\nconst REDIS_INDEX_NAME = 'redisIndex';\nconst REDIS_KEY_PREFIX = 'keyPrefix';\nconst REDIS_OVERWRITE_DOCUMENTS = 'overwriteDocuments';\nconst REDIS_METADATA_KEY = 'metadataKey';\nconst REDIS_METADATA_FILTER = 'metadataFilter';\nconst REDIS_CONTENT_KEY = 'contentKey';\nconst REDIS_EMBEDDING_KEY = 'vectorKey';\nconst REDIS_TTL = 'ttl';\n\nconst redisIndexRLC: INodeProperties = {\n\tdisplayName: 'Redis Index',\n\tname: REDIS_INDEX_NAME,\n\ttype: 'resourceLocator',\n\tdefault: { mode: 'list', value: '' },\n\trequired: true,\n\tmodes: [\n\t\t{\n\t\t\tdisplayName: 'From List',\n\t\t\tname: 'list',\n\t\t\ttype: 'list',\n\t\t\ttypeOptions: {\n\t\t\t\tsearchListMethod: 'redisIndexSearch',\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'ID',\n\t\t\tname: 'id',\n\t\t\ttype: 'string',\n\t\t},\n\t],\n};\n\nconst metadataFilterField: INodeProperties = {\n\tdisplayName: 'Metadata Filter',\n\tname: REDIS_METADATA_FILTER,\n\ttype: 'string',\n\tdescription:\n\t\t'The comma-separated list of words by which to apply additional full-text metadata filtering',\n\tplaceholder: 'Item1,Item2,Item3',\n\tdefault: '',\n};\n\nconst metadataKeyField: INodeProperties = {\n\tdisplayName: 'Metadata Key',\n\tname: REDIS_METADATA_KEY,\n\ttype: 'string',\n\tdescription: 'The hash key to be used to store the metadata of the document',\n\tplaceholder: 'metadata',\n\tdefault: '',\n};\n\nconst contentKeyField: INodeProperties = {\n\tdisplayName: 'Content Key',\n\tname: REDIS_CONTENT_KEY,\n\ttype: 'string',\n\tdescription: 'The hash key to be used to store the content of the document',\n\tplaceholder: 'content',\n\tdefault: '',\n};\n\nconst embeddingKeyField: INodeProperties = {\n\tdisplayName: 'Embedding Key',\n\tname: REDIS_EMBEDDING_KEY,\n\ttype: 'string',\n\tdescription: 'The hash key to be used to store the embedding of the document',\n\tplaceholder: 'content_vector',\n\tdefault: '',\n};\n\nconst overwriteDocuments: INodeProperties = {\n\tdisplayName: 'Overwrite Documents',\n\tname: REDIS_OVERWRITE_DOCUMENTS,\n\ttype: 'boolean',\n\tdescription: 'Whether existing documents and the index should be overwritten',\n\tdefault: false,\n};\n\nconst keyPrefixField: INodeProperties = {\n\tdisplayName: 'Key Prefix',\n\tname: REDIS_KEY_PREFIX,\n\ttype: 'string',\n\tdescription: 'Prefix for Redis keys storing the documents',\n\tplaceholder: 'doc',\n\tdefault: '',\n};\n\nconst ttlField: INodeProperties = {\n\tdisplayName: 'Time-To-Live',\n\tname: REDIS_TTL,\n\tdescription: 'Time-to-live for the documents in seconds',\n\tplaceholder: '0',\n\ttype: 'number',\n\tdefault: '',\n};\n\nconst sharedFields: INodeProperties[] = [redisIndexRLC];\n\nconst insertFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\tkeyPrefixField,\n\t\t\toverwriteDocuments,\n\t\t\tmetadataKeyField,\n\t\t\tcontentKeyField,\n\t\t\tembeddingKeyField,\n\t\t\tttlField,\n\t\t],\n\t},\n];\n\nconst retrieveFields: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\ttype: 'collection',\n\t\tplaceholder: 'Add Option',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\tmetadataFilterField,\n\t\t\tkeyPrefixField,\n\t\t\tmetadataKeyField,\n\t\t\tcontentKeyField,\n\t\t\tembeddingKeyField,\n\t\t],\n\t},\n];\n\nexport const redisConfig = {\n\tclient: null as ReturnType<typeof createClient> | null,\n\tconnectionString: '',\n};\n\n/**\n * Type used for cleaner, more intentional typing.\n */\ntype IFunctionsContext = IExecuteFunctions | ISupplyDataFunctions | ILoadOptionsFunctions;\n\n/**\n * Get the Redis client.\n * @param context - The context.\n * @returns the Redis client for the node.\n */\nexport async function getRedisClient(context: IFunctionsContext) {\n\tconst credentials = await context.getCredentials(REDIS_CREDENTIALS);\n\n\t// Create client configuration object\n\tconst config: RedisClientOptions = {\n\t\tsocket: {\n\t\t\thost: (credentials.host as string) || 'localhost',\n\t\t\tport: (credentials.port as number) || 6379,\n\t\t\ttls: credentials.ssl === true,\n\t\t},\n\t\tusername: credentials.user as string,\n\t\tpassword: credentials.password as string,\n\t\tdatabase: credentials.database as number,\n\t\tclientInfoTag: 'n8n',\n\t};\n\n\tif (!redisConfig.client || redisConfig.connectionString !== JSON.stringify(config)) {\n\t\tif (redisConfig.client) {\n\t\t\tawait redisConfig.client.disconnect();\n\t\t}\n\n\t\tredisConfig.connectionString = JSON.stringify(config);\n\t\tredisConfig.client = createClient(config);\n\n\t\tif (redisConfig.client) {\n\t\t\tredisConfig.client.on('error', (error: Error) => {\n\t\t\t\tcontext.logger.error(`[Redis client] ${error.message}`, { error });\n\t\t\t});\n\n\t\t\tawait redisConfig.client.connect();\n\t\t}\n\t}\n\n\treturn redisConfig.client;\n}\n\n/**\n * Type guard to check if a value is a string array.\n * @param value - The value to check.\n * @returns True if the value is a string array, false otherwise.\n */\nfunction isStringArray(value: unknown): value is string[] {\n\treturn Array.isArray(value) && value.every((item) => typeof item === 'string');\n}\n\n/**\n * Get the complete list of indexes from Redis.\n * @returns The list of indexes.\n */\nexport async function listIndexes(this: ILoadOptionsFunctions) {\n\tconst client = await getRedisClient(this);\n\n\tif (client === null) {\n\t\treturn { results: [] };\n\t}\n\n\ttry {\n\t\t// Get all indexes using FT._LIST command\n\t\tconst indexes = await client.ft._list();\n\n\t\t// Validate that indexes is actually a string array\n\t\tif (!isStringArray(indexes)) {\n\t\t\tthis.logger.warn('FT._LIST returned unexpected data type');\n\t\t\treturn { results: [] };\n\t\t}\n\n\t\tconst results = indexes.map((index) => ({\n\t\t\tname: index,\n\t\t\tvalue: index,\n\t\t}));\n\n\t\treturn { results };\n\t} catch (error) {\n\t\tthis.logger.info('Failed to get Redis indexes: ' + error.message);\n\t\treturn { results: [] };\n\t}\n}\n\n/**\n * Get a parameter from the context.\n * @param key - The key of the parameter.\n * @param context - The context.\n * @param itemIndex - The index.\n * @returns The value.\n */\nexport function getParameter(key: string, context: IFunctionsContext, itemIndex: number): string {\n\treturn context.getNodeParameter(key, itemIndex, '', {\n\t\textractValue: true,\n\t}) as string;\n}\n\n/**\n * Get a parameter from the context as a number.\n * @param key - The key of the parameter.\n * @param context - The context.\n * @param itemIndex - The index.\n * @returns The value.\n */\nexport function getParameterAsNumber(\n\tkey: string,\n\tcontext: IFunctionsContext,\n\titemIndex: number,\n): number {\n\treturn context.getNodeParameter(key, itemIndex, '', {\n\t\textractValue: true,\n\t}) as number;\n}\n\n/**\n * Extended RedisVectorStore class to handle custom filtering.\n *\n * This wrapper is necessary because when used as a retriever, the similaritySearchVectorWithScore should\n * use a processed filter\n */\nclass ExtendedRedisVectorSearch extends RedisVectorStore {\n\tdefaultFilter?: string[];\n\n\tconstructor(embeddings: EmbeddingsInterface, options: RedisVectorStoreConfig, filter?: string[]) {\n\t\tsuper(embeddings, options);\n\t\tthis.defaultFilter = filter;\n\t}\n\n\tasync similaritySearchVectorWithScore(query: number[], k: number) {\n\t\treturn await super.similaritySearchVectorWithScore(query, k, this.defaultFilter);\n\t}\n}\n\nconst getIndexName = getParameter.bind(null, REDIS_INDEX_NAME);\nconst getKeyPrefix = getParameter.bind(null, `options.${REDIS_KEY_PREFIX}`);\nconst getOverwrite = getParameter.bind(null, `options.${REDIS_OVERWRITE_DOCUMENTS}`);\nconst getContentKey = getParameter.bind(null, `options.${REDIS_CONTENT_KEY}`);\nconst getMetadataFilter = getParameter.bind(null, `options.${REDIS_METADATA_FILTER}`);\nconst getMetadataKey = getParameter.bind(null, `options.${REDIS_METADATA_KEY}`);\nconst getEmbeddingKey = getParameter.bind(null, `options.${REDIS_EMBEDDING_KEY}`);\nconst getTtl = getParameterAsNumber.bind(null, `options.${REDIS_TTL}`);\n\nexport class VectorStoreRedis extends createVectorStoreNode({\n\tmeta: {\n\t\tdisplayName: 'Redis Vector Store',\n\t\tname: 'vectorStoreRedis',\n\t\tdescription: 'Work with your data in a Redis vector index',\n\t\ticon: { light: 'file:redis.svg', dark: 'file:redis.dark.svg' },\n\t\tdocsUrl:\n\t\t\t'https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.vectorstoreredis/',\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: REDIS_CREDENTIALS,\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\toperationModes: ['load', 'insert', 'retrieve', 'update', 'retrieve-as-tool'],\n\t},\n\tmethods: { listSearch: { redisIndexSearch: listIndexes } },\n\tretrieveFields,\n\tloadFields: retrieveFields,\n\tinsertFields,\n\tsharedFields,\n\tasync getVectorStoreClient(context, _filter, embeddings, itemIndex) {\n\t\tconst client = await getRedisClient(context);\n\t\tconst indexField = getIndexName(context, itemIndex).trim();\n\t\tconst keyPrefixField = getKeyPrefix(context, itemIndex).trim();\n\t\tconst metadataField = getMetadataKey(context, itemIndex).trim();\n\t\tconst contentField = getContentKey(context, itemIndex).trim();\n\t\tconst embeddingField = getEmbeddingKey(context, itemIndex).trim();\n\t\tconst filter = getMetadataFilter(context, itemIndex).trim();\n\n\t\tif (client === null) {\n\t\t\tthrow new NodeOperationError(context.getNode(), 'Redis client not initialized', {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check your Redis connection details',\n\t\t\t});\n\t\t}\n\n\t\t// Check if index exists by trying to get info about it\n\t\ttry {\n\t\t\tawait client.ft.info(indexField);\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(context.getNode(), `Index ${indexField} not found`, {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check that the index exists in your Redis instance',\n\t\t\t});\n\t\t}\n\n\t\t// Process filter: split by comma, trim, and remove empty strings\n\t\t// If no valid filter terms exist, pass undefined instead of empty array\n\t\tconst filterTerms = filter\n\t\t\t? filter\n\t\t\t\t\t.split(',')\n\t\t\t\t\t.map((s) => s.trim())\n\t\t\t\t\t.filter((s) => s)\n\t\t\t: [];\n\n\t\treturn new ExtendedRedisVectorSearch(\n\t\t\tembeddings,\n\t\t\t{\n\t\t\t\tredisClient: client,\n\t\t\t\tindexName: indexField,\n\t\t\t\t...(keyPrefixField ? { keyPrefix: keyPrefixField } : {}),\n\t\t\t\t...(metadataField ? { metadataKey: metadataField } : {}),\n\t\t\t\t...(contentField ? { contentKey: contentField } : {}),\n\t\t\t\t...(embeddingField ? { vectorKey: embeddingField } : {}),\n\t\t\t},\n\t\t\tfilterTerms.length > 0 ? filterTerms : undefined,\n\t\t);\n\t},\n\tasync populateVectorStore(context, embeddings, documents, itemIndex) {\n\t\tconst client = await getRedisClient(context);\n\n\t\tif (client === null) {\n\t\t\tthrow new NodeOperationError(context.getNode(), 'Redis client not initialized', {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check your Redis connection details',\n\t\t\t});\n\t\t}\n\n\t\ttry {\n\t\t\tconst indexField = getIndexName(context, itemIndex).trim();\n\t\t\tconst overwrite = getOverwrite(context, itemIndex);\n\t\t\tconst keyPrefixField = getKeyPrefix(context, itemIndex).trim();\n\t\t\tconst metadataField = getMetadataKey(context, itemIndex).trim();\n\t\t\tconst contentField = getContentKey(context, itemIndex).trim();\n\t\t\tconst embeddingField = getEmbeddingKey(context, itemIndex).trim();\n\t\t\tconst ttl = getTtl(context, itemIndex);\n\n\t\t\tif (overwrite) {\n\t\t\t\tawait client.ft.dropIndex(indexField, { DD: true });\n\t\t\t}\n\n\t\t\tawait ExtendedRedisVectorSearch.fromDocuments(documents, embeddings, {\n\t\t\t\tredisClient: client,\n\t\t\t\tindexName: indexField,\n\t\t\t\t...(keyPrefixField ? { keyPrefix: keyPrefixField } : {}),\n\t\t\t\t...(metadataField ? { metadataKey: metadataField } : {}),\n\t\t\t\t...(contentField ? { contentKey: contentField } : {}),\n\t\t\t\t...(embeddingField ? { vectorKey: embeddingField } : {}),\n\t\t\t\t...(ttl ? { ttl } : {}),\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tcontext.logger.info(`Error while populating the store: ${error.message}`);\n\t\t\tthrow new NodeOperationError(context.getNode(), `Error: ${error.message}`, {\n\t\t\t\titemInd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AAa;AAAA,MACd,CAAC;AAAA,IACF;AAAA,EACD;AACD,CAAC,EAAE;AAAC;","names":["import_redis","keyPrefixField"]}
@@ -0,0 +1,37 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 28.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
4
+ <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
5
+ <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
6
+ <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
7
+ <!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
8
+ <!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
9
+ <!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
10
+ <!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
11
+ <!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
12
+ ]>
13
+ <svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
14
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 156.0529938 144"
15
+ style="enable-background:new 0 0 156.0529938 144;" xml:space="preserve">
16
+ <style type="text/css">
17
+ .st0{fill:#FFFFFF;}
18
+ </style>
19
+ <metadata>
20
+ <sfw xmlns="&ns_sfw;">
21
+ <slices></slices>
22
+ <sliceSourceBounds bottomLeftOrigin="true" height="143.9999773" width="156.053" x="0" y="-143.9999773"></sliceSourceBounds>
23
+ </sfw>
24
+ </metadata>
25
+ <path class="st0" d="M147.6701355,79.4482651c-10.7946014,13.6011963-22.4527664,29.1454239-45.769104,29.1454239
26
+ c-20.826828,0-28.5858688-18.3700104-29.1312943-33.2931747c4.5630341,9.6490402,13.4846039,17.4628448,27.4041595,17.1012726
27
+ c26.7706146-0.8635712,45.1214371-25.0434799,45.1214371-47.0644608C145.2953339,18.998497,125.6491547,0,91.5382156,0
28
+ C67.1424179,0,36.9175339,9.2833567,17.0554695,23.9640141c-0.2158928,15.1124401,8.2038975,34.7586136,11.2263851,32.5996933
29
+ c17.2190762-12.3804779,30.8731899-20.3501434,44.1166077-24.3462524C52.7944527,54.0785789,5.7588773,104.8390808,0,113.7750931
30
+ c0.6476761,8.2038956,10.7946014,30.2248917,15.7601175,30.2248917c1.5112448,0,2.8065958-0.8635712,4.3178396-2.3748169
31
+ c14.1801414-15.9326324,25.7396431-30.2172928,36.0214996-43.985733
32
+ c1.443779,20.1794739,11.3667984,44.8493042,39.1089249,44.8493042c24.8275833,0,49.4392776-17.9190445,60.665657-58.2908478
33
+ C157.1693878,79.2323685,151.1244202,75.3463135,147.6701355,79.4482651z M119.3882904,46.848568
34
+ c0,12.7376289-12.5217438,18.9985008-23.9640198,18.9985008c-6.1162338,0-10.8146286-1.6060715-14.5303345-3.6929359
35
+ c6.8368607-10.3524857,13.6045761-20.9680901,20.8757477-32.3321495
36
+ C114.5905914,31.9920235,119.3882904,39.118515,119.3882904,46.848568z"/>
37
+ </svg>
@@ -0,0 +1,37 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 28.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
4
+ <!ENTITY ns_extend "http://ns.adobe.com/Extensibility/1.0/">
5
+ <!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
6
+ <!ENTITY ns_graphs "http://ns.adobe.com/Graphs/1.0/">
7
+ <!ENTITY ns_vars "http://ns.adobe.com/Variables/1.0/">
8
+ <!ENTITY ns_imrep "http://ns.adobe.com/ImageReplacement/1.0/">
9
+ <!ENTITY ns_sfw "http://ns.adobe.com/SaveForWeb/1.0/">
10
+ <!ENTITY ns_custom "http://ns.adobe.com/GenericCustomNamespace/1.0/">
11
+ <!ENTITY ns_adobe_xpath "http://ns.adobe.com/XPath/1.0/">
12
+ ]>
13
+ <svg version="1.1" id="Layer_1" xmlns:x="&ns_extend;" xmlns:i="&ns_ai;" xmlns:graph="&ns_graphs;"
14
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 156.0529938 144"
15
+ style="enable-background:new 0 0 156.0529938 144;" xml:space="preserve">
16
+ <style type="text/css">
17
+ .st0{fill:#FF4438;}
18
+ </style>
19
+ <metadata>
20
+ <sfw xmlns="&ns_sfw;">
21
+ <slices></slices>
22
+ <sliceSourceBounds bottomLeftOrigin="true" height="144" width="156.0530246" x="0" y="-144"></sliceSourceBounds>
23
+ </sfw>
24
+ </metadata>
25
+ <path class="st0" d="M147.670166,79.4482727c-10.7946014,13.6012039-22.452774,29.1454315-45.7691193,29.1454315
26
+ c-20.8268356,0-28.5858765-18.3700104-29.1313019-33.2931824c4.5630417,9.6490479,13.4846115,17.4628525,27.4041672,17.1012802
27
+ c26.7706146-0.8635712,45.1214371-25.0434799,45.1214371-47.0644722C145.2953491,18.9985008,125.6491776,0,91.5382309,0
28
+ C67.1424255,0,36.9175415,9.2833586,17.0554714,23.9640179c-0.2158909,15.1124439,8.2038994,34.7586212,11.226387,32.5997009
29
+ c17.21908-12.3804817,30.8731976-20.3501434,44.1166153-24.3462563C52.7944603,54.0785866,5.7588782,104.8391037,0,113.775116
30
+ C0.6476762,121.9790115,10.7946024,144,15.7601204,144c1.5112438,0,2.8065968-0.8635712,4.3178406-2.3748169
31
+ c14.1801453-15.9326324,25.7396469-30.2172928,36.0215034-43.985733
32
+ c1.443779,20.1794739,11.366806,44.8493042,39.1089325,44.8493042c24.8275833,0,49.4392776-17.9190369,60.6656723-58.2908554
33
+ C157.1694183,79.2323837,151.1244354,75.3463287,147.670166,79.4482727z M119.3883057,46.8485756
34
+ c0,12.7376328-12.5217361,18.9985008-23.9640198,18.9985008c-6.1162338,0-10.8146286-1.6060638-14.5303345-3.6929359
35
+ c6.8368607-10.3524857,13.6045761-20.9680939,20.8757477-32.3321533
36
+ C114.5906143,31.9920292,119.3883057,39.1185226,119.3883057,46.8485756z"/>
37
+ </svg>
@@ -272,9 +272,23 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
272
272
  const resultData = await (0, import_operations.handleUpdateOperation)(this, args, embeddings);
273
273
  return [resultData];
274
274
  }
275
+ if (mode === "retrieve-as-tool") {
276
+ const items = this.getInputData(0);
277
+ const resultData = [];
278
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
279
+ const docs = await (0, import_operations.handleRetrieveAsToolExecuteOperation)(
280
+ this,
281
+ args,
282
+ embeddings,
283
+ itemIndex
284
+ );
285
+ resultData.push(...docs);
286
+ }
287
+ return [resultData];
288
+ }
275
289
  throw new import_n8n_workflow.NodeOperationError(
276
290
  this.getNode(),
277
- 'Only the "load", "update" and "insert" operation modes are supported with execute'
291
+ 'Only the "load", "update", "insert", and "retrieve-as-tool" operation modes are supported with execute'
278
292
  );
279
293
  }
280
294
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts"],"sourcesContent":["import type { Embeddings } from '@langchain/core/embeddings';\nimport type { VectorStore } from '@langchain/core/vectorstores';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeTypeDescription,\n\tSupplyData,\n\tISupplyDataFunctions,\n\tINodeType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\n// Import custom types\nimport {\n\thandleLoadOperation,\n\thandleInsertOperation,\n\thandleUpdateOperation,\n\thandleRetrieveOperation,\n\thandleRetrieveAsToolOperation,\n} from './operations';\nimport type { NodeOperationMode, VectorStoreNodeConstructorArgs } from './types';\n// Import utility functions\nimport { transformDescriptionForOperationMode, getOperationModeOptions } from './utils';\n\nconst ragStarterCallout: INodeProperties = {\n\tdisplayName: 'Tip: Get a feel for vector stores in n8n with our',\n\tname: 'ragStarterCallout',\n\ttype: 'callout',\n\ttypeOptions: {\n\t\tcalloutAction: {\n\t\t\tlabel: 'RAG starter template',\n\t\t\ttype: 'openSampleWorkflowTemplate',\n\t\t\ttemplateId: 'rag-starter-template',\n\t\t},\n\t},\n\tdefault: '',\n};\n\n/**\n * Creates a vector store node with the given configuration\n * This factory function produces a complete node class that implements all vector store operations\n */\nexport const createVectorStoreNode = <T extends VectorStore = VectorStore>(\n\targs: VectorStoreNodeConstructorArgs<T>,\n) =>\n\tclass VectorStoreNodeType implements INodeType {\n\t\tdescription: INodeTypeDescription = {\n\t\t\tdisplayName: args.meta.displayName,\n\t\t\tname: args.meta.name,\n\t\t\tdescription: args.meta.description,\n\t\t\ticon: args.meta.icon,\n\t\t\ticonColor: args.meta.iconColor,\n\t\t\tgroup: ['transform'],\n\t\t\t// 1.2 has changes to VectorStoreInMemory node.\n\t\t\t// 1.3 drops `toolName` and uses node name as the tool name.\n\t\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\t\tdefaults: {\n\t\t\t\tname: args.meta.displayName,\n\t\t\t},\n\t\t\tcodex: {\n\t\t\t\tcategories: args.meta.categories ?? ['AI'],\n\t\t\t\tsubcategories: args.meta.subcategories ?? {\n\t\t\t\t\tAI: ['Vector Stores', 'Tools', 'Root Nodes'],\n\t\t\t\t\t'Vector Stores': ['Other Vector Stores'],\n\t\t\t\t\tTools: ['Other Tools'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: args.meta.docsUrl,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\tcredentials: args.meta.credentials,\n\n\t\t\tinputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst useReranker = parameters?.useReranker;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"${NodeConnectionTypes.AiEmbedding}\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {\n\t\t\t\t\tinputs.push({ displayName: \"Reranker\", type: \"${NodeConnectionTypes.AiReranker}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn inputs;\n\t\t\t\t}\n\n\t\t\t\tif (['insert', 'load', 'update'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"})\n\t\t\t\t}\n\n\t\t\t\tif (['insert'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"Document\", type: \"${NodeConnectionTypes.AiDocument}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\t\t\t\treturn inputs\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\toutputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode ?? 'retrieve';\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn [{ displayName: \"Tool\", type: \"${NodeConnectionTypes.AiTool}\"}]\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve') {\n\t\t\t\t\treturn [{ displayName: \"Vector Store\", type: \"${NodeConnectionTypes.AiVectorStore}\"}]\n\t\t\t\t}\n\t\t\t\treturn [{ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"}]\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\tproperties: [\n\t\t\t\tragStarterCallout,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Operation Mode',\n\t\t\t\t\tname: 'mode',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdefault: 'retrieve',\n\t\t\t\t\toptions: getOperationModeOptions(args),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...getConnectionHintNoticeField([NodeConnectionTypes.AiRetriever]),\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\tname: 'toolName',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'Name of the vector store',\n\t\t\t\t\tplaceholder: 'e.g. company_knowledge_base',\n\t\t\t\t\tvalidateType: 'string-alphanumeric',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\tname: 'toolDescription',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\ttypeOptions: { rows: 2 },\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Explain to the LLM what this tool does, a good, specific description would allow LLMs to produce expected results much more often',\n\t\t\t\t\tplaceholder: `e.g. ${args.meta.description}`,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...args.sharedFields,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Embedding Batch Size',\n\t\t\t\t\tname: 'embeddingBatchSize',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 200,\n\t\t\t\t\tdescription: 'Number of documents to embed in a single batch',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['insert'],\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.insertFields ?? [], 'insert'),\n\t\t\t\t// Prompt and topK are always used for the load operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\tname: 'prompt',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Search prompt to retrieve matching documents from the vector store using similarity-based ranking',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Limit',\n\t\t\t\t\tname: 'topK',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 4,\n\t\t\t\t\tdescription: 'Number of top results to fetch from vector store',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Include Metadata',\n\t\t\t\t\tname: 'includeDocumentMetadata',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: 'Whether or not to include document metadata',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Rerank Results',\n\t\t\t\t\tname: 'useReranker',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether or not to rerank results',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// ID is always used for update operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'ID',\n\t\t\t\t\tname: 'id',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'ID of an embedding entry',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['update'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.loadFields ?? [], [\n\t\t\t\t\t'load',\n\t\t\t\t\t'retrieve-as-tool',\n\t\t\t\t]),\n\t\t\t\t...transformDescriptionForOperationMode(args.retrieveFields ?? [], 'retrieve'),\n\t\t\t\t...transformDescriptionForOperationMode(args.updateFields ?? [], 'update'),\n\t\t\t],\n\t\t};\n\n\t\tmethods = args.methods;\n\n\t\t/**\n\t\t * Method to execute the node in regular workflow mode\n\t\t * Supports 'load', 'insert', and 'update' operation modes\n\t\t */\n\t\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each operation mode with dedicated modules\n\t\t\tif (mode === 'load') {\n\t\t\t\tconst items = this.getInputData(0);\n\t\t\t\tconst resultData = [];\n\n\t\t\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\t\t\tconst docs = await handleLoadOperation(this, args, embeddings, itemIndex);\n\t\t\t\t\tresultData.push(...docs);\n\t\t\t\t}\n\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'insert') {\n\t\t\t\tconst resultData = await handleInsertOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'update') {\n\t\t\t\tconst resultData = await handleUpdateOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"load\", \"update\" and \"insert\" operation modes are supported with execute',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Method to supply data to AI nodes\n\t\t * Supports 'retrieve' and 'retrieve-as-tool' operation modes\n\t\t */\n\t\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each supply data operation mode with dedicated modules\n\t\t\tif (mode === 'retrieve') {\n\t\t\t\treturn await handleRetrieveOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\treturn await handleRetrieveAsToolOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"retrieve\" and \"retrieve-as-tool\" operation mode is supported to supply data',\n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AK,iBAAiB,QAAQ,CAAC;AAG5C,UAAM,aAAc,MAAM,KAAK;AAAA,MAC9B,wCAAoB;AAAA,MACpB;AAAA,IACD;AAGA,QAAI,SAAS,YAAY;AACxB,aAAO,UAAM,2CAAwB,MAAM,MAAM,YAAY,SAAS;AAAA,IACvE;AAEA,QAAI,SAAS,oBAAoB;AAChC,aAAO,UAAM,iDAA8B,MAAM,MAAM,YAAY,SAAS;AAAA,IAC7E;AAEA,UAAM,IAAI;AAAA,MACT,KAAK,QAAQ;AAAA,MACb;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts"],"sourcesContent":["import type { Embeddings } from '@langchain/core/embeddings';\nimport type { VectorStore } from '@langchain/core/vectorstores';\nimport { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';\nimport type {\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tINodeTypeDescription,\n\tSupplyData,\n\tISupplyDataFunctions,\n\tINodeType,\n\tINodeProperties,\n} from 'n8n-workflow';\n\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\n// Import custom types\nimport {\n\thandleLoadOperation,\n\thandleInsertOperation,\n\thandleUpdateOperation,\n\thandleRetrieveOperation,\n\thandleRetrieveAsToolOperation,\n\thandleRetrieveAsToolExecuteOperation,\n} from './operations';\nimport type { NodeOperationMode, VectorStoreNodeConstructorArgs } from './types';\n// Import utility functions\nimport { transformDescriptionForOperationMode, getOperationModeOptions } from './utils';\n\nconst ragStarterCallout: INodeProperties = {\n\tdisplayName: 'Tip: Get a feel for vector stores in n8n with our',\n\tname: 'ragStarterCallout',\n\ttype: 'callout',\n\ttypeOptions: {\n\t\tcalloutAction: {\n\t\t\tlabel: 'RAG starter template',\n\t\t\ttype: 'openSampleWorkflowTemplate',\n\t\t\ttemplateId: 'rag-starter-template',\n\t\t},\n\t},\n\tdefault: '',\n};\n\n/**\n * Creates a vector store node with the given configuration\n * This factory function produces a complete node class that implements all vector store operations\n */\nexport const createVectorStoreNode = <T extends VectorStore = VectorStore>(\n\targs: VectorStoreNodeConstructorArgs<T>,\n) =>\n\tclass VectorStoreNodeType implements INodeType {\n\t\tdescription: INodeTypeDescription = {\n\t\t\tdisplayName: args.meta.displayName,\n\t\t\tname: args.meta.name,\n\t\t\tdescription: args.meta.description,\n\t\t\ticon: args.meta.icon,\n\t\t\ticonColor: args.meta.iconColor,\n\t\t\tgroup: ['transform'],\n\t\t\t// 1.2 has changes to VectorStoreInMemory node.\n\t\t\t// 1.3 drops `toolName` and uses node name as the tool name.\n\t\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\t\tdefaults: {\n\t\t\t\tname: args.meta.displayName,\n\t\t\t},\n\t\t\tcodex: {\n\t\t\t\tcategories: args.meta.categories ?? ['AI'],\n\t\t\t\tsubcategories: args.meta.subcategories ?? {\n\t\t\t\t\tAI: ['Vector Stores', 'Tools', 'Root Nodes'],\n\t\t\t\t\t'Vector Stores': ['Other Vector Stores'],\n\t\t\t\t\tTools: ['Other Tools'],\n\t\t\t\t},\n\t\t\t\tresources: {\n\t\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\turl: args.meta.docsUrl,\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t\tcredentials: args.meta.credentials,\n\n\t\t\tinputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode;\n\t\t\t\tconst useReranker = parameters?.useReranker;\n\t\t\t\tconst inputs = [{ displayName: \"Embedding\", type: \"${NodeConnectionTypes.AiEmbedding}\", required: true, maxConnections: 1}]\n\n\t\t\t\tif (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {\n\t\t\t\t\tinputs.push({ displayName: \"Reranker\", type: \"${NodeConnectionTypes.AiReranker}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn inputs;\n\t\t\t\t}\n\n\t\t\t\tif (['insert', 'load', 'update'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"})\n\t\t\t\t}\n\n\t\t\t\tif (['insert'].includes(mode)) {\n\t\t\t\t\tinputs.push({ displayName: \"Document\", type: \"${NodeConnectionTypes.AiDocument}\", required: true, maxConnections: 1})\n\t\t\t\t}\n\t\t\t\treturn inputs\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\toutputs: `={{\n\t\t\t((parameters) => {\n\t\t\t\tconst mode = parameters?.mode ?? 'retrieve';\n\n\t\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\t\treturn [{ displayName: \"Tool\", type: \"${NodeConnectionTypes.AiTool}\"}]\n\t\t\t\t}\n\n\t\t\t\tif (mode === 'retrieve') {\n\t\t\t\t\treturn [{ displayName: \"Vector Store\", type: \"${NodeConnectionTypes.AiVectorStore}\"}]\n\t\t\t\t}\n\t\t\t\treturn [{ displayName: \"\", type: \"${NodeConnectionTypes.Main}\"}]\n\t\t\t})($parameter)\n\t\t}}`,\n\t\t\tproperties: [\n\t\t\t\tragStarterCallout,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Operation Mode',\n\t\t\t\t\tname: 'mode',\n\t\t\t\t\ttype: 'options',\n\t\t\t\t\tnoDataExpression: true,\n\t\t\t\t\tdefault: 'retrieve',\n\t\t\t\t\toptions: getOperationModeOptions(args),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t...getConnectionHintNoticeField([NodeConnectionTypes.AiRetriever]),\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Name',\n\t\t\t\t\tname: 'toolName',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'Name of the vector store',\n\t\t\t\t\tplaceholder: 'e.g. company_knowledge_base',\n\t\t\t\t\tvalidateType: 'string-alphanumeric',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\t'@version': [{ _cnd: { lte: 1.2 } }],\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Description',\n\t\t\t\t\tname: 'toolDescription',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\ttypeOptions: { rows: 2 },\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Explain to the LLM what this tool does, a good, specific description would allow LLMs to produce expected results much more often',\n\t\t\t\t\tplaceholder: `e.g. ${args.meta.description}`,\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...args.sharedFields,\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Embedding Batch Size',\n\t\t\t\t\tname: 'embeddingBatchSize',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 200,\n\t\t\t\t\tdescription: 'Number of documents to embed in a single batch',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['insert'],\n\t\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.1 } }],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.insertFields ?? [], 'insert'),\n\t\t\t\t// Prompt and topK are always used for the load operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\tname: 'prompt',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t'Search prompt to retrieve matching documents from the vector store using similarity-based ranking',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Limit',\n\t\t\t\t\tname: 'topK',\n\t\t\t\t\ttype: 'number',\n\t\t\t\t\tdefault: 4,\n\t\t\t\t\tdescription: 'Number of top results to fetch from vector store',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Include Metadata',\n\t\t\t\t\tname: 'includeDocumentMetadata',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: true,\n\t\t\t\t\tdescription: 'Whether or not to include document metadata',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'Rerank Results',\n\t\t\t\t\tname: 'useReranker',\n\t\t\t\t\ttype: 'boolean',\n\t\t\t\t\tdefault: false,\n\t\t\t\t\tdescription: 'Whether or not to rerank results',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['load', 'retrieve', 'retrieve-as-tool'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t// ID is always used for update operation\n\t\t\t\t{\n\t\t\t\t\tdisplayName: 'ID',\n\t\t\t\t\tname: 'id',\n\t\t\t\t\ttype: 'string',\n\t\t\t\t\tdefault: '',\n\t\t\t\t\trequired: true,\n\t\t\t\t\tdescription: 'ID of an embedding entry',\n\t\t\t\t\tdisplayOptions: {\n\t\t\t\t\t\tshow: {\n\t\t\t\t\t\t\tmode: ['update'],\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...transformDescriptionForOperationMode(args.loadFields ?? [], [\n\t\t\t\t\t'load',\n\t\t\t\t\t'retrieve-as-tool',\n\t\t\t\t]),\n\t\t\t\t...transformDescriptionForOperationMode(args.retrieveFields ?? [], 'retrieve'),\n\t\t\t\t...transformDescriptionForOperationMode(args.updateFields ?? [], 'update'),\n\t\t\t],\n\t\t};\n\n\t\tmethods = args.methods;\n\n\t\t/**\n\t\t * Method to execute the node in regular workflow mode\n\t\t * Supports 'load', 'insert', and 'update' operation modes\n\t\t */\n\t\tasync execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each operation mode with dedicated modules\n\t\t\tif (mode === 'load') {\n\t\t\t\tconst items = this.getInputData(0);\n\t\t\t\tconst resultData = [];\n\n\t\t\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\t\t\tconst docs = await handleLoadOperation(this, args, embeddings, itemIndex);\n\t\t\t\t\tresultData.push(...docs);\n\t\t\t\t}\n\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'insert') {\n\t\t\t\tconst resultData = await handleInsertOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'update') {\n\t\t\t\tconst resultData = await handleUpdateOperation(this, args, embeddings);\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\tconst items = this.getInputData(0);\n\t\t\t\tconst resultData = [];\n\n\t\t\t\tfor (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n\t\t\t\t\tconst docs = await handleRetrieveAsToolExecuteOperation(\n\t\t\t\t\t\tthis,\n\t\t\t\t\t\targs,\n\t\t\t\t\t\tembeddings,\n\t\t\t\t\t\titemIndex,\n\t\t\t\t\t);\n\t\t\t\t\tresultData.push(...docs);\n\t\t\t\t}\n\n\t\t\t\treturn [resultData];\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"load\", \"update\", \"insert\", and \"retrieve-as-tool\" operation modes are supported with execute',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Method to supply data to AI nodes\n\t\t * Supports 'retrieve' and 'retrieve-as-tool' operation modes\n\t\t */\n\t\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\t\tconst mode = this.getNodeParameter('mode', 0) as NodeOperationMode;\n\n\t\t\t// Get the embeddings model connected to this node\n\t\t\tconst embeddings = (await this.getInputConnectionData(\n\t\t\t\tNodeConnectionTypes.AiEmbedding,\n\t\t\t\t0,\n\t\t\t)) as Embeddings;\n\n\t\t\t// Handle each supply data operation mode with dedicated modules\n\t\t\tif (mode === 'retrieve') {\n\t\t\t\treturn await handleRetrieveOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tif (mode === 'retrieve-as-tool') {\n\t\t\t\treturn await handleRetrieveAsToolOperation(this, args, embeddings, itemIndex);\n\t\t\t}\n\n\t\t\tthrow new NodeOperationError(\n\t\t\t\tthis.getNode(),\n\t\t\t\t'Only the \"retrieve\" and \"retrieve-as-tool\" operation mode is supported to supply data',\n\t\t\t);\n\t\t}\n\t};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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