@n8n/n8n-nodes-langchain 0.1.0 → 0.2.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 (49) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/known/nodes.json +7 -3
  3. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js +4 -1
  4. package/dist/nodes/chains/ChainLLM/ChainLlm.node.js.map +1 -1
  5. package/dist/nodes/code/Code.node.js +2 -2
  6. package/dist/nodes/code/Code.node.js.map +1 -1
  7. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +12 -1
  8. package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
  9. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js +44 -18
  10. package/dist/nodes/llms/LMChatOllama/LmChatOllama.node.js.map +1 -1
  11. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js +14 -2
  12. package/dist/nodes/llms/LMChatOpenAi/LmChatOpenAi.node.js.map +1 -1
  13. package/dist/nodes/llms/LMOllama/LmOllama.node.js +44 -18
  14. package/dist/nodes/llms/LMOllama/LmOllama.node.js.map +1 -1
  15. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js +14 -2
  16. package/dist/nodes/llms/LMOpenAi/LmOpenAi.node.js.map +1 -1
  17. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +5 -5
  18. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
  19. package/dist/nodes/tools/ToolGoogleCalendar/ToolGoogleCalendar.node.d.ts +0 -0
  20. package/dist/nodes/tools/ToolGoogleCalendar/ToolGoogleCalendar.node.js +2 -0
  21. package/dist/nodes/tools/ToolGoogleCalendar/ToolGoogleCalendar.node.js.map +1 -0
  22. package/dist/nodes/tools/ToolGoogleCalendar/googleCalendar.svg +1 -0
  23. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.d.ts +5 -0
  24. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js +85 -0
  25. package/dist/nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.js.map +1 -0
  26. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.d.ts +5 -0
  27. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js +64 -0
  28. package/dist/nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.js.map +1 -0
  29. package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js +2 -12
  30. package/dist/nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.js.map +1 -1
  31. package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js +2 -12
  32. package/dist/nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.js.map +1 -1
  33. package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js +3 -12
  34. package/dist/nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.js.map +1 -1
  35. package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js +1 -0
  36. package/dist/nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.js.map +1 -1
  37. package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.d.ts +12 -0
  38. package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.js +34 -0
  39. package/dist/nodes/vector_store/shared/MemoryVectorStoreManager.js.map +1 -0
  40. package/dist/nodes/vector_store/shared/processDocuments.d.ts +12 -0
  41. package/dist/nodes/vector_store/shared/processDocuments.js +23 -0
  42. package/dist/nodes/vector_store/shared/processDocuments.js.map +1 -0
  43. package/dist/types/nodes.json +8 -7
  44. package/dist/utils/logWrapper.d.ts +1 -2
  45. package/dist/utils/logWrapper.js.map +1 -1
  46. package/package.json +5 -4
  47. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.d.ts +0 -5
  48. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js +0 -66
  49. package/dist/nodes/vector_store/VectorStoreInMemory/VectorStoreInMemory.node.js.map +0 -1
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VectorStoreInMemoryInsert = void 0;
4
+ const processDocuments_1 = require("../shared/processDocuments");
5
+ const MemoryVectorStoreManager_1 = require("../shared/MemoryVectorStoreManager");
6
+ class VectorStoreInMemoryInsert {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'In Memory Vector Store Insert',
10
+ name: 'vectorStoreInMemoryInsert',
11
+ icon: 'fa:database',
12
+ group: ['transform'],
13
+ version: 1,
14
+ description: 'Insert data into an in-memory vector store',
15
+ defaults: {
16
+ name: 'In Memory Vector Store Insert',
17
+ },
18
+ codex: {
19
+ categories: ['AI'],
20
+ subcategories: {
21
+ AI: ['Vector Stores'],
22
+ },
23
+ resources: {
24
+ primaryDocumentation: [
25
+ {
26
+ url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.vectorstoreinmemory/',
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ inputs: [
32
+ "main",
33
+ {
34
+ displayName: 'Document',
35
+ maxConnections: 1,
36
+ type: "ai_document",
37
+ required: true,
38
+ },
39
+ {
40
+ displayName: 'Embedding',
41
+ maxConnections: 1,
42
+ type: "ai_embedding",
43
+ required: true,
44
+ },
45
+ ],
46
+ outputs: ["main"],
47
+ properties: [
48
+ {
49
+ displayName: 'The embbded data are stored in the server memory, so they will be lost when the server is restarted. Additionally, if the amount of data is too large, it may cause the server to crash due to insufficient memory.',
50
+ name: 'notice',
51
+ type: 'notice',
52
+ default: '',
53
+ },
54
+ {
55
+ displayName: 'Memory Key',
56
+ name: 'memoryKey',
57
+ type: 'string',
58
+ default: 'vector_store_key',
59
+ description: 'The key to use to store the vector memory in the workflow data. The key will be prefixed with the workflow ID to avoid collisions.',
60
+ },
61
+ {
62
+ displayName: 'Clear Store',
63
+ name: 'clearStore',
64
+ type: 'boolean',
65
+ default: false,
66
+ description: 'Whether to clear the store before inserting new data',
67
+ },
68
+ ],
69
+ };
70
+ }
71
+ async execute() {
72
+ const items = this.getInputData(0);
73
+ const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
74
+ const memoryKey = this.getNodeParameter('memoryKey', 0);
75
+ const clearStore = this.getNodeParameter('clearStore', 0);
76
+ const documentInput = (await this.getInputConnectionData("ai_document", 0));
77
+ const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocuments)(documentInput, items);
78
+ const workflowId = this.getWorkflow().id;
79
+ const vectorStoreInstance = MemoryVectorStoreManager_1.MemoryVectorStoreManager.getInstance(embeddings);
80
+ await vectorStoreInstance.addDocuments(`${workflowId}__${memoryKey}`, processedDocuments, clearStore);
81
+ return this.prepareOutputData(serializedDocuments);
82
+ }
83
+ }
84
+ exports.VectorStoreInMemoryInsert = VectorStoreInMemoryInsert;
85
+ //# sourceMappingURL=VectorStoreInMemoryInsert.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VectorStoreInMemoryInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreInMemoryInsert/VectorStoreInMemoryInsert.node.ts"],"names":[],"mappings":";;;AAWA,iEAA8D;AAC9D,iFAA8E;AAE9E,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,+BAA+B;aACrC;YACD,KAA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AE,CAAC,CAAY,CAAC;QACrE,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,gBAAgC,CAAC,CAAC,CAE/C,CAAC;QAE5C,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,MAAM,IAAA,mCAAgB,EACzE,aAAa,EACb,KAAK,CACL,CAAC;QAEF,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;QAEzC,MAAM,mBAAmB,GAAG,mDAAwB,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,mBAAmB,CAAC,YAAY,CACrC,GAAG,UAAU,KAAK,SAAS,EAAE,EAC7B,kBAAkB,EAClB,UAAU,CACV,CAAC;QAEF,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AAhGD,8DAgGC"}
@@ -0,0 +1,5 @@
1
+ import { type SupplyData, type IExecuteFunctions, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class VectorStoreInMemoryLoad implements INodeType {
3
+ description: INodeTypeDescription;
4
+ supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData>;
5
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VectorStoreInMemoryLoad = void 0;
4
+ const MemoryVectorStoreManager_1 = require("../shared/MemoryVectorStoreManager");
5
+ const logWrapper_1 = require("../../../utils/logWrapper");
6
+ class VectorStoreInMemoryLoad {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'In Memory Vector Store Load',
10
+ name: 'vectorStoreInMemoryLoad',
11
+ icon: 'fa:database',
12
+ group: ['transform'],
13
+ version: 1,
14
+ description: 'Load embedded data from an in-memory vector store',
15
+ defaults: {
16
+ name: 'In Memory Vector Store Load',
17
+ },
18
+ codex: {
19
+ categories: ['AI'],
20
+ subcategories: {
21
+ AI: ['Vector Stores'],
22
+ },
23
+ resources: {
24
+ primaryDocumentation: [
25
+ {
26
+ url: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.vectorstoreinmemory/',
27
+ },
28
+ ],
29
+ },
30
+ },
31
+ inputs: [
32
+ {
33
+ displayName: 'Embedding',
34
+ maxConnections: 1,
35
+ type: "ai_embedding",
36
+ required: true,
37
+ },
38
+ ],
39
+ outputs: ["ai_vectorStore"],
40
+ outputNames: ['Vector Store'],
41
+ properties: [
42
+ {
43
+ displayName: 'Memory Key',
44
+ name: 'memoryKey',
45
+ type: 'string',
46
+ default: 'vector_store_key',
47
+ description: 'The key to use to store the vector memory in the workflow data. The key will be prefixed with the workflow ID to avoid collisions.',
48
+ },
49
+ ],
50
+ };
51
+ }
52
+ async supplyData(itemIndex) {
53
+ const embeddings = (await this.getInputConnectionData("ai_embedding", itemIndex));
54
+ const workflowId = this.getWorkflow().id;
55
+ const memoryKey = this.getNodeParameter('memoryKey', 0);
56
+ const vectorStoreSingleton = MemoryVectorStoreManager_1.MemoryVectorStoreManager.getInstance(embeddings);
57
+ const vectorStoreInstance = await vectorStoreSingleton.getVectorStore(`${workflowId}__${memoryKey}`);
58
+ return {
59
+ response: (0, logWrapper_1.logWrapper)(vectorStoreInstance, this),
60
+ };
61
+ }
62
+ }
63
+ exports.VectorStoreInMemoryLoad = VectorStoreInMemoryLoad;
64
+ //# sourceMappingURL=VectorStoreInMemoryLoad.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VectorStoreInMemoryLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreInMemoryLoad/VectorStoreInMemoryLoad.node.ts"],"names":[],"mappings":";;;AASA,iFAA8E;AAC9E,0DAAuD;AAEvD,MAAa,uBAAuB;IAApC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,yBAAyB;YAC/B,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,CAAC,WAAW,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AC/C,CAAC;IACH,CAAC;CACD;AAjED,0DAiEC"}
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VectorStorePineconeInsert = void 0;
4
4
  const pinecone_1 = require("langchain/vectorstores/pinecone");
5
5
  const pinecone_2 = require("@pinecone-database/pinecone");
6
- const N8nJsonLoader_1 = require("../../../utils/N8nJsonLoader");
7
- const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
6
+ const processDocuments_1 = require("../shared/processDocuments");
8
7
  class VectorStorePineconeInsert {
9
8
  constructor() {
10
9
  this.description = {
@@ -101,20 +100,11 @@ class VectorStorePineconeInsert {
101
100
  if (namespace && clearNamespace) {
102
101
  await pineconeIndex.delete1({ deleteAll: true, namespace });
103
102
  }
104
- let processedDocuments;
105
- if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
106
- processedDocuments = await documentInput.process(items);
107
- }
108
- else {
109
- processedDocuments = documentInput;
110
- }
103
+ const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocuments)(documentInput, items);
111
104
  await pinecone_1.PineconeStore.fromDocuments(processedDocuments, embeddings, {
112
105
  namespace: namespace || undefined,
113
106
  pineconeIndex,
114
107
  });
115
- const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
116
- json: { metadata, pageContent },
117
- }));
118
108
  return this.prepareOutputData(serializedDocuments);
