n8n-nodes-couchbase 1.2.4 → 1.3.1
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.
- package/dist/nodes/Couchbase/Couchbase.node.js +17 -7
- package/dist/nodes/Couchbase/Couchbase.node.js.map +1 -1
- package/dist/nodes/memory/MemoryCouchbaseChat/MemoryCouchbaseChat.node.js +1 -1
- package/dist/nodes/memory/MemoryCouchbaseChat/MemoryCouchbaseChat.node.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreCouchbaseQuery/VectorStoreCouchbaseQuery.node.d.ts +19 -0
- package/dist/nodes/vector_store/VectorStoreCouchbaseQuery/VectorStoreCouchbaseQuery.node.js +337 -0
- package/dist/nodes/vector_store/VectorStoreCouchbaseQuery/VectorStoreCouchbaseQuery.node.js.map +1 -0
- package/dist/nodes/vector_store/VectorStoreCouchbaseSearch/VectorStoreCouchbaseSearch.node.d.ts +4 -1
- package/dist/nodes/vector_store/VectorStoreCouchbaseSearch/VectorStoreCouchbaseSearch.node.js +7 -4
- package/dist/nodes/vector_store/VectorStoreCouchbaseSearch/VectorStoreCouchbaseSearch.node.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.d.ts +3 -0
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js +43 -10
- package/dist/nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js +20 -3
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.d.ts +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js +12 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js +27 -9
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.d.ts +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js +14 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map +1 -1
- package/dist/nodes/vector_store/shared/createVectorStoreNode/types.d.ts +8 -2
- package/dist/package.json +14 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/N8nBinaryLoader.js +4 -4
- package/dist/utils/N8nBinaryLoader.js.map +1 -1
- package/dist/utils/N8nJsonLoader.js +2 -2
- package/dist/utils/N8nJsonLoader.js.map +1 -1
- package/dist/utils/fromAIToolFactory.d.ts +14 -0
- package/dist/utils/fromAIToolFactory.js +35 -0
- package/dist/utils/fromAIToolFactory.js.map +1 -0
- package/dist/utils/helpers.d.ts +1 -1
- package/dist/utils/logWrapper.d.ts +3 -3
- package/dist/utils/logWrapper.js.map +1 -1
- package/package.json +25 -16
|
@@ -5,9 +5,22 @@ const n8n_workflow_1 = require("n8n-workflow");
|
|
|
5
5
|
const sharedFields_1 = require("../../../../utils/sharedFields");
|
|
6
6
|
const operations_1 = require("./operations");
|
|
7
7
|
const utils_1 = require("./utils");
|
|
8
|
+
const ragStarterCallout = {
|
|
9
|
+
displayName: 'Tip: Get a feel for vector stores in n8n with our',
|
|
10
|
+
name: 'ragStarterCallout',
|
|
11
|
+
type: 'callout',
|
|
12
|
+
typeOptions: {
|
|
13
|
+
calloutAction: {
|
|
14
|
+
label: 'RAG starter template',
|
|
15
|
+
type: 'openSampleWorkflowTemplate',
|
|
16
|
+
templateId: 'rag-starter-template',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
default: '',
|
|
20
|
+
};
|
|
8
21
|
const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
9
22
|
constructor() {
|
|
10
|
-
var _a, _b, _c, _d;
|
|
23
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11
24
|
this.description = {
|
|
12
25
|
displayName: args.meta.displayName,
|
|
13
26
|
name: args.meta.name,
|
|
@@ -15,14 +28,15 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
15
28
|
icon: args.meta.icon,
|
|
16
29
|
iconColor: args.meta.iconColor,
|
|
17
30
|
group: ['transform'],
|
|
18
|
-
version: [1, 2],
|
|
31
|
+
version: [1, 1.1, 1.2, 1.3],
|
|
19
32
|
defaults: {
|
|
20
33
|
name: args.meta.displayName,
|
|
21
34
|
},
|
|
22
35
|
codex: {
|
|
23
|
-
categories: ['AI'],
|
|
24
|
-
subcategories: {
|
|
36
|
+
categories: (_a = args.meta.categories) !== null && _a !== void 0 ? _a : ['AI'],
|
|
37
|
+
subcategories: (_b = args.meta.subcategories) !== null && _b !== void 0 ? _b : {
|
|
25
38
|
AI: ['Vector Stores', 'Tools', 'Root Nodes'],
|
|
39
|
+
'Vector Stores': ['Other Vector Stores'],
|
|
26
40
|
Tools: ['Other Tools'],
|
|
27
41
|
},
|
|
28
42
|
resources: {
|
|
@@ -37,8 +51,13 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
37
51
|
inputs: `={{
|
|
38
52
|
((parameters) => {
|
|
39
53
|
const mode = parameters?.mode;
|
|
54
|
+
const useReranker = parameters?.useReranker;
|
|
40
55
|
const inputs = [{ displayName: "Embedding", type: "${n8n_workflow_1.NodeConnectionTypes.AiEmbedding}", required: true, maxConnections: 1}]
|
|
41
56
|
|
|
57
|
+
if (['load', 'retrieve', 'retrieve-as-tool'].includes(mode) && useReranker) {
|
|
58
|
+
inputs.push({ displayName: "Reranker", type: "${n8n_workflow_1.NodeConnectionTypes.AiReranker}", required: true, maxConnections: 1})
|
|
59
|
+
}
|
|
60
|
+
|
|
42
61
|
if (mode === 'retrieve-as-tool') {
|
|
43
62
|
return inputs;
|
|
44
63
|
}
|
|
@@ -68,12 +87,13 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
68
87
|
})($parameter)
|
|
69
88
|
}}`,
|
|
70
89
|
properties: [
|
|
90
|
+
ragStarterCallout,
|
|
71
91
|
{
|
|
72
92
|
displayName: 'Operation Mode',
|
|
73
93
|
name: 'mode',
|
|
74
94
|
type: 'options',
|
|
75
95
|
noDataExpression: true,
|
|
76
|
-
default: '',
|
|
96
|
+
default: 'retrieve',
|
|
77
97
|
options: (0, utils_1.getOperationModeOptions)(args),
|
|
78
98
|
},
|
|
79
99
|
{
|
|
@@ -95,6 +115,7 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
95
115
|
validateType: 'string-alphanumeric',
|
|
96
116
|
displayOptions: {
|
|
97
117
|
show: {
|
|
118
|
+
'@version': [{ _cnd: { lte: 1.2 } }],
|
|
98
119
|
mode: ['retrieve-as-tool'],
|
|
99
120
|
},
|
|
100
121
|
},
|
|
@@ -124,11 +145,11 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
124
145
|
displayOptions: {
|
|
125
146
|
show: {
|
|
126
147
|
mode: ['insert'],
|
|
127
|
-
'@version': [{ _cnd: { gte:
|
|
148
|
+
'@version': [{ _cnd: { gte: 1.1 } }],
|
|
128
149
|
},
|
|
129
150
|
},
|
|
130
151
|
},
|
|
131
|
-
...(0, utils_1.transformDescriptionForOperationMode)((
|
|
152
|
+
...(0, utils_1.transformDescriptionForOperationMode)((_c = args.insertFields) !== null && _c !== void 0 ? _c : [], 'insert'),
|
|
132
153
|
{
|
|
133
154
|
displayName: 'Prompt',
|
|
134
155
|
name: 'prompt',
|
|
@@ -166,6 +187,18 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
166
187
|
},
|
|
167
188
|
},
|
|
168
189
|
},
|
|
190
|
+
{
|
|
191
|
+
displayName: 'Rerank Results',
|
|
192
|
+
name: 'useReranker',
|
|
193
|
+
type: 'boolean',
|
|
194
|
+
default: false,
|
|
195
|
+
description: 'Whether or not to rerank results',
|
|
196
|
+
displayOptions: {
|
|
197
|
+
show: {
|
|
198
|
+
mode: ['load', 'retrieve', 'retrieve-as-tool'],
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
},
|
|
169
202
|
{
|
|
170
203
|
displayName: 'ID',
|
|
171
204
|
name: 'id',
|
|
@@ -179,12 +212,12 @@ const createVectorStoreNode = (args) => class VectorStoreNodeType {
|
|
|
179
212
|
},
|
|
180
213
|
},
|
|
181
214
|
},
|
|
182
|
-
...(0, utils_1.transformDescriptionForOperationMode)((
|
|
215
|
+
...(0, utils_1.transformDescriptionForOperationMode)((_d = args.loadFields) !== null && _d !== void 0 ? _d : [], [
|
|
183
216
|
'load',
|
|
184
217
|
'retrieve-as-tool',
|
|
185
218
|
]),
|
|
186
|
-
...(0, utils_1.transformDescriptionForOperationMode)((
|
|
187
|
-
...(0, utils_1.transformDescriptionForOperationMode)((
|
|
219
|
+
...(0, utils_1.transformDescriptionForOperationMode)((_e = args.retrieveFields) !== null && _e !== void 0 ? _e : [], 'retrieve'),
|
|
220
|
+
...(0, utils_1.transformDescriptionForOperationMode)((_f = args.updateFields) !== null && _f !== void 0 ? _f : [], 'update'),
|
|
188
221
|
],
|
|
189
222
|
};
|
|
190
223
|
this.methods = args.methods;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createVectorStoreNode.js","sourceRoot":"","sources":["../../../../../nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"createVectorStoreNode.js","sourceRoot":"","sources":["../../../../../nodes/vector_store/shared/createVectorStoreNode/createVectorStoreNode.ts"],"names":[],"mappings":";;;AAEA,+CAA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AA,iDAAoC,EACtD,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,SAAS,CACT,CAAC;gBACF,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YAC1B,CAAC;YAED,OAAO,CAAC,UAAU,CAAC,CAAC;QACrB,CAAC;QAED,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,wGAAwG,CACxG,CAAC;IACH,CAAC;IAMD,KAAK,CAAC,UAAU,CAA6B,SAAiB;QAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC,CAAsB,CAAC;QAGnE,MAAM,UAAU,GAAG,CAAC,MAAM,IAAI,CAAC,sBAAsB,CACpD,kCAAmB,CAAC,WAAW,EAC/B,CAAC,CACD,CAAe,CAAC;QAGjB,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;YACzB,OAAO,MAAM,IAAA,oCAAuB,EAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QACzE,CAAC;QAED,IAAI,IAAI,KAAK,kBAAkB,EAAE,CAAC;YACjC,OAAO,MAAM,IAAA,0CAA6B,EAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAC/E,CAAC;QAED,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,uFAAuF,CACvF,CAAC;IACH,CAAC;CACD,CAAC;AA1SU,QAAA,qBAAqB,yBA0S/B"}
|
|
@@ -11,6 +11,7 @@ async function handleInsertOperation(context, args, embeddings) {
|
|
|
11
11
|
const documentInput = (await context.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiDocument, 0));
|
|
12
12
|
const resultData = [];
|
|
13
13
|
const documentsForEmbedding = [];
|
|
14
|
+
const allInsertedIds = [];
|
|
14
15
|
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
15
16
|
if ((_a = context.getExecutionCancelSignal()) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
16
17
|
break;
|
|
@@ -20,15 +21,31 @@ async function handleInsertOperation(context, args, embeddings) {
|
|
|
20
21
|
resultData.push(...processedDocuments.serializedDocuments);
|
|
21
22
|
documentsForEmbedding.push(...processedDocuments.processedDocuments);
|
|
22
23
|
if (nodeVersion === 1) {
|
|
23
|
-
await args.populateVectorStore(context, embeddings, processedDocuments.processedDocuments, itemIndex);
|
|
24
|
+
const insertedIds = await args.populateVectorStore(context, embeddings, processedDocuments.processedDocuments, itemIndex);
|
|
25
|
+
if (insertedIds) {
|
|
26
|
+
allInsertedIds.push(...insertedIds);
|
|
27
|
+
}
|
|
24
28
|
}
|
|
25
29
|
(0, helpers_1.logAiEvent)(context, 'ai-vector-store-populated');
|
|
26
30
|
}
|
|
27
|
-
if (nodeVersion >=
|
|
31
|
+
if (nodeVersion >= 1.1) {
|
|
28
32
|
const embeddingBatchSize = (_b = context.getNodeParameter('embeddingBatchSize', 0, 200)) !== null && _b !== void 0 ? _b : 200;
|
|
29
33
|
for (let i = 0; i < documentsForEmbedding.length; i += embeddingBatchSize) {
|
|
30
34
|
const nextBatch = documentsForEmbedding.slice(i, i + embeddingBatchSize);
|
|
31
|
-
await args.populateVectorStore(context, embeddings, nextBatch, 0);
|
|
35
|
+
const insertedIds = await args.populateVectorStore(context, embeddings, nextBatch, 0);
|
|
36
|
+
if (insertedIds) {
|
|
37
|
+
allInsertedIds.push(...insertedIds);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (allInsertedIds.length > 0) {
|
|
42
|
+
for (let i = 0; i < resultData.length; i++) {
|
|
43
|
+
if (i < allInsertedIds.length) {
|
|
44
|
+
resultData[i].json = {
|
|
45
|
+
...resultData[i].json,
|
|
46
|
+
documentId: allInsertedIds[i],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
32
49
|
}
|
|
33
50
|
}
|
|
34
51
|
return resultData;
|
package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.ts"],"names":[],"mappings":";;AAiBA,
|
|
1
|
+
{"version":3,"file":"insertOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/insertOperation.ts"],"names":[],"mappings":";;AAiBA,sDAgFC;AA7FD,+CAAmD;AAEnD,4CAA4C;AAI5C,6DAAyD;AAOlD,KAAK,UAAU,qBAAqB,CAC1C,OAA0B,EAC1B,IAAuC,EACvC,UAAsB;;IAEtB,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC;IAElD,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IACrC,MAAM,aAAa,GAAG,CAAC,MAAM,OAAO,CAAC,sBAAsB,CAC1D,kCAAmB,CAAC,UAAU,EAC9B,CAAC,CACD,CAA+E,CAAC;IAEjF,MAAM,UAAU,GAAyB,EAAE,CAAC;IAC5C,MAAM,qBAAqB,GAA6C,EAAE,CAAC;IAC3E,MAAM,cAAc,GAAa,EAAE,CAAC;IAGpC,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;QAE/D,IAAI,MAAA,OAAO,CAAC,wBAAwB,EAAE,0CAAE,OAAO,EAAE,CAAC;YACjD,MAAM;QACP,CAAC;QAED,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;QAGlC,MAAM,kBAAkB,GAAG,MAAM,IAAA,kCAAe,EAAC,aAAa,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QAGrF,UAAU,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;QAG3D,qBAAqB,CAAC,IAAI,CAAC,GA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AAI,GAAG;oBACpB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;oBACrB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC;iBAC7B,CAAC;YACH,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Embeddings } from '@langchain/core/embeddings';
|
|
2
2
|
import type { VectorStore } from '@langchain/core/vectorstores';
|
|
3
|
-
import type
|
|
3
|
+
import { type IExecuteFunctions, type INodeExecutionData } from 'n8n-workflow';
|
|
4
4
|
import type { VectorStoreNodeConstructorArgs } from '../types';
|
|
5
5
|
export declare function handleLoadOperation<T extends VectorStore = VectorStore>(context: IExecuteFunctions, args: VectorStoreNodeConstructorArgs<T>, embeddings: Embeddings, itemIndex: number): Promise<INodeExecutionData[]>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleLoadOperation = handleLoadOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
4
5
|
const helpers_1 = require("../../../../../utils/helpers");
|
|
5
6
|
async function handleLoadOperation(context, args, embeddings, itemIndex) {
|
|
6
7
|
var _a;
|
|
@@ -9,9 +10,19 @@ async function handleLoadOperation(context, args, embeddings, itemIndex) {
|
|
|
9
10
|
try {
|
|
10
11
|
const prompt = context.getNodeParameter('prompt', itemIndex);
|
|
11
12
|
const topK = context.getNodeParameter('topK', itemIndex, 4);
|
|
13
|
+
const useReranker = context.getNodeParameter('useReranker', itemIndex, false);
|
|
12
14
|
const includeDocumentMetadata = context.getNodeParameter('includeDocumentMetadata', itemIndex, true);
|
|
13
15
|
const embeddedPrompt = await embeddings.embedQuery(prompt);
|
|
14
|
-
|
|
16
|
+
let docs = await vectorStore.similaritySearchVectorWithScore(embeddedPrompt, topK, filter);
|
|
17
|
+
if (useReranker && docs.length > 0) {
|
|
18
|
+
const reranker = (await context.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiReranker, 0));
|
|
19
|
+
const documents = docs.map(([doc]) => doc);
|
|
20
|
+
const rerankedDocuments = await reranker.compressDocuments(documents, prompt);
|
|
21
|
+
docs = rerankedDocuments.map((doc) => {
|
|
22
|
+
const { relevanceScore, ...metadata } = doc.metadata || {};
|
|
23
|
+
return [{ ...doc, metadata }, relevanceScore];
|
|
24
|
+
});
|
|
25
|
+
}
|
|
15
26
|
const serializedDocs = docs.map(([doc, score]) => {
|
|
16
27
|
const document = {
|
|
17
28
|
pageContent: doc.pageContent,
|
package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"loadOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/loadOperation.ts"],"names":[],"mappings":";;AAaA,kDAuEC;AAjFD,+CAAoG;AAEpG,4CAAsE;AAQ/D,KAAK,UAAU,mBAAmB,CACxC,OAA0B,EAC1B,IAAuC,EACvC,UAAsB,EACtB,SAAiB;;IAEjB,MAAM,MAAM,GAAG,IAAA,kCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAClD,OAAO,EAEP,SAAS,EACT,UAAU,EACV,SAAS,CACT,CAAC;IAEF,IAAI,CAAC;QAEJ,MAAM,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAW,CAAC;QACvE,MAAM,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,CAAW,CAAC;QACtE,MAAM,WAAW,GAAG,OAAO,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C,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9D,CAAC;YAEF,OAAO;gBACN,IAAI,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE;gBACzB,UAAU,EAAE;oBACX,IAAI,EAAE,SAAS;iBACf;aACD,CAAC;QACH,CAAC,CAAC,CAAC;QAGH,IAAA,oBAAU,EAAC,OAAO,EAAE,0BAA0B,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QAEnE,OAAO,cAAc,CAAC;IACvB,CAAC;YAAS,CAAC;QAEV,MAAA,IAAI,CAAC,wBAAwB,qDAAG,WAAW,CAAC,CAAC;IAC9C,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieveAsToolExecuteOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"retrieveAsToolExecuteOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolExecuteOperation.ts"],"names":[],"mappings":";;AAaA,oFA0FC;AApGD,+CAAoG;AACpG,4CAAsE;AAEtE,gEAAmF;AAO5E,KAAK,UAAU,oCAAoC,CACzD,OAA0B,EAC1B,IAAuC,EACvC,UAAsB,EACtB,SAAiB;;IAEjB,MAAM,MAAM,GAAG,IAAA,kCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAClD,OAAO,EAEP,SAAS,EACT,UAAU,EACV,SAAS,CACT,CAAC;IAEF,IAAI,CAAC;QAEJ,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;QACzC,MAAM,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,IAAI,CA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ations/retrieveAsToolOperation.js
CHANGED
|
@@ -1,24 +1,42 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleRetrieveAsToolOperation = handleRetrieveAsToolOperation;
|
|
4
|
-
const
|
|
4
|
+
const fromAIToolFactory_1 = require("../../../../../utils/fromAIToolFactory");
|
|
5
5
|
const helpers_1 = require("../../../../../utils/helpers");
|
|
6
6
|
const logWrapper_1 = require("../../../../../utils/logWrapper");
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
8
|
async function handleRetrieveAsToolOperation(context, args, embeddings, itemIndex) {
|
|
8
9
|
const toolDescription = context.getNodeParameter('toolDescription', itemIndex);
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const node = context.getNode();
|
|
11
|
+
const { typeVersion } = node;
|
|
12
|
+
const toolName = typeVersion < 1.3
|
|
13
|
+
? context.getNodeParameter('toolName', itemIndex)
|
|
14
|
+
: (0, n8n_workflow_1.nodeNameToToolName)(node);
|
|
15
|
+
const vectorStoreTool = (0, fromAIToolFactory_1.createToolFromNode)(node, {
|
|
14
16
|
name: toolName,
|
|
15
17
|
description: toolDescription,
|
|
16
|
-
|
|
18
|
+
extraArgs: [{ key: 'input', description: 'Query to search for. Required' }],
|
|
19
|
+
func: async (query) => {
|
|
17
20
|
var _a;
|
|
21
|
+
const topK = context.getNodeParameter('topK', itemIndex, 4);
|
|
22
|
+
const useReranker = context.getNodeParameter('useReranker', itemIndex, false);
|
|
23
|
+
const includeDocumentMetadata = context.getNodeParameter('includeDocumentMetadata', itemIndex, true);
|
|
24
|
+
const filter = (0, helpers_1.getMetadataFiltersValues)(context, itemIndex);
|
|
25
|
+
const queryString = typeof query === 'string' ? query : query.input;
|
|
26
|
+
(0, n8n_workflow_1.assert)(typeof queryString === 'string', 'Query must be of type string');
|
|
18
27
|
const vectorStore = await args.getVectorStoreClient(context, undefined, embeddings, itemIndex);
|
|
19
28
|
try {
|
|
20
|
-
const embeddedPrompt = await embeddings.embedQuery(
|
|
21
|
-
|
|
29
|
+
const embeddedPrompt = await embeddings.embedQuery(queryString);
|
|
30
|
+
let documents = await vectorStore.similaritySearchVectorWithScore(embeddedPrompt, topK, filter);
|
|
31
|
+
if (useReranker && documents.length > 0) {
|
|
32
|
+
const reranker = (await context.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiReranker, 0));
|
|
33
|
+
const docs = documents.map(([doc]) => doc);
|
|
34
|
+
const rerankedDocuments = await reranker.compressDocuments(docs, queryString);
|
|
35
|
+
documents = rerankedDocuments.map((doc) => {
|
|
36
|
+
const { relevanceScore, ...metadata } = doc.metadata;
|
|
37
|
+
return [{ ...doc, metadata }, relevanceScore];
|
|
38
|
+
});
|
|
39
|
+
}
|
|
22
40
|
return documents
|
|
23
41
|
.map((document) => {
|
|
24
42
|
if (includeDocumentMetadata) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieveAsToolOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"retrieveAsToolOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/retrieveAsToolOperation.ts"],"names":[],"mappings":";;AAeA,sEAgGC;AA5GD,gEAA8D;AAC9D,4CAA0D;AAC1D,kDAA+C;AAE/C,+CAA+E;AAQxE,KAAK,UAAU,6BAA6B,CAClD,OAA6B,EAC7B,IAAuC,EACvC,UAAsB,EACtB,SAAiB;IAGjB,MAAM,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,SAAS,CAAW,CAAC;IAEzF,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC/B,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC7B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AwB,qDAAG,WAAW,CAAC,CAAC;YAC9C,CAAC;QACF,CAAC;KACD,CAAC,CAAC;IAGH,OAAO;QACN,QAAQ,EAAE,IAAA,uBAAU,EAAC,eAAe,EAAE,OAAO,CAAC;KAC9C,CAAC;AACH,CAAC"}
|
package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Embeddings } from '@langchain/core/embeddings';
|
|
2
2
|
import type { VectorStore } from '@langchain/core/vectorstores';
|
|
3
|
-
import type
|
|
3
|
+
import { type ISupplyDataFunctions, type SupplyData } from 'n8n-workflow';
|
|
4
4
|
import type { VectorStoreNodeConstructorArgs } from '../types';
|
|
5
5
|
export declare function handleRetrieveOperation<T extends VectorStore = VectorStore>(context: ISupplyDataFunctions, args: VectorStoreNodeConstructorArgs<T>, embeddings: Embeddings, itemIndex: number): Promise<SupplyData>;
|
package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleRetrieveOperation = handleRetrieveOperation;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
4
5
|
const helpers_1 = require("../../../../../utils/helpers");
|
|
5
6
|
const logWrapper_1 = require("../../../../../utils/logWrapper");
|
|
6
7
|
async function handleRetrieveOperation(context, args, embeddings, itemIndex) {
|
|
7
8
|
const filter = (0, helpers_1.getMetadataFiltersValues)(context, itemIndex);
|
|
9
|
+
const useReranker = context.getNodeParameter('useReranker', itemIndex, false);
|
|
8
10
|
const vectorStore = await args.getVectorStoreClient(context, filter, embeddings, itemIndex);
|
|
11
|
+
let response = vectorStore;
|
|
12
|
+
if (useReranker) {
|
|
13
|
+
const reranker = (await context.getInputConnectionData(n8n_workflow_1.NodeConnectionTypes.AiReranker, 0));
|
|
14
|
+
response = {
|
|
15
|
+
reranker,
|
|
16
|
+
vectorStore: (0, logWrapper_1.logWrapper)(vectorStore, context),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
response = (0, logWrapper_1.logWrapper)(vectorStore, context);
|
|
21
|
+
}
|
|
9
22
|
return {
|
|
10
|
-
response
|
|
23
|
+
response,
|
|
11
24
|
closeFunction: async () => {
|
|
12
25
|
var _a;
|
|
13
26
|
(_a = args.releaseVectorStoreClient) === null || _a === void 0 ? void 0 : _a.call(args, vectorStore);
|
package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieveOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"retrieveOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/retrieveOperation.ts"],"names":[],"mappings":";;AAcA,0DAsCC;AAjDD,+CAA+F;AAE/F,4CAA0D;AAC1D,kDAA+C;AAQxC,KAAK,UAAU,uBAAuB,CAC5C,OAA6B,EAC7B,IAAuC,EACvC,UAAsB,EACtB,SAAiB;IAGjB,MAAM,MAAM,GAAG,IAAA,kCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,KAAK,CAAY,CAAC;IAGzF,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IAC5F,IAAI,QAAQ,GACX,WAAW,CAAC;IAEb,IAAI,WAAW,EAAE,CAAC;QACjB,MAAM,QAAQ,GAAG,CAAC,MAAM,OAAO,CAAC,sBAAsB,CACrD,kCAAmB,CAAC,UAAU,EAC9B,CAAC,CACD,CAA2B,CAAC;QAG7B,QAAQ,GAAG;YACV,QAAQ;YACR,WAAW,EAAE,IAAA,uBAAU,EAAC,WAAW,EAAE,OAAO,CAA2B;SACvE,CAAC;IACH,CAAC;SAAM,CAAC;QAEP,QAAQ,GAAG,IAAA,uBAAU,EAAC,WAAW,EAAE,OAAO,CAA2B,CAAC;IACvE,CAAC;IAED,OAAO;QACN,QAAQ;QACR,aAAa,EAAE,KAAK,IAAI,EAAE;;YAEzB,MAAA,IAAI,CAAC,wBAAwB,qDAAG,WAAW,CAAC,CAAC;QAC9C,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -21,7 +21,7 @@ async function handleUpdateOperation(context, args, embeddings) {
|
|
|
21
21
|
});
|
|
22
22
|
const vectorStore = await args.getVectorStoreClient(context, undefined, embeddings, itemIndex);
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
const { processedDocuments, serializedDocuments } = await (0, processDocuments_1.processDocument)(loader, itemData, itemIndex);
|
|
25
25
|
if ((processedDocuments === null || processedDocuments === void 0 ? void 0 : processedDocuments.length) !== 1) {
|
|
26
26
|
throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Single document per item expected');
|
|
27
27
|
}
|
package/dist/nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.ts"],"names":[],"mappings":";;AAgBA,sDA8DC;AA3ED,+CAAkD;AAElD,4CAA4C;AAC5C,wDAAqD;AAErD,6DAAyD;AAEzD,oCAA6C;AAMtC,KAAK,UAAU,qBAAqB,CAC1C,OAA0B,EAC1B,IAAuC,EACvC,UAAsB;;IAGtB,IAAI,CAAC,IAAA,yBAAiB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,iCAAkB,CAC3B,OAAO,CAAC,OAAO,EAAE,EACjB,2DAA2D,CAC3D,CAAC;IACH,CAAC;IAGD,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAErC,MAAM,MAAM,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,CAAC;IAE1C,MAAM,UAAU,GAAyB,EAAE,CAAC;IAG5C,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;QAC/D,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;QAGlC,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;YAChE,YAAY,EAAE,IAAI;SAClB,CAAW,CAAC;QAGb,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAE/F,IAAI,CAAC;YAEJ,
|
|
1
|
+
{"version":3,"file":"updateOperation.js","sourceRoot":"","sources":["../../../../../../nodes/vector_store/shared/createVectorStoreNode/operations/updateOperation.ts"],"names":[],"mappings":";;AAgBA,sDA8DC;AA3ED,+CAAkD;AAElD,4CAA4C;AAC5C,wDAAqD;AAErD,6DAAyD;AAEzD,oCAA6C;AAMtC,KAAK,UAAU,qBAAqB,CAC1C,OAA0B,EAC1B,IAAuC,EACvC,UAAsB;;IAGtB,IAAI,CAAC,IAAA,yBAAiB,EAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,iCAAkB,CAC3B,OAAO,CAAC,OAAO,EAAE,EACjB,2DAA2D,CAC3D,CAAC;IACH,CAAC;IAGD,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAErC,MAAM,MAAM,GAAG,IAAI,6BAAa,CAAC,OAAO,CAAC,CAAC;IAE1C,MAAM,UAAU,GAAyB,EAAE,CAAC;IAG5C,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;QAC/D,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;QAGlC,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE;YAChE,YAAY,EAAE,IAAI;SAClB,CAAW,CAAC;QAGb,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAE/F,IAAI,CAAC;YAEJ,MAAM,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,GAAG,MAAM,IAAA,kCAAe,EACxE,MAAM,EACN,QAAQ,EACR,SAAS,CACT,CAAC;YAGF,IAAI,CAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,MAAM,MAAK,CAAC,EAAE,CAAC;gBACtC,MAAM,IAAI,iCAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,mCAAmC,CAAC,CAAC;YACtF,CAAC;YAGD,UAAU,CAAC,IAAI,CAAC,GAAG,mBAAmB,CAAC,CAAC;YAGxC,MAAM,WAAW,CAAC,YAAY,CAAC,kBAAkB,EAAE;gBAClD,GAAG,EAAE,CAAC,UAAU,CAAC;aACjB,CAAC,CAAC;YAGH,IAAA,oBAAU,EAAC,OAAO,EAAE,yBAAyB,CAAC,CAAC;QAChD,CAAC;gBAAS,CAAC;YAEV,MAAA,IAAI,CAAC,wBAAwB,qDAAG,WAAW,CAAC,CAAC;QAC9C,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import type { Document } from '@langchain/core/documents';
|
|
2
2
|
import type { Embeddings } from '@langchain/core/embeddings';
|
|
3
3
|
import type { VectorStore } from '@langchain/core/vectorstores';
|
|
4
|
-
import type { IExecuteFunctions, INodeCredentialDescription, INodeProperties, ILoadOptionsFunctions, INodeListSearchResult, Icon, ISupplyDataFunctions, ThemeIconColor } from 'n8n-workflow';
|
|
4
|
+
import type { IExecuteFunctions, INodeCredentialDescription, INodeProperties, ILoadOptionsFunctions, INodeListSearchResult, Icon, ISupplyDataFunctions, ThemeIconColor, IDataObject, NodeParameterValueType } from 'n8n-workflow';
|
|
5
5
|
export type NodeOperationMode = 'insert' | 'load' | 'retrieve' | 'update' | 'retrieve-as-tool';
|
|
6
6
|
export interface NodeMeta {
|
|
7
7
|
displayName: string;
|
|
8
8
|
name: string;
|
|
9
|
+
hidden?: boolean;
|
|
9
10
|
description: string;
|
|
10
11
|
docsUrl: string;
|
|
11
12
|
icon: Icon;
|
|
12
13
|
iconColor?: ThemeIconColor;
|
|
13
14
|
credentials?: INodeCredentialDescription[];
|
|
14
15
|
operationModes?: NodeOperationMode[];
|
|
16
|
+
categories?: string[];
|
|
17
|
+
subcategories?: Record<string, string[]>;
|
|
15
18
|
}
|
|
16
19
|
export interface VectorStoreNodeConstructorArgs<T extends VectorStore = VectorStore> {
|
|
17
20
|
meta: NodeMeta;
|
|
@@ -19,13 +22,16 @@ export interface VectorStoreNodeConstructorArgs<T extends VectorStore = VectorSt
|
|
|
19
22
|
listSearch?: {
|
|
20
23
|
[key: string]: (this: ILoadOptionsFunctions, filter?: string, paginationToken?: string) => Promise<INodeListSearchResult>;
|
|
21
24
|
};
|
|
25
|
+
actionHandler?: {
|
|
26
|
+
[functionName: string]: (this: ILoadOptionsFunctions, payload: IDataObject | string | undefined) => Promise<NodeParameterValueType>;
|
|
27
|
+
};
|
|
22
28
|
};
|
|
23
29
|
sharedFields: INodeProperties[];
|
|
24
30
|
insertFields?: INodeProperties[];
|
|
25
31
|
loadFields?: INodeProperties[];
|
|
26
32
|
retrieveFields?: INodeProperties[];
|
|
27
33
|
updateFields?: INodeProperties[];
|
|
28
|
-
populateVectorStore: (context: IExecuteFunctions | ISupplyDataFunctions, embeddings: Embeddings, documents: Array<Document<Record<string, unknown>>>, itemIndex: number) => Promise<void>;
|
|
34
|
+
populateVectorStore: (context: IExecuteFunctions | ISupplyDataFunctions, embeddings: Embeddings, documents: Array<Document<Record<string, unknown>>>, itemIndex: number) => Promise<string[] | void>;
|
|
29
35
|
getVectorStoreClient: (context: IExecuteFunctions | ISupplyDataFunctions, filter: Record<string, never> | undefined, embeddings: Embeddings, itemIndex: number) => Promise<T>;
|
|
30
36
|
releaseVectorStoreClient?: (vectorStore: T) => void;
|
|
31
37
|
}
|
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-couchbase",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Community nodes for using Couchbase Key-Value, Query, Full-Text Search,
|
|
3
|
+
"version": "1.3.1",
|
|
4
|
+
"description": "Community nodes for using Couchbase Key-Value, Query, Full-Text Search, Couchbase Search Vector Store, Couchbase Query Vector Store, and Couchbase as Chat Memory with n8n.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"n8n-community-node-package"
|
|
7
7
|
],
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"nodes": [
|
|
43
43
|
"dist/nodes/Couchbase/Couchbase.node.js",
|
|
44
44
|
"dist/nodes/vector_store/VectorStoreCouchbaseSearch/VectorStoreCouchbaseSearch.node.js",
|
|
45
|
+
"dist/nodes/vector_store/VectorStoreCouchbaseQuery/VectorStoreCouchbaseQuery.node.js",
|
|
45
46
|
"dist/nodes/memory/MemoryCouchbaseChat/MemoryCouchbaseChat.node.js"
|
|
46
47
|
]
|
|
47
48
|
},
|
|
@@ -61,13 +62,19 @@
|
|
|
61
62
|
"n8n-workflow": "^1.120.1"
|
|
62
63
|
},
|
|
63
64
|
"dependencies": {
|
|
64
|
-
"@langchain/
|
|
65
|
-
"@langchain/
|
|
66
|
-
"@langchain/
|
|
67
|
-
"
|
|
68
|
-
"
|
|
65
|
+
"@langchain/classic": "^1.0.19",
|
|
66
|
+
"@langchain/community": "^1.1.18",
|
|
67
|
+
"@langchain/core": "^1.1.27",
|
|
68
|
+
"@langchain/textsplitters": "^1.0.1",
|
|
69
|
+
"couchbase": "^4.6.1",
|
|
70
|
+
"langchain": "^1.2.26",
|
|
69
71
|
"tmp-promise": "^3.0.3",
|
|
70
72
|
"uuid": "^11.1.0",
|
|
71
73
|
"zod": "^3.24.2"
|
|
74
|
+
},
|
|
75
|
+
"pnpm": {
|
|
76
|
+
"overrides": {
|
|
77
|
+
"@langchain/langgraph-sdk": "1.3.1"
|
|
78
|
+
}
|
|
72
79
|
}
|
|
73
80
|
}
|