@mastra/mongodb 1.17.0-alpha.1 → 1.17.0-alpha.3

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 CHANGED
@@ -1,5 +1,35 @@
1
1
  # @mastra/mongodb
2
2
 
3
+ ## 1.17.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed a crash where updating a thread without a title (for example during observational memory buffering) could write a null title and violate the database's not-null constraint when running a newer @mastra/memory against an older storage package. Memory now checks whether the connected storage adapter supports partial thread updates and backfills the existing title for older adapters, so mixed-version deployments keep working. See #21041 for the original title-clobbering fix this makes backward compatible. ([#21257](https://github.com/mastra-ai/mastra/pull/21257))
8
+
9
+ - Storage adapters now declare support for partial thread updates, letting newer @mastra/memory preserve existing thread titles instead of overwriting them, while remaining safe against older versions. ([#21257](https://github.com/mastra-ai/mastra/pull/21257))
10
+
11
+ - Updated dependencies [[`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b)]:
12
+ - @mastra/core@1.58.0-alpha.15
13
+
14
+ ## 1.17.0-alpha.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Fixed generated thread titles being clobbered during a turn ([#21041](https://github.com/mastra-ai/mastra/pull/21041))
19
+
20
+ `updateThread` required both `title` and `metadata`, so callers that only needed to
21
+ change metadata (message persistence, working memory, observational memory, channel
22
+ subscriptions) had to read the thread and pass its title back. When title generation
23
+ finished between that read and the write, the freshly generated title was overwritten
24
+ with the stale one.
25
+
26
+ `title` and `metadata` are now independently optional: omitting one leaves that column
27
+ untouched. Callers that only change metadata no longer send a title, and message
28
+ persistence no longer rewrites a thread row it just read.
29
+
30
+ - Updated dependencies [[`1c75e32`](https://github.com/mastra-ai/mastra/commit/1c75e32f7fc0b9fb6f548b4407feaec8a1440212), [`c47165c`](https://github.com/mastra-ai/mastra/commit/c47165c983c87594c6952f1fd2fa51a90205034c), [`e08e789`](https://github.com/mastra-ai/mastra/commit/e08e789c1bf4cd2fe46363f7a4728536ceccc9bd), [`35cc901`](https://github.com/mastra-ai/mastra/commit/35cc90102cf834a84827acaf9eee0b6d6d1e2a3b), [`a8b4cf0`](https://github.com/mastra-ai/mastra/commit/a8b4cf02823cffebc4751a53337dfacf097c1ae1), [`f33264f`](https://github.com/mastra-ai/mastra/commit/f33264f517ae603279afd5c4251e2b40f6dd3618), [`689f2c4`](https://github.com/mastra-ai/mastra/commit/689f2c4b6c0835fe455702b01d21daa8abcd9331), [`eeae63e`](https://github.com/mastra-ai/mastra/commit/eeae63e7fbe8e1f237adc69bca6e2ac13c5ca907), [`4c186a0`](https://github.com/mastra-ai/mastra/commit/4c186a017275f45e6ed4c09de0f89550e2d09e8c), [`b0fa077`](https://github.com/mastra-ai/mastra/commit/b0fa077bcbc9b08551846fe372a0d3d15b71ed72)]:
31
+ - @mastra/core@1.58.0-alpha.8
32
+
3
33
  ## 1.17.0-alpha.1
4
34
 
5
35
  ### Patch Changes
@@ -3,7 +3,7 @@ name: mastra-mongodb
3
3
  description: Documentation for @mastra/mongodb. Use when working with @mastra/mongodb APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/mongodb"
6
- version: "1.17.0-alpha.1"
6
+ version: "1.17.0-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -20,15 +20,15 @@ Read the individual reference documents for detailed explanations and code examp
20
20
  - [Working memory](references/docs-memory-working-memory.md) - Learn how to configure working memory in Mastra to store persistent user data, preferences.
21
21
  - [Storage overview](references/docs-storage-overview.md) - Configure storage for Mastra to persist runtime state across agents, workflows, observability, evals, schedules, and memory.
22
22
 
23
- ### Guides
23
+ ### Integrations
24
24
 
25
- - [Retrieval, semantic search, reranking](references/guides-rag-retrieval.md) - Guide on retrieval processes in Mastra's RAG systems, including semantic search, filtering, and re-ranking.
26
- - [Storing embeddings in a vector database](references/guides-rag-vector-databases.md) - Guide on vector storage options in Mastra, including embedded and dedicated vector databases for similarity search.
25
+ - [MongoDB](references/integrations-databases-mongodb.md) - Documentation for the MongoDB storage implementation in Mastra.
27
26
 
28
27
  ### Reference
29
28
 
29
+ - [Retrieval, semantic search, reranking](references/reference-rag-retrieval.md) - Guide on retrieval processes in Mastra's RAG systems, including semantic search, filtering, and re-ranking.
30
+ - [Storing embeddings in a vector database](references/reference-rag-vector-databases.md) - Guide on vector storage options in Mastra, including embedded and dedicated vector databases for similarity search.
30
31
  - [Reference: Composite storage](references/reference-storage-composite.md) - Documentation for combining multiple storage backends in Mastra.
31
- - [Reference: MongoDB storage](references/reference-storage-mongodb.md) - Documentation for the MongoDB storage implementation in Mastra.
32
32
  - [Reference: MongoDB vector store](references/reference-vectors-mongodb.md) - Documentation for the MongoDBVector class in Mastra, which provides vector search using MongoDB Atlas and Atlas Vector Search.
33
33
 
34
34
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.17.0-alpha.1",
2
+ "version": "1.17.0-alpha.3",
3
3
  "package": "@mastra/mongodb",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -148,6 +148,7 @@ Each vector store page below includes installation instructions, configuration p
148
148
  - [libSQL](https://mastra.ai/reference/vectors/libsql)
149
149
  - [MongoDB](https://mastra.ai/reference/vectors/mongodb)
150
150
  - [OpenSearch](https://mastra.ai/reference/vectors/opensearch)
151
+ - [OracleDB](https://mastra.ai/reference/vectors/oracledb)
151
152
  - [Pinecone](https://mastra.ai/reference/vectors/pinecone)
152
153
  - [PostgreSQL](https://mastra.ai/reference/vectors/pg)
153
154
  - [Qdrant](https://mastra.ai/reference/vectors/qdrant)
@@ -180,7 +181,7 @@ const agent = new Agent({
180
181
  })
181
182
  ```
182
183
 
183
- > **Note:** `scope: 'resource'` is supported by the LibSQL, PostgreSQL, MongoDB, and Upstash storage adapters.
184
+ > **Note:** `scope: 'resource'` is supported by the LibSQL, OracleDB, PostgreSQL, MongoDB, and Upstash storage adapters.
184
185
 
185
186
  ### Metadata filtering
186
187
 
@@ -129,6 +129,7 @@ Resource-scoped working memory requires specific storage adapters that support t
129
129
 
130
130
  - **libSQL** (`@mastra/libsql`)
131
131
  - **PostgreSQL** (`@mastra/pg`)
132
+ - **OracleDB** (`@mastra/oracledb`)
132
133
  - **Upstash** (`@mastra/upstash`)
133
134
  - **MongoDB** (`@mastra/mongodb`)
134
135
 
@@ -190,18 +190,20 @@ You can also route `observability` to a dedicated analytics backend. See the [ob
190
190
 
191
191
  Each provider page includes installation instructions, configuration parameters, and usage examples:
192
192
 
193
- - [libSQL](https://mastra.ai/reference/storage/libsql)
194
- - [PostgreSQL](https://mastra.ai/reference/storage/postgresql)
195
- - [MongoDB](https://mastra.ai/reference/storage/mongodb)
196
- - [Upstash](https://mastra.ai/reference/storage/upstash)
197
- - [Redis](https://mastra.ai/reference/storage/redis)
198
- - [Cloudflare D1](https://mastra.ai/reference/storage/cloudflare-d1)
199
- - [Cloudflare KV & Durable Objects](https://mastra.ai/reference/storage/cloudflare)
200
- - [Convex](https://mastra.ai/reference/storage/convex)
201
- - [DynamoDB](https://mastra.ai/reference/storage/dynamodb)
202
- - [LanceDB](https://mastra.ai/reference/storage/lance)
203
- - [Microsoft SQL Server](https://mastra.ai/reference/storage/mssql)
204
- - [Google Cloud Spanner](https://mastra.ai/reference/storage/spanner)
193
+ - [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
194
+ - [Cloudflare KV & Durable Objects](https://mastra.ai/integrations/databases/cloudflare-kv)
195
+ - [Convex](https://mastra.ai/integrations/databases/convex)
196
+ - [DynamoDB](https://mastra.ai/integrations/databases/dynamodb)
197
+ - [Google Cloud Spanner](https://mastra.ai/integrations/databases/spanner)
198
+ - [LanceDB](https://mastra.ai/integrations/databases/lancedb)
199
+ - [libSQL](https://mastra.ai/integrations/databases/libsql)
200
+ - [Microsoft SQL Server](https://mastra.ai/integrations/databases/mssql)
201
+ - [MongoDB](https://mastra.ai/integrations/databases/mongodb)
202
+ - [Neon Postgres](https://mastra.ai/integrations/databases/neon)
203
+ - [OracleDB](https://mastra.ai/integrations/databases/oracledb)
204
+ - [PostgreSQL](https://mastra.ai/integrations/databases/postgresql)
205
+ - [Redis](https://mastra.ai/integrations/databases/redis)
206
+ - [Upstash](https://mastra.ai/integrations/databases/upstash)
205
207
 
206
208
  > **Tip:** libSQL is the fastest path for local development because it doesn't require running a separate database server.
207
209
 
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # MongoDB storage
3
+ # MongoDB
4
4
 
5
5
  The MongoDB storage implementation provides a high-capacity storage solution using MongoDB databases with support for both document storage and vector operations.
6
6
 
@@ -436,6 +436,23 @@ export const ragAgent = new Agent({
436
436
  })
437
437
  ```
438
438
 
439
+ **OracleDB**:
440
+
441
+ ```ts
442
+ import { ORACLEDB_PROMPT } from '@mastra/oracledb'
443
+
444
+ export const ragAgent = new Agent({
445
+ id: 'rag-agent',
446
+ name: 'RAG Agent',
447
+ model: 'openai/gpt-5.6-sol',
448
+ instructions: `
449
+ Process queries using the provided context. Structure responses to be concise and relevant.
450
+ ${ORACLEDB_PROMPT}
451
+ `,
452
+ tools: { vectorQueryTool },
453
+ })
454
+ ```
455
+
439
456
  **S3Vectors**:
440
457
 
441
458
  ```ts
@@ -517,4 +534,4 @@ The re-ranked results combine vector similarity with semantic understanding to i
517
534
 
518
535
  For more details about re-ranking, see the [rerank()](https://mastra.ai/reference/rag/rerankWithScorer) method.
519
536
 
520
- For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/guides/rag/graph-rag) documentation.
537
+ For graph-based retrieval that follows connections between chunks, see the [GraphRAG](https://mastra.ai/reference/rag/graph-rag-guide) documentation.
@@ -78,6 +78,35 @@ await store.upsert({
78
78
 
79
79
  PostgreSQL with the pgvector extension is a good solution for teams already using PostgreSQL who want to minimize infrastructure complexity. For detailed setup instructions and best practices, see the [official pgvector repository](https://github.com/pgvector/pgvector).
80
80
 
81
+ **OracleDB**:
82
+
83
+ ```ts
84
+ import { OracleVector } from '@mastra/oracledb'
85
+
86
+ const store = new OracleVector({
87
+ id: 'oracle-vector',
88
+ user: process.env.ORACLE_DATABASE_USER,
89
+ password: process.env.ORACLE_DATABASE_PASSWORD,
90
+ connectString: process.env.ORACLE_DATABASE_CONNECT_STRING,
91
+ })
92
+
93
+ await store.createIndex({
94
+ indexName: 'myCollection',
95
+ dimension: 1536,
96
+ indexConfig: { type: 'none' },
97
+ })
98
+
99
+ await store.upsert({
100
+ indexName: 'myCollection',
101
+ vectors: embeddings,
102
+ metadata: chunks.map(chunk => ({ text: chunk.text })),
103
+ })
104
+ ```
105
+
106
+ ### Using Oracle Database Vector Search
107
+
108
+ OracleDB stores embeddings in native `VECTOR` columns and metadata in Oracle JSON. Exact search is the default; HNSW and IVF indexes can be configured for tuned deployments.
109
+
81
110
  **Pinecone**:
82
111
 
83
112
  ```ts
@@ -378,7 +407,7 @@ await store.createIndex({
378
407
 
379
408
  The dimension size must match the output dimension of your chosen embedding model. Common dimension sizes are:
380
409
 
381
- - `OpenAI text-embedding-3-small`: 1536 dimensions (or custom, e.g., 256)
410
+ - OpenAI `text-embedding-3-small`: 1536 dimensions (or custom, e.g., 256)
382
411
  - `Cohere embed-multilingual-v3`: 1024 dimensions
383
412
  - `VoyageAI voyage-3.5`: 1024 dimensions (or custom: 256, 512, 1024, 2048)
384
413
  - `Google gemini-embedding-001`: 768 dimensions (or custom)
@@ -410,6 +439,18 @@ Index names must:
410
439
  - Example: `my_index_123` is valid
411
440
  - Example: `my-index` is not valid (contains hyphen)
412
441
 
442
+ **OracleDB**:
443
+
444
+ Index names are logical Mastra names. OracleDB maps each logical index to a physical Oracle table internally.
445
+
446
+ Logical index names must:
447
+
448
+ - Be non-empty
449
+ - Be 512 characters or fewer
450
+ - Be stable for the lifetime of the vector index
451
+ - Example: `my_collection_123` is valid
452
+ - Example: `customer-support/docs:v1` is valid and is mapped to a safe Oracle table name
453
+
413
454
  **Pinecone**:
414
455
 
415
456
  Index names must:
@@ -338,7 +338,7 @@ const storage = new MastraCompositeStore({
338
338
 
339
339
  Observability data can quickly overwhelm general-purpose databases in production. A single agent interaction can generate hundreds of spans, and high-traffic applications can produce thousands of traces per day.
340
340
 
341
- **[ClickHouse](https://mastra.ai/reference/storage/clickhouse)** is recommended for production observability because it's optimized for high-volume, write-heavy analytics workloads. Use composite storage to route observability to ClickHouse while keeping other data in your primary database:
341
+ **[ClickHouse](https://mastra.ai/integrations/databases/clickhouse)** is recommended for production observability because it's optimized for high-volume, write-heavy analytics workloads. Use composite storage to route observability to ClickHouse while keeping other data in your primary database:
342
342
 
343
343
  ```typescript
344
344
  import { MastraCompositeStore } from '@mastra/core/storage'
@@ -360,7 +360,7 @@ const storage = new MastraCompositeStore({
360
360
  })
361
361
  ```
362
362
 
363
- > **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for details.
363
+ > **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for details.
364
364
 
365
365
  ### Replicated ClickHouse for multi-replica clusters
366
366
 
@@ -392,6 +392,6 @@ const storage = new MastraCompositeStore({
392
392
  })
393
393
  ```
394
394
 
395
- Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for the full config shape and operator notes.
395
+ Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for the full config shape and operator notes.
396
396
 
397
- > **Info:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
397
+ > **Note:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
package/dist/index.cjs CHANGED
@@ -10,7 +10,7 @@ let _mastra_core_agent = require("@mastra/core/agent");
10
10
  let _mastra_core_evals = require("@mastra/core/evals");
11
11
  let _mastra_core_storage_domains_skills = require("@mastra/core/storage/domains/skills");
12
12
  //#region package.json
13
- var version = "1.17.0-alpha.1";
13
+ var version = "1.17.0-alpha.3";
14
14
  //#endregion
15
15
  //#region src/vector/filter.ts
16
16
  /**
@@ -5202,6 +5202,7 @@ var MongoDBMCPServersStorage = class MongoDBMCPServersStorage extends _mastra_co
5202
5202
  */
5203
5203
  const OM_TABLE = "mastra_observational_memory";
5204
5204
  var MemoryStorageMongoDB = class MemoryStorageMongoDB extends _mastra_core_storage.MemoryStorage {
5205
+ supportsPartialThreadUpdate = true;
5205
5206
  supportsObservationalMemory = true;
5206
5207
  #connector;
5207
5208
  #skipDefaultIndexes;
@@ -6004,7 +6005,7 @@ var MemoryStorageMongoDB = class MemoryStorageMongoDB extends _mastra_core_stora
6004
6005
  const now = /* @__PURE__ */ new Date();
6005
6006
  const updatedThread = {
6006
6007
  ...thread,
6007
- title,
6008
+ title: title ?? thread.title,
6008
6009
  metadata: {
6009
6010
  ...thread.metadata,
6010
6011
  ...metadata
@@ -6013,7 +6014,7 @@ var MemoryStorageMongoDB = class MemoryStorageMongoDB extends _mastra_core_stora
6013
6014
  };
6014
6015
  try {
6015
6016
  await (await this.getCollection(_mastra_core_storage.TABLE_THREADS)).updateOne({ id }, { $set: {
6016
- title,
6017
+ title: updatedThread.title,
6017
6018
  metadata: updatedThread.metadata,
6018
6019
  updatedAt: now
6019
6020
  } });