119
109
  }
120
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VectorStorePineconeInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts"],"names":[],"mappings":";;;AAOA,8DAAgE;AAChE,0DAA6D;AAG7D,gEAA6D;AAC7D,oEAAiE;AAEjE,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,mB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AAO,CAAC,KAAK,CAAC,CAAC;SACxD;aAAM;YACN,kBAAkB,GAAG,aAAa,CAAC;SACnC;QAED,MAAM,wBAAa,CAAC,aAAa,CAAC,kBAAkB,EAAE,UAAU,EAAE;YACjE,SAAS,EAAE,SAAS,IAAI,SAAS;YACjC,aAAa;SACb,CAAC,CAAC;QAEH,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;YAClF,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE;SAC/B,CAAC,CAAC,CAAC;QAEJ,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AAhID,8DAgIC"}
1
+ {"version":3,"file":"VectorStorePineconeInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStorePineconeInsert/VectorStorePineconeInsert.node.ts"],"names":[],"mappings":";;;AAOA,8DAAgE;AAChE,0DAA6D;AAI7D,iEAA8D;AAE9D,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,8CAA8C;YAC3D,QAAQ,EAAE;gBACT,IAAI,EAAE,kBAAkB;gBAExB,KAAK,EAAE,SAAS;aAChB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,iHAAiH;yBACtH;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,aAAa;oBACnB,QAAQ,EAAE,IAA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C,CAAY,CAAC;QAE7E,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAE7D,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,gBAAgC,CAAC,CAAC,CAE/C,CAAC;QAE5C,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,iBAEpD,CAAC,CACD,CAAe,CAAC;QAEjB,MAAM,MAAM,GAAG,IAAI,yBAAc,EAAE,CAAC;QACpC,MAAM,MAAM,CAAC,IAAI,CAAC;YACjB,MAAM,EAAE,WAAW,CAAC,MAAgB;YACpC,WAAW,EAAE,WAAW,CAAC,WAAqB;SAC9C,CAAC,CAAC;QAEH,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE1C,IAAI,SAAS,IAAI,cAAc,EAAE;YAChC,MAAM,aAAa,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;SAC5D;QAED,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,MAAM,IAAA,mCAAgB,EACzE,aAAa,EACb,KAAK,CACL,CAAC;QAEF,MAAM,wBAAa,CAAC,aAAa,CAAC,kBAAkB,EAAE,UAAU,EAAE;YACjE,SAAS,EAAE,SAAS,IAAI,SAAS;YACjC,aAAa;SACb,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AAzHD,8DAyHC"}
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VectorStoreSupabaseInsert = void 0;
4
4
  const supabase_js_1 = require("@supabase/supabase-js");
