@mastra/couchbase 1.1.0 → 1.1.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/CHANGELOG.md +18 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-rag-vector-databases.md +28 -4
- package/dist/docs/references/reference-vectors-couchbase.md +6 -4
- package/dist/index.cjs +376 -483
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +374 -480
- package/dist/index.js.map +1 -1
- package/package.json +17 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @mastra/couchbase
|
|
2
2
|
|
|
3
|
+
## 1.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dependencies updates: ([#19779](https://github.com/mastra-ai/mastra/pull/19779))
|
|
8
|
+
- Updated dependency [`couchbase@^4.7.1` ↗︎](https://www.npmjs.com/package/couchbase/v/4.7.1) (from `^4.7.0`, in `dependencies`)
|
|
9
|
+
- Updated dependencies [[`3f472b4`](https://github.com/mastra-ai/mastra/commit/3f472b468892a1ff14ccb43cc0343b86f7d8fd7d), [`ba369f2`](https://github.com/mastra-ai/mastra/commit/ba369f2a0aaf998da0d6aa033d26f64f96bef8ac), [`35b929b`](https://github.com/mastra-ai/mastra/commit/35b929b7abc3d20d85c7985880960ac2d04a6c86), [`55c9e24`](https://github.com/mastra-ai/mastra/commit/55c9e248c27c1d72b5bb7e94ea6b8a3999eee49f), [`dcfed93`](https://github.com/mastra-ai/mastra/commit/dcfed93e1e256c6abfa792cbb7ca836f5d0e8638), [`2876e15`](https://github.com/mastra-ai/mastra/commit/2876e15b4d2f616a3bc1ed3af57d546c268384ce), [`9b3626a`](https://github.com/mastra-ai/mastra/commit/9b3626aeb1d16fcd34b0a8e94c114ddb80a3b240), [`4696963`](https://github.com/mastra-ai/mastra/commit/469696312ac4c618bc8475b0c5ed7949b8a3455e), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`07f5b4b`](https://github.com/mastra-ai/mastra/commit/07f5b4ba9d608d88865030732e580298296adf99), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`598080f`](https://github.com/mastra-ai/mastra/commit/598080f224edb3f0f5b801035b067fac50a56a03)]:
|
|
10
|
+
- @mastra/core@1.55.0
|
|
11
|
+
|
|
12
|
+
## 1.1.1-alpha.0
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- dependencies updates: ([#19779](https://github.com/mastra-ai/mastra/pull/19779))
|
|
17
|
+
- Updated dependency [`couchbase@^4.7.1` ↗︎](https://www.npmjs.com/package/couchbase/v/4.7.1) (from `^4.7.0`, in `dependencies`)
|
|
18
|
+
- Updated dependencies [[`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73), [`723aa54`](https://github.com/mastra-ai/mastra/commit/723aa5437106bdb708ae03c0ef6b77aa11291e73)]:
|
|
19
|
+
- @mastra/core@1.55.0-alpha.3
|
|
20
|
+
|
|
3
21
|
## 1.1.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
1
3
|
# Storing embeddings in a vector database
|
|
2
4
|
|
|
3
|
-
After generating embeddings, you need to store them in a database that supports vector similarity search. Mastra provides a consistent interface for storing and querying embeddings across
|
|
5
|
+
After generating embeddings, you need to store them in a database that supports vector similarity search. Mastra provides a consistent interface for storing and querying embeddings across vector databases.
|
|
4
6
|
|
|
5
7
|
## Supported databases
|
|
6
8
|
|
|
@@ -12,7 +14,7 @@ import { MongoDBVector } from '@mastra/mongodb'
|
|
|
12
14
|
const store = new MongoDBVector({
|
|
13
15
|
id: 'mongodb-vector',
|
|
14
16
|
uri: process.env.MONGODB_URI,
|
|
15
|
-
dbName: process.env.
|
|
17
|
+
dbName: process.env.MONGODB_DB_NAME,
|
|
16
18
|
})
|
|
17
19
|
await store.createIndex({
|
|
18
20
|
indexName: 'myCollection',
|
|
@@ -25,10 +27,31 @@ await store.upsert({
|
|
|
25
27
|
})
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
### Using MongoDB Atlas Vector
|
|
30
|
+
### Using MongoDB Atlas Vector Search
|
|
29
31
|
|
|
30
32
|
For detailed setup instructions and best practices, see the [official MongoDB Atlas Vector Search documentation](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-overview/?utm_campaign=devrel\&utm_source=third-party-content\&utm_medium=cta\&utm_content=mastra-docs).
|
|
31
33
|
|
|
34
|
+
### Using VoyageAI with MongoDB
|
|
35
|
+
|
|
36
|
+
MongoDB works seamlessly with VoyageAI's embedding models, which are optimized for retrieval tasks. For complete examples and specialized models, see the [VoyageAI embeddings documentation](https://mastra.ai/models/embeddings) and [MongoDB vector reference](https://mastra.ai/reference/vectors/mongodb).
|
|
37
|
+
|
|
38
|
+
### Hybrid Search (Vector + Full-Text)
|
|
39
|
+
|
|
40
|
+
MongoDB supports hybrid search that fuses vector similarity with BM25 full-text search using server-side `$rankFusion` (requires MongoDB >= 8.0; generally available from 8.1, and enabled on Atlas 8.0.x). This is useful when you want to combine semantic and keyword-based retrieval:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
await store.createSearchIndex({ indexName: 'myCollection', fields: ['text'] })
|
|
44
|
+
const results = await store.hybridQuery({
|
|
45
|
+
indexName: 'myCollection',
|
|
46
|
+
queryVector: embedding,
|
|
47
|
+
query: 'search terms',
|
|
48
|
+
paths: ['text'],
|
|
49
|
+
topK: 10,
|
|
50
|
+
})
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
See the [MongoDB vector reference](https://mastra.ai/reference/vectors/mongodb) for details on `createSearchIndex()`, `textQuery()`, and `hybridQuery()`.
|
|
54
|
+
|
|
32
55
|
**PgVector**:
|
|
33
56
|
|
|
34
57
|
```ts
|
|
@@ -357,6 +380,7 @@ The dimension size must match the output dimension of your chosen embedding mode
|
|
|
357
380
|
|
|
358
381
|
- `OpenAI text-embedding-3-small`: 1536 dimensions (or custom, e.g., 256)
|
|
359
382
|
- `Cohere embed-multilingual-v3`: 1024 dimensions
|
|
383
|
+
- `VoyageAI voyage-3.5`: 1024 dimensions (or custom: 256, 512, 1024, 2048)
|
|
360
384
|
- `Google gemini-embedding-001`: 768 dimensions (or custom)
|
|
361
385
|
|
|
362
386
|
> **Warning:** Index dimensions can't be changed after creation. To use a different model, delete and recreate the index with the new dimension size.
|
|
@@ -547,7 +571,7 @@ The upsert operation:
|
|
|
547
571
|
|
|
548
572
|
Vector stores support rich metadata (any JSON-serializable fields) for filtering and organization. Since metadata is stored with no fixed schema, use consistent field naming to avoid unexpected query results.
|
|
549
573
|
|
|
550
|
-
> **Warning:** Metadata is
|
|
574
|
+
> **Warning:** Metadata is important for vector storage. Without it, you'd only have numerical embeddings with no way to return the original text or filter results. Always store at least the source text as metadata.
|
|
551
575
|
|
|
552
576
|
```ts
|
|
553
577
|
// Store embeddings with rich metadata for better organization and filtering
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
1
3
|
# Couchbase vector store
|
|
2
4
|
|
|
3
5
|
The `CouchbaseVector` class provides vector search using [Couchbase Vector Search](https://docs.couchbase.com/server/current/vector-search/vector-search.html). It enables efficient similarity search and metadata filtering within your Couchbase collections.
|
|
@@ -73,7 +75,7 @@ const store = new CouchbaseVector({
|
|
|
73
75
|
|
|
74
76
|
Creates a new vector index in Couchbase.
|
|
75
77
|
|
|
76
|
-
> **Note:** Index creation is asynchronous. After calling `createIndex`, allow time (typically 1
|
|
78
|
+
> **Note:** Index creation is asynchronous. After calling `createIndex`, allow time (typically 1 to 5 seconds for small datasets, longer for large ones) before querying. For production, implement polling to check index status rather than using fixed delays.
|
|
77
79
|
|
|
78
80
|
**indexName** (`string`): Name of the index to create
|
|
79
81
|
|
|
@@ -143,7 +145,7 @@ Returns: `Promise<string[]>`
|
|
|
143
145
|
|
|
144
146
|
### `updateVector()`
|
|
145
147
|
|
|
146
|
-
Updates a specific vector entry by its ID with new vector data and/or metadata.
|
|
148
|
+
Updates a specific vector entry by its ID with new vector data and/or metadata. Filter-based updates aren't yet implemented for Couchbase.
|
|
147
149
|
|
|
148
150
|
**indexName** (`string`): Name of the index containing the vector
|
|
149
151
|
|
|
@@ -161,7 +163,7 @@ Deletes a single vector by its ID from the index.
|
|
|
161
163
|
|
|
162
164
|
### `deleteVectors()`
|
|
163
165
|
|
|
164
|
-
Deletes multiple vectors by their IDs.
|
|
166
|
+
Deletes multiple vectors by their IDs. Filter-based deletion isn't yet implemented for Couchbase.
|
|
165
167
|
|
|
166
168
|
**indexName** (`string`): Name of the index containing the vectors to delete
|
|
167
169
|
|
|
@@ -219,7 +221,7 @@ try {
|
|
|
219
221
|
|
|
220
222
|
- Index creation delays may impact immediate querying after creation.
|
|
221
223
|
- No hard enforcement of vector dimension at ingest time (dimension mismatches will error at query time).
|
|
222
|
-
- Vector insertion and index updates are eventually consistent
|
|
224
|
+
- Vector insertion and index updates are eventually consistent. Strong consistency isn't guaranteed immediately after writes.
|
|
223
225
|
|
|
224
226
|
## Related
|
|
225
227
|
|