@mastra/couchbase 0.0.0-trigger-playground-ui-package-20250506151043 → 0.0.0-tsconfig-compile-20250703214351
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/CHANGELOG.md +348 -2
- package/README.md +11 -1
- package/dist/_tsup-dts-rollup.d.cts +47 -6
- package/dist/_tsup-dts-rollup.d.ts +47 -6
- package/dist/index.cjs +391 -180
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +392 -181
- package/docker-compose.yaml +12 -12
- package/package.json +16 -13
- package/src/vector/index.integration.test.ts +191 -16
- package/src/vector/index.ts +417 -189
- package/src/vector/index.unit.test.ts +55 -55
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,340 @@
|
|
|
1
1
|
# @mastra/couchbase
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-tsconfig-compile-20250703214351
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b790fd1]
|
|
8
|
+
- Updated dependencies [f36e4f1]
|
|
9
|
+
- @mastra/core@0.0.0-tsconfig-compile-20250703214351
|
|
10
|
+
|
|
11
|
+
## 0.11.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 8a3bfd2: Update peerdeps to latest core
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 0e17048: Throw mastra errors in storage packages
|
|
20
|
+
- Updated dependencies [15e9d26]
|
|
21
|
+
- Updated dependencies [d1baedb]
|
|
22
|
+
- Updated dependencies [d8f2d19]
|
|
23
|
+
- Updated dependencies [4d21bf2]
|
|
24
|
+
- Updated dependencies [07d6d88]
|
|
25
|
+
- Updated dependencies [9d52b17]
|
|
26
|
+
- Updated dependencies [2097952]
|
|
27
|
+
- Updated dependencies [792c4c0]
|
|
28
|
+
- Updated dependencies [5d74aab]
|
|
29
|
+
- Updated dependencies [a8b194f]
|
|
30
|
+
- Updated dependencies [4fb0cc2]
|
|
31
|
+
- Updated dependencies [d2a7a31]
|
|
32
|
+
- Updated dependencies [502fe05]
|
|
33
|
+
- Updated dependencies [144eb0b]
|
|
34
|
+
- Updated dependencies [8ba1b51]
|
|
35
|
+
- Updated dependencies [4efcfa0]
|
|
36
|
+
- Updated dependencies [0e17048]
|
|
37
|
+
- @mastra/core@0.10.7
|
|
38
|
+
|
|
39
|
+
## 0.11.0-alpha.1
|
|
40
|
+
|
|
41
|
+
### Minor Changes
|
|
42
|
+
|
|
43
|
+
- 8a3bfd2: Update peerdeps to latest core
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [792c4c0]
|
|
48
|
+
- Updated dependencies [502fe05]
|
|
49
|
+
- Updated dependencies [4efcfa0]
|
|
50
|
+
- @mastra/core@0.10.7-alpha.3
|
|
51
|
+
|
|
52
|
+
## 0.10.4-alpha.0
|
|
53
|
+
|
|
54
|
+
### Patch Changes
|
|
55
|
+
|
|
56
|
+
- 0e17048: Throw mastra errors in storage packages
|
|
57
|
+
- Updated dependencies [d1baedb]
|
|
58
|
+
- Updated dependencies [4d21bf2]
|
|
59
|
+
- Updated dependencies [2097952]
|
|
60
|
+
- Updated dependencies [4fb0cc2]
|
|
61
|
+
- Updated dependencies [d2a7a31]
|
|
62
|
+
- Updated dependencies [0e17048]
|
|
63
|
+
- @mastra/core@0.10.7-alpha.1
|
|
64
|
+
|
|
65
|
+
## 0.10.3
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- 63f6b7d: dependencies updates:
|
|
70
|
+
- Updated dependency [`couchbase@^4.5.0` ↗︎](https://www.npmjs.com/package/couchbase/v/4.5.0) (from `^4.4.5`, in `dependencies`)
|
|
71
|
+
- Updated dependencies [63f6b7d]
|
|
72
|
+
- Updated dependencies [12a95fc]
|
|
73
|
+
- Updated dependencies [4b0f8a6]
|
|
74
|
+
- Updated dependencies [51264a5]
|
|
75
|
+
- Updated dependencies [8e6f677]
|
|
76
|
+
- Updated dependencies [d70c420]
|
|
77
|
+
- Updated dependencies [ee9af57]
|
|
78
|
+
- Updated dependencies [36f1c36]
|
|
79
|
+
- Updated dependencies [2a16996]
|
|
80
|
+
- Updated dependencies [10d352e]
|
|
81
|
+
- Updated dependencies [9589624]
|
|
82
|
+
- Updated dependencies [53d3c37]
|
|
83
|
+
- Updated dependencies [751c894]
|
|
84
|
+
- Updated dependencies [577ce3a]
|
|
85
|
+
- Updated dependencies [9260b3a]
|
|
86
|
+
- @mastra/core@0.10.6
|
|
87
|
+
|
|
88
|
+
## 0.10.3-alpha.0
|
|
89
|
+
|
|
90
|
+
### Patch Changes
|
|
91
|
+
|
|
92
|
+
- 63f6b7d: dependencies updates:
|
|
93
|
+
- Updated dependency [`couchbase@^4.5.0` ↗︎](https://www.npmjs.com/package/couchbase/v/4.5.0) (from `^4.4.5`, in `dependencies`)
|
|
94
|
+
- Updated dependencies [63f6b7d]
|
|
95
|
+
- Updated dependencies [36f1c36]
|
|
96
|
+
- Updated dependencies [10d352e]
|
|
97
|
+
- Updated dependencies [53d3c37]
|
|
98
|
+
- @mastra/core@0.10.6-alpha.0
|
|
99
|
+
|
|
100
|
+
## 0.10.2
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- 66f4424: Update peerdeps
|
|
105
|
+
- Updated dependencies [d1ed912]
|
|
106
|
+
- Updated dependencies [f6fd25f]
|
|
107
|
+
- Updated dependencies [dffb67b]
|
|
108
|
+
- Updated dependencies [f1f1f1b]
|
|
109
|
+
- Updated dependencies [925ab94]
|
|
110
|
+
- Updated dependencies [f9816ae]
|
|
111
|
+
- Updated dependencies [82090c1]
|
|
112
|
+
- Updated dependencies [1b443fd]
|
|
113
|
+
- Updated dependencies [ce97900]
|
|
114
|
+
- Updated dependencies [f1309d3]
|
|
115
|
+
- Updated dependencies [14a2566]
|
|
116
|
+
- Updated dependencies [f7f8293]
|
|
117
|
+
- Updated dependencies [48eddb9]
|
|
118
|
+
- @mastra/core@0.10.4
|
|
119
|
+
|
|
120
|
+
## 0.10.2-alpha.0
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- 66f4424: Update peerdeps
|
|
125
|
+
|
|
126
|
+
## 0.10.1
|
|
127
|
+
|
|
128
|
+
### Patch Changes
|
|
129
|
+
|
|
130
|
+
- f0d559f: Fix peerdeps for alpha channel
|
|
131
|
+
- 915ca1a: Added disconnect function for couchbase and added docs
|
|
132
|
+
Added prompt for OpenSearchVector
|
|
133
|
+
- Updated dependencies [ee77e78]
|
|
134
|
+
- Updated dependencies [592a2db]
|
|
135
|
+
- Updated dependencies [e5dc18d]
|
|
136
|
+
- Updated dependencies [ab5adbe]
|
|
137
|
+
- Updated dependencies [1e8bb40]
|
|
138
|
+
- Updated dependencies [1b5fc55]
|
|
139
|
+
- Updated dependencies [195c428]
|
|
140
|
+
- Updated dependencies [f73e11b]
|
|
141
|
+
- Updated dependencies [37643b8]
|
|
142
|
+
- Updated dependencies [99fd6cf]
|
|
143
|
+
- Updated dependencies [c5bf1ce]
|
|
144
|
+
- Updated dependencies [add596e]
|
|
145
|
+
- Updated dependencies [8dc94d8]
|
|
146
|
+
- Updated dependencies [ecebbeb]
|
|
147
|
+
- Updated dependencies [79d5145]
|
|
148
|
+
- Updated dependencies [12b7002]
|
|
149
|
+
- Updated dependencies [2901125]
|
|
150
|
+
- @mastra/core@0.10.2
|
|
151
|
+
|
|
152
|
+
## 0.10.1-alpha.1
|
|
153
|
+
|
|
154
|
+
### Patch Changes
|
|
155
|
+
|
|
156
|
+
- f0d559f: Fix peerdeps for alpha channel
|
|
157
|
+
- Updated dependencies [1e8bb40]
|
|
158
|
+
- @mastra/core@0.10.2-alpha.2
|
|
159
|
+
|
|
160
|
+
## 0.10.1-alpha.0
|
|
161
|
+
|
|
162
|
+
### Patch Changes
|
|
163
|
+
|
|
164
|
+
- 915ca1a: Added disconnect function for couchbase and added docs
|
|
165
|
+
Added prompt for OpenSearchVector
|
|
166
|
+
- Updated dependencies [ee77e78]
|
|
167
|
+
- Updated dependencies [2901125]
|
|
168
|
+
- @mastra/core@0.10.2-alpha.1
|
|
169
|
+
|
|
170
|
+
## 0.10.0
|
|
171
|
+
|
|
172
|
+
### Minor Changes
|
|
173
|
+
|
|
174
|
+
- 83da932: Move @mastra/core to peerdeps
|
|
175
|
+
|
|
176
|
+
### Patch Changes
|
|
177
|
+
|
|
178
|
+
- d0ee3c6: Change all public functions and constructors in vector stores to use named args and prepare to phase out positional args
|
|
179
|
+
- a7292b0: BREAKING(@mastra/core, all vector stores): Vector store breaking changes (remove deprecated functions and positional arguments)
|
|
180
|
+
- Updated dependencies [b3a3d63]
|
|
181
|
+
- Updated dependencies [344f453]
|
|
182
|
+
- Updated dependencies [0a3ae6d]
|
|
183
|
+
- Updated dependencies [95911be]
|
|
184
|
+
- Updated dependencies [f53a6ac]
|
|
185
|
+
- Updated dependencies [5eb5a99]
|
|
186
|
+
- Updated dependencies [7e632c5]
|
|
187
|
+
- Updated dependencies [1e9fbfa]
|
|
188
|
+
- Updated dependencies [eabdcd9]
|
|
189
|
+
- Updated dependencies [90be034]
|
|
190
|
+
- Updated dependencies [99f050a]
|
|
191
|
+
- Updated dependencies [d0ee3c6]
|
|
192
|
+
- Updated dependencies [b2ae5aa]
|
|
193
|
+
- Updated dependencies [23f258c]
|
|
194
|
+
- Updated dependencies [a7292b0]
|
|
195
|
+
- Updated dependencies [0dcb9f0]
|
|
196
|
+
- Updated dependencies [2672a05]
|
|
197
|
+
- @mastra/core@0.10.0
|
|
198
|
+
|
|
199
|
+
## 0.1.0-alpha.1
|
|
200
|
+
|
|
201
|
+
### Minor Changes
|
|
202
|
+
|
|
203
|
+
- 83da932: Move @mastra/core to peerdeps
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- a7292b0: BREAKING(@mastra/core, all vector stores): Vector store breaking changes (remove deprecated functions and positional arguments)
|
|
208
|
+
- Updated dependencies [b3a3d63]
|
|
209
|
+
- Updated dependencies [344f453]
|
|
210
|
+
- Updated dependencies [0a3ae6d]
|
|
211
|
+
- Updated dependencies [95911be]
|
|
212
|
+
- Updated dependencies [5eb5a99]
|
|
213
|
+
- Updated dependencies [7e632c5]
|
|
214
|
+
- Updated dependencies [1e9fbfa]
|
|
215
|
+
- Updated dependencies [b2ae5aa]
|
|
216
|
+
- Updated dependencies [a7292b0]
|
|
217
|
+
- Updated dependencies [0dcb9f0]
|
|
218
|
+
- @mastra/core@0.10.0-alpha.1
|
|
219
|
+
|
|
220
|
+
## 0.0.5-alpha.0
|
|
221
|
+
|
|
222
|
+
### Patch Changes
|
|
223
|
+
|
|
224
|
+
- d0ee3c6: Change all public functions and constructors in vector stores to use named args and prepare to phase out positional args
|
|
225
|
+
- Updated dependencies [f53a6ac]
|
|
226
|
+
- Updated dependencies [eabdcd9]
|
|
227
|
+
- Updated dependencies [90be034]
|
|
228
|
+
- Updated dependencies [99f050a]
|
|
229
|
+
- Updated dependencies [d0ee3c6]
|
|
230
|
+
- Updated dependencies [23f258c]
|
|
231
|
+
- Updated dependencies [2672a05]
|
|
232
|
+
- @mastra/core@0.9.5-alpha.0
|
|
233
|
+
|
|
234
|
+
## 0.0.4
|
|
235
|
+
|
|
236
|
+
### Patch Changes
|
|
237
|
+
|
|
238
|
+
- c3bd795: [MASTRA-3358] Deprecate updateIndexById and deleteIndexById
|
|
239
|
+
- Updated dependencies [396be50]
|
|
240
|
+
- Updated dependencies [ab80e7e]
|
|
241
|
+
- Updated dependencies [c3bd795]
|
|
242
|
+
- Updated dependencies [da082f8]
|
|
243
|
+
- Updated dependencies [a5810ce]
|
|
244
|
+
- Updated dependencies [3e9c131]
|
|
245
|
+
- Updated dependencies [3171b5b]
|
|
246
|
+
- Updated dependencies [973e5ac]
|
|
247
|
+
- Updated dependencies [daf942f]
|
|
248
|
+
- Updated dependencies [0b8b868]
|
|
249
|
+
- Updated dependencies [9e1eff5]
|
|
250
|
+
- Updated dependencies [6fa1ad1]
|
|
251
|
+
- Updated dependencies [c28d7a0]
|
|
252
|
+
- Updated dependencies [edf1e88]
|
|
253
|
+
- @mastra/core@0.9.4
|
|
254
|
+
|
|
255
|
+
## 0.0.4-alpha.4
|
|
256
|
+
|
|
257
|
+
### Patch Changes
|
|
258
|
+
|
|
259
|
+
- Updated dependencies [3e9c131]
|
|
260
|
+
- @mastra/core@0.9.4-alpha.4
|
|
261
|
+
|
|
262
|
+
## 0.0.4-alpha.3
|
|
263
|
+
|
|
264
|
+
### Patch Changes
|
|
265
|
+
|
|
266
|
+
- c3bd795: [MASTRA-3358] Deprecate updateIndexById and deleteIndexById
|
|
267
|
+
- Updated dependencies [396be50]
|
|
268
|
+
- Updated dependencies [c3bd795]
|
|
269
|
+
- Updated dependencies [da082f8]
|
|
270
|
+
- Updated dependencies [a5810ce]
|
|
271
|
+
- @mastra/core@0.9.4-alpha.3
|
|
272
|
+
|
|
273
|
+
## 0.0.4-alpha.2
|
|
274
|
+
|
|
275
|
+
### Patch Changes
|
|
276
|
+
|
|
277
|
+
- Updated dependencies [3171b5b]
|
|
278
|
+
- Updated dependencies [973e5ac]
|
|
279
|
+
- Updated dependencies [9e1eff5]
|
|
280
|
+
- @mastra/core@0.9.4-alpha.2
|
|
281
|
+
|
|
282
|
+
## 0.0.4-alpha.1
|
|
283
|
+
|
|
284
|
+
### Patch Changes
|
|
285
|
+
|
|
286
|
+
- Updated dependencies [ab80e7e]
|
|
287
|
+
- Updated dependencies [6fa1ad1]
|
|
288
|
+
- Updated dependencies [c28d7a0]
|
|
289
|
+
- Updated dependencies [edf1e88]
|
|
290
|
+
- @mastra/core@0.9.4-alpha.1
|
|
291
|
+
|
|
292
|
+
## 0.0.4-alpha.0
|
|
293
|
+
|
|
294
|
+
### Patch Changes
|
|
295
|
+
|
|
296
|
+
- Updated dependencies [daf942f]
|
|
297
|
+
- Updated dependencies [0b8b868]
|
|
298
|
+
- @mastra/core@0.9.4-alpha.0
|
|
299
|
+
|
|
300
|
+
## 0.0.3
|
|
301
|
+
|
|
302
|
+
### Patch Changes
|
|
303
|
+
|
|
304
|
+
- 9cd1a46: [MASTRA-3338] update naming scheme for embedding index based on vector store rules and added duplicate index checks
|
|
305
|
+
- Updated dependencies [e450778]
|
|
306
|
+
- Updated dependencies [8902157]
|
|
307
|
+
- Updated dependencies [ca0dc88]
|
|
308
|
+
- Updated dependencies [526c570]
|
|
309
|
+
- Updated dependencies [d7a6a33]
|
|
310
|
+
- Updated dependencies [9cd1a46]
|
|
311
|
+
- Updated dependencies [b5d2de0]
|
|
312
|
+
- Updated dependencies [644f8ad]
|
|
313
|
+
- Updated dependencies [70dbf51]
|
|
314
|
+
- @mastra/core@0.9.3
|
|
315
|
+
|
|
316
|
+
## 0.0.3-alpha.1
|
|
317
|
+
|
|
318
|
+
### Patch Changes
|
|
319
|
+
|
|
320
|
+
- 9cd1a46: [MASTRA-3338] update naming scheme for embedding index based on vector store rules and added duplicate index checks
|
|
321
|
+
- Updated dependencies [e450778]
|
|
322
|
+
- Updated dependencies [8902157]
|
|
323
|
+
- Updated dependencies [ca0dc88]
|
|
324
|
+
- Updated dependencies [9cd1a46]
|
|
325
|
+
- Updated dependencies [70dbf51]
|
|
326
|
+
- @mastra/core@0.9.3-alpha.1
|
|
327
|
+
|
|
328
|
+
## 0.0.3-alpha.0
|
|
329
|
+
|
|
330
|
+
### Patch Changes
|
|
331
|
+
|
|
332
|
+
- Updated dependencies [526c570]
|
|
333
|
+
- Updated dependencies [b5d2de0]
|
|
334
|
+
- Updated dependencies [644f8ad]
|
|
335
|
+
- @mastra/core@0.9.3-alpha.0
|
|
336
|
+
|
|
337
|
+
## 0.0.2
|
|
4
338
|
|
|
5
339
|
### Patch Changes
|
|
6
340
|
|
|
@@ -19,8 +353,20 @@
|
|
|
19
353
|
- Updated dependencies [17826a9]
|
|
20
354
|
- Updated dependencies [7d8b7c7]
|
|
21
355
|
- Updated dependencies [fba031f]
|
|
356
|
+
- Updated dependencies [3a5f1e1]
|
|
22
357
|
- Updated dependencies [51e6923]
|
|
23
|
-
|
|
358
|
+
- Updated dependencies [8398d89]
|
|
359
|
+
- @mastra/core@0.9.2
|
|
360
|
+
|
|
361
|
+
## 0.0.2-alpha.1
|
|
362
|
+
|
|
363
|
+
### Patch Changes
|
|
364
|
+
|
|
365
|
+
- Updated dependencies [6052aa6]
|
|
366
|
+
- Updated dependencies [7d8b7c7]
|
|
367
|
+
- Updated dependencies [3a5f1e1]
|
|
368
|
+
- Updated dependencies [8398d89]
|
|
369
|
+
- @mastra/core@0.9.2-alpha.6
|
|
24
370
|
|
|
25
371
|
## 0.0.2-alpha.0
|
|
26
372
|
|
package/README.md
CHANGED
|
@@ -51,7 +51,14 @@ const bucketName = 'your_vector_bucket';
|
|
|
51
51
|
const scopeName = '_default'; // Or your custom scope name
|
|
52
52
|
const collectionName = 'vector_data'; // Or your custom collection name
|
|
53
53
|
|
|
54
|
-
const vectorStore = new CouchbaseVector(
|
|
54
|
+
const vectorStore = new CouchbaseVector({
|
|
55
|
+
connectionString,
|
|
56
|
+
username,
|
|
57
|
+
password,
|
|
58
|
+
bucketName,
|
|
59
|
+
scopeName,
|
|
60
|
+
collectionName,
|
|
61
|
+
});
|
|
55
62
|
|
|
56
63
|
console.log('CouchbaseVector instance created. Connecting...');
|
|
57
64
|
```
|
|
@@ -214,6 +221,9 @@ _Note_: Deleting Index does NOT delete the vectors in the associated Couchbase C
|
|
|
214
221
|
- `listIndexes()`: Lists the names of all Search Indexes in the cluster. Returns fully qualified names (e.g., `bucket.scope.index`).
|
|
215
222
|
- `describeIndex(indexName)`: Gets the configured dimension, metric (Mastra name), and document count (currently returns -1) for a specific Search Index (using its short name).
|
|
216
223
|
- `deleteIndex(indexName)`: Deletes a Search Index (using its short name).
|
|
224
|
+
- `deleteVector(indexName, id)`: Deletes a specific vector entry from an index by its ID.
|
|
225
|
+
- `updateVector(indexName, id, update)`: Updates a specific vector entry by its ID with new vector data and/or metadata.
|
|
226
|
+
- `disconnect()`: Closes the Couchbase client connection. Should be called when done using the store.
|
|
217
227
|
|
|
218
228
|
## Configuration Details
|
|
219
229
|
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { Collection } from 'couchbase';
|
|
2
2
|
import type { CreateIndexParams } from '@mastra/core/vector';
|
|
3
|
+
import type { DeleteIndexParams } from '@mastra/core/vector';
|
|
4
|
+
import type { DeleteVectorParams } from '@mastra/core/vector';
|
|
5
|
+
import type { DescribeIndexParams } from '@mastra/core/vector';
|
|
3
6
|
import type { IndexStats } from '@mastra/core/vector';
|
|
4
7
|
import { MastraVector } from '@mastra/core/vector';
|
|
5
8
|
import type { QueryResult } from '@mastra/core/vector';
|
|
6
9
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
10
|
+
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
7
11
|
import type { UpsertVectorParams } from '@mastra/core/vector';
|
|
8
12
|
|
|
9
13
|
declare type CouchbaseMetric = 'cosine' | 'l2_norm' | 'dot_product';
|
|
@@ -18,18 +22,55 @@ declare class CouchbaseVector extends MastraVector {
|
|
|
18
22
|
private bucket;
|
|
19
23
|
private scope;
|
|
20
24
|
private vector_dimension;
|
|
21
|
-
constructor(
|
|
25
|
+
constructor({ connectionString, username, password, bucketName, scopeName, collectionName }: CouchbaseVectorParams);
|
|
22
26
|
getCollection(): Promise<Collection>;
|
|
23
|
-
createIndex(
|
|
24
|
-
upsert(
|
|
25
|
-
query(
|
|
27
|
+
createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
|
|
28
|
+
upsert({ vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
|
|
29
|
+
query({ indexName, queryVector, topK, includeVector }: QueryVectorParams): Promise<QueryResult[]>;
|
|
26
30
|
listIndexes(): Promise<string[]>;
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves statistics about a vector index.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} indexName - The name of the index to describe
|
|
35
|
+
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
36
|
+
*/
|
|
37
|
+
describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
|
|
38
|
+
deleteIndex({ indexName }: DeleteIndexParams): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
41
|
+
* @param indexName - The name of the index containing the vector.
|
|
42
|
+
* @param id - The ID of the vector to update.
|
|
43
|
+
* @param update - An object containing the vector and/or metadata to update.
|
|
44
|
+
* @param update.vector - An optional array of numbers representing the new vector.
|
|
45
|
+
* @param update.metadata - An optional record containing the new metadata.
|
|
46
|
+
* @returns A promise that resolves when the update is complete.
|
|
47
|
+
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
48
|
+
*/
|
|
49
|
+
updateVector({ id, update }: UpdateVectorParams): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Deletes a vector by its ID.
|
|
52
|
+
* @param indexName - The name of the index containing the vector.
|
|
53
|
+
* @param id - The ID of the vector to delete.
|
|
54
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
55
|
+
* @throws Will throw an error if the deletion operation fails.
|
|
56
|
+
*/
|
|
57
|
+
deleteVector({ id }: DeleteVectorParams): Promise<void>;
|
|
58
|
+
disconnect(): Promise<void>;
|
|
29
59
|
}
|
|
30
60
|
export { CouchbaseVector }
|
|
31
61
|
export { CouchbaseVector as CouchbaseVector_alias_1 }
|
|
32
62
|
|
|
63
|
+
declare type CouchbaseVectorParams = {
|
|
64
|
+
connectionString: string;
|
|
65
|
+
username: string;
|
|
66
|
+
password: string;
|
|
67
|
+
bucketName: string;
|
|
68
|
+
scopeName: string;
|
|
69
|
+
collectionName: string;
|
|
70
|
+
};
|
|
71
|
+
export { CouchbaseVectorParams }
|
|
72
|
+
export { CouchbaseVectorParams as CouchbaseVectorParams_alias_1 }
|
|
73
|
+
|
|
33
74
|
declare const DISTANCE_MAPPING: Record<MastraMetric, CouchbaseMetric>;
|
|
34
75
|
export { DISTANCE_MAPPING }
|
|
35
76
|
export { DISTANCE_MAPPING as DISTANCE_MAPPING_alias_1 }
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import type { Collection } from 'couchbase';
|
|
2
2
|
import type { CreateIndexParams } from '@mastra/core/vector';
|
|
3
|
+
import type { DeleteIndexParams } from '@mastra/core/vector';
|
|
4
|
+
import type { DeleteVectorParams } from '@mastra/core/vector';
|
|
5
|
+
import type { DescribeIndexParams } from '@mastra/core/vector';
|
|
3
6
|
import type { IndexStats } from '@mastra/core/vector';
|
|
4
7
|
import { MastraVector } from '@mastra/core/vector';
|
|
5
8
|
import type { QueryResult } from '@mastra/core/vector';
|
|
6
9
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
10
|
+
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
7
11
|
import type { UpsertVectorParams } from '@mastra/core/vector';
|
|
8
12
|
|
|
9
13
|
declare type CouchbaseMetric = 'cosine' | 'l2_norm' | 'dot_product';
|
|
@@ -18,18 +22,55 @@ declare class CouchbaseVector extends MastraVector {
|
|
|
18
22
|
private bucket;
|
|
19
23
|
private scope;
|
|
20
24
|
private vector_dimension;
|
|
21
|
-
constructor(
|
|
25
|
+
constructor({ connectionString, username, password, bucketName, scopeName, collectionName }: CouchbaseVectorParams);
|
|
22
26
|
getCollection(): Promise<Collection>;
|
|
23
|
-
createIndex(
|
|
24
|
-
upsert(
|
|
25
|
-
query(
|
|
27
|
+
createIndex({ indexName, dimension, metric }: CreateIndexParams): Promise<void>;
|
|
28
|
+
upsert({ vectors, metadata, ids }: UpsertVectorParams): Promise<string[]>;
|
|
29
|
+
query({ indexName, queryVector, topK, includeVector }: QueryVectorParams): Promise<QueryResult[]>;
|
|
26
30
|
listIndexes(): Promise<string[]>;
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves statistics about a vector index.
|
|
33
|
+
*
|
|
34
|
+
* @param {string} indexName - The name of the index to describe
|
|
35
|
+
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
36
|
+
*/
|
|
37
|
+
describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
|
|
38
|
+
deleteIndex({ indexName }: DeleteIndexParams): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
41
|
+
* @param indexName - The name of the index containing the vector.
|
|
42
|
+
* @param id - The ID of the vector to update.
|
|
43
|
+
* @param update - An object containing the vector and/or metadata to update.
|
|
44
|
+
* @param update.vector - An optional array of numbers representing the new vector.
|
|
45
|
+
* @param update.metadata - An optional record containing the new metadata.
|
|
46
|
+
* @returns A promise that resolves when the update is complete.
|
|
47
|
+
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
48
|
+
*/
|
|
49
|
+
updateVector({ id, update }: UpdateVectorParams): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Deletes a vector by its ID.
|
|
52
|
+
* @param indexName - The name of the index containing the vector.
|
|
53
|
+
* @param id - The ID of the vector to delete.
|
|
54
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
55
|
+
* @throws Will throw an error if the deletion operation fails.
|
|
56
|
+
*/
|
|
57
|
+
deleteVector({ id }: DeleteVectorParams): Promise<void>;
|
|
58
|
+
disconnect(): Promise<void>;
|
|
29
59
|
}
|
|
30
60
|
export { CouchbaseVector }
|
|
31
61
|
export { CouchbaseVector as CouchbaseVector_alias_1 }
|
|
32
62
|
|
|
63
|
+
declare type CouchbaseVectorParams = {
|
|
64
|
+
connectionString: string;
|
|
65
|
+
username: string;
|
|
66
|
+
password: string;
|
|
67
|
+
bucketName: string;
|
|
68
|
+
scopeName: string;
|
|
69
|
+
collectionName: string;
|
|
70
|
+
};
|
|
71
|
+
export { CouchbaseVectorParams }
|
|
72
|
+
export { CouchbaseVectorParams as CouchbaseVectorParams_alias_1 }
|
|
73
|
+
|
|
33
74
|
declare const DISTANCE_MAPPING: Record<MastraMetric, CouchbaseMetric>;
|
|
34
75
|
export { DISTANCE_MAPPING }
|
|
35
76
|
export { DISTANCE_MAPPING as DISTANCE_MAPPING_alias_1 }
|