5
5
  const supabase_1 = require("langchain/vectorstores/supabase");
6
- const N8nJsonLoader_1 = require("../../../utils/N8nJsonLoader");
7
- const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
6
+ const processDocuments_1 = require("../shared/processDocuments");
8
7
  class VectorStoreSupabaseInsert {
9
8
  constructor() {
10
9
  this.description = {
@@ -93,21 +92,12 @@ class VectorStoreSupabaseInsert {
93
92
  const documentInput = (await this.getInputConnectionData("ai_document", 0));
94
93
  const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
95
94
  const client = (0, supabase_js_1.createClient)(credentials.host, credentials.serviceRole);
96
- let processedDocuments;
97
- if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
98
- processedDocuments = await documentInput.process(items);
99
- }
100
- else {
101
- processedDocuments = documentInput;
102
- }
95
+ const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocuments)(documentInput, items);
103
96
  await supabase_1.SupabaseVectorStore.fromDocuments(processedDocuments, embeddings, {
104
97
  client,
105
98
  tableName,
106
99
  queryName,
107
100
  });
108
- const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
109
- json: { metadata, pageContent },
110
- }));
111
101
  return this.prepareOutputData(serializedDocuments);
112
102
  }
113
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VectorStoreSupabaseInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreSupabaseInsert/VectorStoreSupabaseInsert.node.ts"],"names":[],"mappings":";;;AASA,uDAAqD;AACrD,8DAAsE;AAEtE,gEAA6D;AAC7D,oEAAiE;AAEjE,MAAa,yBAAyB;IAAtC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,2BAA2B;YACjC,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EACV,8FAA8F;YAC/F,QAAQ,EAAE;gBACT,IAAI,EAAE,kBAAkB;aACxB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EA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AC;IACpD,CAAC;CACD;AA/GD,8DA+GC"}
@@ -2,8 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VectorStoreZepInsert = void 0;
4
4
  const zep_1 = require("langchain/vectorstores/zep");
