@mastra/mongodb 1.17.0 → 1.18.0-alpha.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 +32 -0
- package/dist/docs/SKILL.md +2 -2
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-semantic-recall.md +1 -1
- package/dist/docs/references/docs-memory-working-memory.md +3 -3
- package/dist/docs/references/{docs-storage-overview.md → docs-storage.md} +9 -7
- package/dist/docs/references/reference-vectors-mongodb.md +2 -2
- package/dist/index.cjs +808 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +809 -3
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/agents/index.d.ts.map +1 -1
- package/dist/storage/domains/knowledge/index.d.ts +82 -0
- package/dist/storage/domains/knowledge/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +2 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @mastra/mongodb
|
|
2
2
|
|
|
3
|
+
## 1.18.0-alpha.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Added foundational support for an upcoming experimental memory capability across storage, runtime, and developer tooling. ([#19538](https://github.com/mastra-ai/mastra/pull/19538))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`c549e2f`](https://github.com/mastra-ai/mastra/commit/c549e2f40edc1cac5d9e74e82f90da22b48df084), [`c549e2f`](https://github.com/mastra-ai/mastra/commit/c549e2f40edc1cac5d9e74e82f90da22b48df084), [`2ef2f23`](https://github.com/mastra-ai/mastra/commit/2ef2f230a7aed342e7dc3b2000cd42e4c43e08a7), [`5740ec6`](https://github.com/mastra-ai/mastra/commit/5740ec60c760ffdfbfaa59d603d03b847c864e05)]:
|
|
12
|
+
- @mastra/core@1.60.0-alpha.13
|
|
13
|
+
|
|
14
|
+
## 1.17.1-alpha.0
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Added a `durable` option to stored agents so agents created through the Agents API can run with durable execution — no code deployment required. ([#21715](https://github.com/mastra-ai/mastra/pull/21715))
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
await mastraClient.createStoredAgent({
|
|
22
|
+
id: 'helper',
|
|
23
|
+
name: 'Helper',
|
|
24
|
+
instructions: 'You are a helpful assistant.',
|
|
25
|
+
model: { provider: 'openai', name: 'gpt-5' },
|
|
26
|
+
durable: true,
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Pass `true` for defaults, or `{ maxSteps, cleanupTimeoutMs }` to tune the durable loop. Cache and pubsub are inherited from the server's Mastra instance, so configure distributed backends there for durability across replicas. Automatic recovery is still configured in code via `recovery.durableAgents`.
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [[`6223446`](https://github.com/mastra-ai/mastra/commit/6223446ddce6166e96e0ba5e00d628b615dee8ca), [`583e235`](https://github.com/mastra-ai/mastra/commit/583e23519c13af16c1746f9c49722d011216611b), [`a77f8d4`](https://github.com/mastra-ai/mastra/commit/a77f8d4740d2178a74c41e4bf678b4fcd8fa0bb2), [`40d358e`](https://github.com/mastra-ai/mastra/commit/40d358e29d55543803e64b49241122f598ffabc7), [`e80cd7e`](https://github.com/mastra-ai/mastra/commit/e80cd7e7683e7d732e1cc6784bcac1d2640d2ce3), [`20504b2`](https://github.com/mastra-ai/mastra/commit/20504b2ecebd0e077acda3d457ab57480a98ed3e)]:
|
|
33
|
+
- @mastra/core@1.60.0-alpha.11
|
|
34
|
+
|
|
3
35
|
## 1.17.0
|
|
4
36
|
|
|
5
37
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -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.
|
|
6
|
+
version: "1.18.0-alpha.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -18,7 +18,7 @@ Read the individual reference documents for detailed explanations and code examp
|
|
|
18
18
|
|
|
19
19
|
- [Semantic recall](references/docs-memory-semantic-recall.md) - Learn how to use semantic recall in Mastra to retrieve relevant messages from past conversations using vector search and embeddings.
|
|
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
|
-
- [Storage
|
|
21
|
+
- [Storage](references/docs-storage.md) - Configure storage for Mastra to persist runtime state across agents, workflows, observability, evals, schedules, and memory.
|
|
22
22
|
|
|
23
23
|
### Integrations
|
|
24
24
|
|
|
@@ -270,7 +270,7 @@ Supported embedding models:
|
|
|
270
270
|
|
|
271
271
|
- **OpenAI**: `text-embedding-3-small`, `text-embedding-3-large`, `text-embedding-ada-002`
|
|
272
272
|
- **Google**: `gemini-embedding-001`
|
|
273
|
-
- **OpenRouter**: Access embedding models from
|
|
273
|
+
- **OpenRouter**: Access embedding models from multiple providers
|
|
274
274
|
|
|
275
275
|
```ts
|
|
276
276
|
import { Agent } from '@mastra/core/agent'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# Working
|
|
3
|
+
# Working memory
|
|
4
4
|
|
|
5
5
|
While [message history](https://mastra.ai/docs/memory/message-history) and [semantic recall](https://mastra.ai/docs/memory/semantic-recall) help agents remember conversations, working memory allows them to maintain persistent information about users across interactions.
|
|
6
6
|
|
|
@@ -213,7 +213,7 @@ const paragraphMemory = new Memory({
|
|
|
213
213
|
|
|
214
214
|
## Structured working memory
|
|
215
215
|
|
|
216
|
-
Working memory can also be defined using a structured schema instead of a Markdown template.
|
|
216
|
+
Working memory can also be defined using a structured schema instead of a Markdown template. A [Standard JSON Schema](https://standardschema.dev/json-schema) ([Zod](https://zod.dev/), [Valibot](https://valibot.dev/), [ArkType](https://arktype.io/), etc.). When using a schema, the agent will see and update working memory as a JSON object matching your schema.
|
|
217
217
|
|
|
218
218
|
**Requirement:** You must specify either `template` or `schema`, but not both.
|
|
219
219
|
|
|
@@ -400,7 +400,7 @@ const response = await agent.generate('What do you know about me?', {
|
|
|
400
400
|
|
|
401
401
|
## Opt in to state signals (experimental)
|
|
402
402
|
|
|
403
|
-
By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/
|
|
403
|
+
By default, working memory reaches the model as part of the system message. You can opt into delivering it as a [state signal](https://mastra.ai/docs/harness/signals) instead by setting `useStateSignals: true`:
|
|
404
404
|
|
|
405
405
|
```typescript
|
|
406
406
|
const memory = new Memory({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
2
|
|
|
3
|
-
# Storage
|
|
3
|
+
# Storage
|
|
4
4
|
|
|
5
5
|
Storage is the persistence layer for the Mastra runtime. It keeps memory, workflow state, observability data, eval results, schedules, and long-running agent state available after a process restarts.
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Storage powers:
|
|
|
10
10
|
- [Workflows](https://mastra.ai/docs/workflows/overview): Durable snapshots for suspended and resumed workflow runs.
|
|
11
11
|
- [Observability](https://mastra.ai/docs/observability/overview): Traces, spans, metrics, logs, and feedback.
|
|
12
12
|
- [Evals](https://mastra.ai/docs/evals/overview): Scores, datasets, experiments, and evaluation results.
|
|
13
|
-
- [Long-running agents](https://mastra.ai/docs/
|
|
13
|
+
- [Long-running agents](https://mastra.ai/docs/harness/durable-agents): Background tasks, schedules, goals, and thread state.
|
|
14
14
|
|
|
15
15
|
## When to configure storage
|
|
16
16
|
|
|
@@ -188,25 +188,27 @@ You can also route `observability` to a dedicated analytics backend. See the [ob
|
|
|
188
188
|
|
|
189
189
|
## Supported providers
|
|
190
190
|
|
|
191
|
-
Each provider page includes installation instructions, configuration parameters, and usage examples
|
|
191
|
+
Each provider page includes installation instructions, configuration parameters, and usage examples. libSQL is the fastest path for local development because it doesn't require running a separate database server.
|
|
192
192
|
|
|
193
|
+
- [Aurora DSQL](https://mastra.ai/integrations/databases/aurora-dsql)
|
|
194
|
+
- [ClickHouse](https://mastra.ai/integrations/databases/clickhouse)
|
|
193
195
|
- [Cloudflare D1](https://mastra.ai/integrations/databases/cloudflare-d1)
|
|
194
|
-
- [Cloudflare KV
|
|
196
|
+
- [Cloudflare KV](https://mastra.ai/integrations/databases/cloudflare-kv)
|
|
195
197
|
- [Convex](https://mastra.ai/integrations/databases/convex)
|
|
198
|
+
- [DuckDB](https://mastra.ai/integrations/databases/duckdb)
|
|
196
199
|
- [DynamoDB](https://mastra.ai/integrations/databases/dynamodb)
|
|
197
200
|
- [Google Cloud Spanner](https://mastra.ai/integrations/databases/spanner)
|
|
198
201
|
- [LanceDB](https://mastra.ai/integrations/databases/lancedb)
|
|
199
202
|
- [libSQL](https://mastra.ai/integrations/databases/libsql)
|
|
200
|
-
- [
|
|
203
|
+
- [Mastra](https://mastra.ai/docs/mastra-platform/database)
|
|
201
204
|
- [MongoDB](https://mastra.ai/integrations/databases/mongodb)
|
|
205
|
+
- [MSSQL](https://mastra.ai/integrations/databases/mssql)
|
|
202
206
|
- [Neon Postgres](https://mastra.ai/integrations/databases/neon)
|
|
203
207
|
- [OracleDB](https://mastra.ai/integrations/databases/oracledb)
|
|
204
208
|
- [PostgreSQL](https://mastra.ai/integrations/databases/postgresql)
|
|
205
209
|
- [Redis](https://mastra.ai/integrations/databases/redis)
|
|
206
210
|
- [Upstash](https://mastra.ai/integrations/databases/upstash)
|
|
207
211
|
|
|
208
|
-
> **Tip:** libSQL is the fastest path for local development because it doesn't require running a separate database server.
|
|
209
|
-
|
|
210
212
|
## Next steps
|
|
211
213
|
|
|
212
214
|
- [Composite storage](https://mastra.ai/reference/storage/composite)
|
|
@@ -220,7 +220,7 @@ const results = await store.textQuery({
|
|
|
220
220
|
|
|
221
221
|
### `hybridQuery()`
|
|
222
222
|
|
|
223
|
-
Runs a hybrid search that fuses vector similarity and full-text results using MongoDB's server-side `$rankFusion`. It requires MongoDB >= 8.0 and is generally available from 8.1. On 8.0.x, it may
|
|
223
|
+
Runs a hybrid search that fuses vector similarity and full-text results using MongoDB's server-side `$rankFusion`. It requires MongoDB >= 8.0 and is generally available from 8.1. On 8.0.x, it may require a MongoDB support case for enablement. It runs where enabled, including Atlas 8.0.x. A full-text search index must exist: it's auto-created for managed indexes, but for a bring-your-own collection you must call `createSearchIndex()` first (opt-in).
|
|
224
224
|
|
|
225
225
|
**indexName** (`string`): Name of the Mastra index to search
|
|
226
226
|
|
|
@@ -276,7 +276,7 @@ interface IndexStats {
|
|
|
276
276
|
Deletes a vector index. Behavior depends on how the index was created:
|
|
277
277
|
|
|
278
278
|
- **Managed index** (created without `collectionName`): drops the entire collection and all its data.
|
|
279
|
-
- **Bring-your-own index** (created with `collectionName`): drops the Atlas vectorSearch index
|
|
279
|
+
- **Bring-your-own index** (created with `collectionName`): drops the Atlas vectorSearch index. If `createSearchIndex()` provisioned a companion full-text search index, it drops that index too. The caller's operational collection and its documents are preserved. This store never drops a collection it didn't create.
|
|
280
280
|
|
|
281
281
|
The BYO classification is recorded durably when the index is created, so it's applied correctly even by a different process (e.g. an index created by a setup job and later deleted by a long-lived service). Always pass the **logical index name** (the `indexName` used at `createIndex`), not the physical collection name.
|
|
282
282
|
|