5
- const N8nJsonLoader_1 = require("../../../utils/N8nJsonLoader");
6
- const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
5
+ const processDocuments_1 = require("../shared/processDocuments");
7
6
  class VectorStoreZepInsert {
8
7
  constructor() {
9
8
  this.description = {
@@ -100,23 +99,15 @@ class VectorStoreZepInsert {
100
99
  const credentials = (await this.getCredentials('zepApi'));
101
100
  const documentInput = (await this.getInputConnectionData("ai_document", 0));
102
101
  const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
103
- let processedDocuments;
104
- if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
105
- processedDocuments = await documentInput.process(items);
106
- }
107
- else {
108
- processedDocuments = documentInput;
109
- }
102
+ const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocuments)(documentInput, items);
110
103
  const zepConfig = {
111
104
  apiUrl: credentials.apiUrl,
105
+ apiKey: credentials.apiKey,
112
106
  collectionName,
113
107
  embeddingDimensions: (_a = options.embeddingDimensions) !== null && _a !== void 0 ? _a : 1536,
114
108
  isAutoEmbedded: (_b = options.isAutoEmbedded) !== null && _b !== void 0 ? _b : true,
115
109
  };
116
110
  await zep_1.ZepVectorStore.fromDocuments(processedDocuments, embeddings, zepConfig);
117
- const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
118
- json: { metadata, pageContent },
119
- }));
120
111
  return this.prepareOutputData(serializedDocuments);
121
112
  }
122
113
  }
@@ -1 +1 @@
1
- {"version":3,"file":"VectorStoreZepInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts"],"names":[],"mappings":";;;AAOA,oDAA4D;AAG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AAC,MAAM;YAC1B,cAAc;YACd,mBAAmB,EAAE,MAAA,OAAO,CAAC,mBAAmB,mCAAI,IAAI;YACxD,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI;SAC9C,CAAC;QAEF,MAAM,oBAAc,CAAC,aAAa,CAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAE9E,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;YAClF,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE;SAC/B,CAAC,CAAC,CAAC;QAEJ,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AAxID,oDAwIC"}
1
+ {"version":3,"file":"VectorStoreZepInsert.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepInsert/VectorStoreZepInsert.node.ts"],"names":[],"mappings":";;;AAOA,oDAA4D;AAI5D,iEAA8D;AAE9D,MAAa,oBAAoB;IAAjC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,sBAAsB;YAE5B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE;gBACT,IAAI,EAAE,aAAa;aACnB;YACD,KAAK,EAAE;gBACN,UAAU,EAAE,CAAC,IAAI,CAAC;gBAClB,aAAa,EAAE;oBACd,EAAE,EAAE,CAAC,eAAe,CAAC;iBACrB;gBACD,SAAS,EAAE;oBACV,oBAAoB,EAAE;wBACrB;4BACC,GAAG,EAAE,4GAA4G;yBACjH;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,MA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AE,CAAC,CAAW,CAAC;QAE5E,MAAM,OAAO,GACX,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAGjC,IAAI,EAAE,CAAC;QAEV,MAAM,WAAW,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAGvD,CAAC;QAEF,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,gBAAgC,CAAC,CAAC,CAE/C,CAAC;QAE5C,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,iBAEpD,CAAC,CACD,CAAe,CAAC;QAEjB,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,MAAM,IAAA,mCAAgB,EACzE,aAAa,EACb,KAAK,CACL,CAAC;QAEF,MAAM,SAAS,GAAG;YACjB,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,cAAc;YACd,mBAAmB,EAAE,MAAA,OAAO,CAAC,mBAAmB,mCAAI,IAAI;YACxD,cAAc,EAAE,MAAA,OAAO,CAAC,cAAc,mCAAI,IAAI;SAC9C,CAAC;QAEF,MAAM,oBAAc,CAAC,aAAa,CAAC,kBAAkB,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAE9E,OAAO,IAAI,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC;IACpD,CAAC;CACD;AAlID,oDAkIC"}
@@ -80,6 +80,7 @@ class VectorStoreZepLoad {
80
80
  const embeddings = (await this.getInputConnectionData("ai_embedding", 0));
81
81
  const zepConfig = {
82
82
  apiUrl: credentials.apiUrl,
83
+ apiKey: credentials.apiKey,
83
84
  collectionName,
84
85
  embeddingDimensions: (_a = options.embeddingDimensions) !== null && _a !== void 0 ? _a : 1536,
85
86
  };
@@ -1 +1 @@
1
- {"version":3,"file":"VectorStoreZepLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepLoad/VectorSto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AAI;4BACb,WAAW,EAAE,qEAAqE;yBAClF;qBACD;iBACD;aACD;SACD,CAAC;IAiCH,CAAC;IA/BA,KAAK,CAAC,UAAU,CAA0B,SAAiB;;QAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;QAEhE,MAAM,cAAc,GAAG,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,SAAS,CAAW,CAAC;QAEpF,MAAM,OAAO,GACX,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAEzC,IAAI,EAAE,CAAC;QAEV,MAAM,WAAW,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAGvD,CAAC;QACF,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,iBAEpD,CAAC,CACD,CAAe,CAAC;QAEjB,MAAM,SAAS,GAAG;YACjB,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,cAAc;YACd,mBAAmB,EAAE,MAAA,OAAO,CAAC,mBAAmB,mCAAI,IAAI;SACxD,CAAC;QAEF,MAAM,WAAW,GAAG,IAAI,oBAAc,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAE9D,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,WAAW,EAAE,IAAI,CAAC;SACvC,CAAC;IACH,CAAC;CACD;AAnGD,gDAmGC"}
1
+ {"version":3,"file":"VectorStoreZepLoad.node.js","sourceRoot":"","sources":["../../../../nodes/vector_store/VectorStoreZepLoad/VectorStoreZepLoad.node.ts"],"names":[],"mappings":";;;AAOA,oDAA4D;AAE5D,0DAAuD;AAEvD,MAAa,kBAAkB;IAA/B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,oBAAoB;YAE1B,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,uCAA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AEpF,MAAM,OAAO,GACX,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAEzC,IAAI,EAAE,CAAC;QAEV,MAAM,WAAW,GAAG,CAAC,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAGvD,CAAC;QACF,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,iBAEpD,CAAC,CACD,CAAe,CAAC;QAEjB,MAAM,SAAS,GAAG;YACjB,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,cAAc;YACd,mBAAmB,EAAE,MAAA,OAAO,CAAC,mBAAmB,mCAAI,IAAI;SACxD,CAAC;QAEF,MAAM,WAAW,GAAG,IAAI,oBAAc,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;QAE9D,OAAO;YACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,WAAW,EAAE,IAAI,CAAC;SACvC,CAAC;IACH,CAAC;CACD;AApGD,gDAoGC"}
@@ -0,0 +1,12 @@
1
+ import type { Document } from 'langchain/document';
2
+ import type { Embeddings } from 'langchain/embeddings/base';
3
+ import { MemoryVectorStore } from 'langchain/vectorstores/memory';
4
+ export declare class MemoryVectorStoreManager {
5
+ private static instance;
6
+ private vectorStoreBuffer;
7
+ private embeddings;
8
+ private constructor();
9
+ static getInstance(embeddings: Embeddings): MemoryVectorStoreManager;
10
+ getVectorStore(memoryKey: string): Promise<MemoryVectorStore>;
11
+ addDocuments(memoryKey: string, documents: Document[], clearStore?: boolean): Promise<void>;
12
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MemoryVectorStoreManager = void 0;
4
+ const memory_1 = require("langchain/vectorstores/memory");
5
+ class MemoryVectorStoreManager {
6
+ constructor(embeddings) {
7
+ this.vectorStoreBuffer = new Map();
8
+ this.embeddings = embeddings;
9
+ }
10
+ static getInstance(embeddings) {
11
+ if (!MemoryVectorStoreManager.instance) {
12
+ MemoryVectorStoreManager.instance = new MemoryVectorStoreManager(embeddings);
13
+ }
14
+ return MemoryVectorStoreManager.instance;
15
+ }
16
+ async getVectorStore(memoryKey) {
17
+ let vectorStoreInstance = this.vectorStoreBuffer.get(memoryKey);
18
+ if (!vectorStoreInstance) {
19
+ vectorStoreInstance = await memory_1.MemoryVectorStore.fromExistingIndex(this.embeddings);
20
+ this.vectorStoreBuffer.set(memoryKey, vectorStoreInstance);
21
+ }
22
+ return vectorStoreInstance;
23
+ }
24
+ async addDocuments(memoryKey, documents, clearStore) {
25
+ if (clearStore) {
26
+ this.vectorStoreBuffer.delete(memoryKey);
27
+ }
28
+ const vectorStoreInstance = await this.getVectorStore(memoryKey);
29
+ await vectorStoreInstance.addDocuments(documents);
30
+ }
31
+ }
32
+ exports.MemoryVectorStoreManager = MemoryVectorStoreManager;
33
+ MemoryVectorStoreManager.instance = null;
34
+ //# sourceMappingURL=MemoryVectorStoreManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MemoryVectorStoreManager.js","sourceRoot":"","sources":["../../../../nodes/vector_store/shared/MemoryVectorStoreManager.ts"],"names":[],"mappings":";;;AAEA,0DAAkE;AAElE,MAAa,wBAAwB;IAOpC,YAAoB,UAAsB;QACzC,IAAI,CAAC,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC9B,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,UAAsB;QAC/C,IAAI,CAAC,wBAAwB,CAAC,QAAQ,EAAE;YACvC,wBAAwB,CAAC,QAAQ,GAAG,IAAI,wBAAwB,CAAC,UAAU,CAAC,CAAC;SAC7E;QACD,OAAO,wBAAwB,CAAC,QAAQ,CAAC;IAC1C,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,SAAiB;QAC5C,IAAI,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAEhE,IAAI,CAAC,mBAAmB,EAAE;YACzB,mBAAmB,GAAG,MAAM,0BAAiB,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YACjF,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;SAC3D;QAED,OAAO,mBAAmB,CAAC;IAC5B,CAAC;IAEM,KAAK,CAAC,YAAY,CACxB,SAAiB,EACjB,SAAqB,EACrB,UAAoB;QAEpB,IAAI,UAAU,EAAE;YACf,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;SACzC;QACD,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACjE,MAAM,mBAAmB,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;;AAxCF,4DAyCC;AAxCe,iCAAQ,GAAoC,IAAI,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Document } from 'langchain/document';
2
+ import type { INodeExecutionData } from 'n8n-workflow';
3
+ import { N8nJsonLoader } from '../../../utils/N8nJsonLoader';
4
+ export declare function processDocuments(documentInput: N8nJsonLoader | Array<Document<Record<string, unknown>>>, inputItems: INodeExecutionData[]): Promise<{
5
+ processedDocuments: Document<Record<string, any>>[];
6
+ serializedDocuments: {
7
+ json: {
8
+ metadata: Record<string, any>;
9
+ pageContent: string;
10
+ };
11
+ }[];
12
+ }>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processDocuments = void 0;
4
+ const N8nJsonLoader_1 = require("../../../utils/N8nJsonLoader");
5
+ const N8nBinaryLoader_1 = require("../../../utils/N8nBinaryLoader");
6
+ async function processDocuments(documentInput, inputItems) {
7
+ let processedDocuments;
8
+ if (documentInput instanceof N8nJsonLoader_1.N8nJsonLoader || documentInput instanceof N8nBinaryLoader_1.N8nBinaryLoader) {
9
+ processedDocuments = await documentInput.process(inputItems);
10
+ }
11
+ else {
12
+ processedDocuments = documentInput;
13
+ }
14
+ const serializedDocuments = processedDocuments.map(({ metadata, pageContent }) => ({
15
+ json: { metadata, pageContent },
16
+ }));
17
+ return {
18
+ processedDocuments,
19
+ serializedDocuments,
20
+ };
21
+ }
22
+ exports.processDocuments = processDocuments;
23
+ //# sourceMappingURL=processDocuments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processDocuments.js","sourceRoot":"","sources":["../../../../nodes/vector_store/shared/processDocuments.ts"],"names":[],"mappings":";;;AAEA,gEAA6D;AAC7D,oEAAiE;AAE1D,KAAK,UAAU,gBAAgB,CACrC,aAAuE,EACvE,UAAgC;IAEhC,IAAI,kBAA8B,CAAC;IAEnC,IAAI,aAAa,YAAY,6BAAa,IAAI,aAAa,YAAY,iCAAe,EAAE;QACvF,kBAAkB,GAAG,MAAM,aAAa,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KAC7D;SAAM;QACN,kBAAkB,GAAG,aAAa,CAAC;KACnC;IAED,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAClF,IAAI,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE;KAC/B,CAAC,CAAC,CAAC;IAEJ,OAAO;QACN,kBAAkB;QAClB,mBAAmB;KACnB,CAAC;AACH,CAAC;AApBD,4CAoBC"}