@mastra/memory 1.22.0 → 1.22.1-alpha.0
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 +8 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-agents-background-tasks.md +3 -3
- package/dist/docs/references/docs-agents-goals.md +2 -0
- package/dist/docs/references/docs-agents-supervisor-agents.md +1 -0
- package/dist/docs/references/docs-memory-memory-processors.md +2 -0
- package/dist/docs/references/docs-memory-observational-memory.md +4 -0
- package/dist/docs/references/docs-memory-semantic-recall.md +6 -0
- package/dist/docs/references/reference-memory-memory-class.md +1 -0
- package/dist/docs/references/reference-memory-observational-memory.md +8 -0
- package/dist/docs/references/reference-processors-token-limiter-processor.md +3 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 1.22.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`cc440a3`](https://github.com/mastra-ai/mastra/commit/cc440a39400d8ce06655462b26c1666a1b3d4320), [`ea6327b`](https://github.com/mastra-ai/mastra/commit/ea6327ba2d63ca647804bc97b347e03a58617162), [`3439fa8`](https://github.com/mastra-ai/mastra/commit/3439fa836ecfcaa257b40c20b30ac2a8be22e9ea), [`85107f2`](https://github.com/mastra-ai/mastra/commit/85107f2758b527147fccbedff962961927c2d3b8), [`1042cb4`](https://github.com/mastra-ai/mastra/commit/1042cb4da227c0a1315a6362262be3058866c5f8), [`06ff9e0`](https://github.com/mastra-ai/mastra/commit/06ff9e0befd1d642ab87ff749285ee4091205c7e), [`7f5e1ff`](https://github.com/mastra-ai/mastra/commit/7f5e1ff695a92f672bb3976363925d1e9136b54a), [`b8375c1`](https://github.com/mastra-ai/mastra/commit/b8375c1f8fe905df8ae2ae9a893bb365f17aec4e), [`003f35d`](https://github.com/mastra-ai/mastra/commit/003f35d19e07b23b4bacc591c8bc0c59b42124ae)]:
|
|
8
|
+
- @mastra/core@1.49.0-alpha.1
|
|
9
|
+
- @mastra/schema-compat@1.3.3-alpha.0
|
|
10
|
+
|
|
3
11
|
## 1.22.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Added in:** `@mastra/core@1.29.0`
|
|
4
4
|
|
|
5
|
-
Background tasks let an agent dispatch a long-running tool call without blocking the agentic loop. The tool returns an immediate acknowledgement, the LLM continues responding, and the task runs to completion in the background. When it finishes, its result is written to memory and if you use `stream()` with the [`untilIdle`](https://mastra.ai/reference/agents/
|
|
5
|
+
Background tasks let an agent dispatch a long-running tool call without blocking the agentic loop. The tool returns an immediate acknowledgement, the LLM continues responding, and the task runs to completion in the background. When it finishes, its result is written to memory and if you use `stream()` with the [`untilIdle`](https://mastra.ai/reference/streaming/agents/stream) option the agent is re-invoked automatically so the result is processed in the same call.
|
|
6
6
|
|
|
7
7
|
## When to use background tasks
|
|
8
8
|
|
|
@@ -166,7 +166,7 @@ const stream = await agent.stream('Research solana for me', {
|
|
|
166
166
|
})
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
> **Note:** Visit [`Agent.stream()`](https://mastra.ai/reference/agents/
|
|
169
|
+
> **Note:** Visit [`Agent.stream()`](https://mastra.ai/reference/streaming/agents/stream) for the full API.
|
|
170
170
|
|
|
171
171
|
### Aggregate properties
|
|
172
172
|
|
|
@@ -372,7 +372,7 @@ These read from storage rather than the pubsub stream, so they're suitable for p
|
|
|
372
372
|
|
|
373
373
|
## Related
|
|
374
374
|
|
|
375
|
-
- [`Agent.stream()` reference](https://mastra.ai/reference/agents/
|
|
375
|
+
- [`Agent.stream()` reference](https://mastra.ai/reference/streaming/agents/stream)
|
|
376
376
|
- [backgroundTasks configuration reference](https://mastra.ai/reference/configuration)
|
|
377
377
|
- [Durable agents](https://mastra.ai/docs/agents/durable-agents)
|
|
378
378
|
- [Supervisor agents](https://mastra.ai/docs/agents/supervisor-agents)
|
|
@@ -26,6 +26,7 @@ Goals require a configured [storage](https://mastra.ai/docs/memory/storage) back
|
|
|
26
26
|
import { Agent } from '@mastra/core/agent'
|
|
27
27
|
|
|
28
28
|
const worker = new Agent({
|
|
29
|
+
id: 'worker',
|
|
29
30
|
name: 'worker',
|
|
30
31
|
instructions: 'You complete software tasks end to end.',
|
|
31
32
|
model: 'openai/gpt-5.5',
|
|
@@ -66,6 +67,7 @@ By default the step uses a built-in LLM-as-judge scorer that returns `1` when th
|
|
|
66
67
|
|
|
67
68
|
```typescript
|
|
68
69
|
const worker = new Agent({
|
|
70
|
+
id: 'worker',
|
|
69
71
|
name: 'worker',
|
|
70
72
|
instructions: 'You complete software tasks end to end.',
|
|
71
73
|
model: 'openai/gpt-5.5',
|
|
@@ -248,6 +248,7 @@ const contentBlocker = {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
const agent = new Agent({
|
|
251
|
+
id: 'safe-agent',
|
|
251
252
|
name: 'safe-agent',
|
|
252
253
|
instructions: 'You are a helpful assistant',
|
|
253
254
|
model: 'openai/gpt-5.5',
|
|
@@ -287,6 +288,7 @@ const inputValidator = {
|
|
|
287
288
|
}
|
|
288
289
|
|
|
289
290
|
const agent = new Agent({
|
|
291
|
+
id: 'validated-agent',
|
|
290
292
|
name: 'validated-agent',
|
|
291
293
|
instructions: 'You are a helpful assistant',
|
|
292
294
|
model: 'openai/gpt-5.5',
|
|
@@ -13,6 +13,7 @@ import { Memory } from '@mastra/memory'
|
|
|
13
13
|
import { Agent } from '@mastra/core/agent'
|
|
14
14
|
|
|
15
15
|
export const agent = new Agent({
|
|
16
|
+
id: 'my-agent',
|
|
16
17
|
name: 'my-agent',
|
|
17
18
|
instructions: 'You are a helpful assistant.',
|
|
18
19
|
model: 'openai/gpt-5-mini',
|
|
@@ -57,6 +58,7 @@ import { Memory } from '@mastra/memory'
|
|
|
57
58
|
import { Agent } from '@mastra/core/agent'
|
|
58
59
|
|
|
59
60
|
export const agent = new Agent({
|
|
61
|
+
id: 'my-agent',
|
|
60
62
|
name: 'my-agent',
|
|
61
63
|
instructions: 'You are a helpful assistant.',
|
|
62
64
|
model: 'openai/gpt-5-mini',
|
|
@@ -196,6 +198,7 @@ const memory = new Memory({
|
|
|
196
198
|
})
|
|
197
199
|
|
|
198
200
|
export const agent = new Agent({
|
|
201
|
+
id: 'assistant',
|
|
199
202
|
name: 'assistant',
|
|
200
203
|
instructions: 'You are a helpful assistant.',
|
|
201
204
|
model: 'openai/gpt-5-mini',
|
|
@@ -281,6 +284,7 @@ If your Observer model is text-only or its API rejects multimodal input, set `ob
|
|
|
281
284
|
|
|
282
285
|
```typescript
|
|
283
286
|
new Agent({
|
|
287
|
+
id: 'assistant',
|
|
284
288
|
name: 'assistant',
|
|
285
289
|
instructions: 'You are a helpful assistant.',
|
|
286
290
|
model: 'openai/gpt-5-mini',
|
|
@@ -130,6 +130,7 @@ The following options control semantic recall behavior:
|
|
|
130
130
|
|
|
131
131
|
```typescript
|
|
132
132
|
const agent = new Agent({
|
|
133
|
+
id: 'agent',
|
|
133
134
|
memory: new Memory({
|
|
134
135
|
options: {
|
|
135
136
|
semanticRecall: {
|
|
@@ -151,6 +152,7 @@ The `filter` option restricts semantic recall results to messages with matching
|
|
|
151
152
|
|
|
152
153
|
```typescript
|
|
153
154
|
const agent = new Agent({
|
|
155
|
+
id: 'agent',
|
|
154
156
|
memory: new Memory({
|
|
155
157
|
options: {
|
|
156
158
|
semanticRecall: {
|
|
@@ -217,6 +219,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
217
219
|
import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
|
|
218
220
|
|
|
219
221
|
const agent = new Agent({
|
|
222
|
+
id: 'agent',
|
|
220
223
|
memory: new Memory({
|
|
221
224
|
embedder: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
|
|
222
225
|
options: {
|
|
@@ -238,6 +241,7 @@ import { Memory } from '@mastra/memory'
|
|
|
238
241
|
import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
|
|
239
242
|
|
|
240
243
|
const agent = new Agent({
|
|
244
|
+
id: 'agent',
|
|
241
245
|
memory: new Memory({
|
|
242
246
|
embedder: new ModelRouterEmbeddingModel({
|
|
243
247
|
providerId: 'openrouter',
|
|
@@ -259,6 +263,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
259
263
|
import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
|
|
260
264
|
|
|
261
265
|
const agent = new Agent({
|
|
266
|
+
id: 'agent',
|
|
262
267
|
memory: new Memory({
|
|
263
268
|
embedder: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
|
|
264
269
|
}),
|
|
@@ -301,6 +306,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
301
306
|
import { fastembed } from '@mastra/fastembed'
|
|
302
307
|
|
|
303
308
|
const agent = new Agent({
|
|
309
|
+
id: 'agent',
|
|
304
310
|
memory: new Memory({
|
|
305
311
|
embedder: fastembed,
|
|
306
312
|
}),
|
|
@@ -11,6 +11,7 @@ import { Memory } from '@mastra/memory'
|
|
|
11
11
|
import { Agent } from '@mastra/core/agent'
|
|
12
12
|
|
|
13
13
|
export const agent = new Agent({
|
|
14
|
+
id: 'my-agent',
|
|
14
15
|
name: 'my-agent',
|
|
15
16
|
instructions: 'You are a helpful assistant.',
|
|
16
17
|
model: 'openai/gpt-5-mini',
|
|
@@ -203,6 +204,7 @@ import { Memory } from '@mastra/memory'
|
|
|
203
204
|
import { Agent } from '@mastra/core/agent'
|
|
204
205
|
|
|
205
206
|
export const agent = new Agent({
|
|
207
|
+
id: 'my-agent',
|
|
206
208
|
name: 'my-agent',
|
|
207
209
|
instructions: 'You are a helpful assistant.',
|
|
208
210
|
model: 'openai/gpt-5-mini',
|
|
@@ -232,6 +234,7 @@ import { Memory } from '@mastra/memory'
|
|
|
232
234
|
import { Agent } from '@mastra/core/agent'
|
|
233
235
|
|
|
234
236
|
export const agent = new Agent({
|
|
237
|
+
id: 'my-agent',
|
|
235
238
|
name: 'my-agent',
|
|
236
239
|
instructions: 'You are a helpful assistant.',
|
|
237
240
|
model: 'openai/gpt-5-mini',
|
|
@@ -261,6 +264,7 @@ import { Memory } from '@mastra/memory'
|
|
|
261
264
|
import { Agent } from '@mastra/core/agent'
|
|
262
265
|
|
|
263
266
|
export const agent = new Agent({
|
|
267
|
+
id: 'my-agent',
|
|
264
268
|
name: 'my-agent',
|
|
265
269
|
instructions: 'You are a helpful assistant.',
|
|
266
270
|
model: 'openai/gpt-5.5',
|
|
@@ -281,6 +285,7 @@ import { Memory } from '@mastra/memory'
|
|
|
281
285
|
import { Agent } from '@mastra/core/agent'
|
|
282
286
|
|
|
283
287
|
export const agent = new Agent({
|
|
288
|
+
id: 'my-agent',
|
|
284
289
|
name: 'my-agent',
|
|
285
290
|
instructions: 'You are a helpful assistant.',
|
|
286
291
|
model: 'openai/gpt-5.5',
|
|
@@ -308,6 +313,7 @@ import { Memory } from '@mastra/memory'
|
|
|
308
313
|
import { Agent } from '@mastra/core/agent'
|
|
309
314
|
|
|
310
315
|
export const agent = new Agent({
|
|
316
|
+
id: 'health-assistant',
|
|
311
317
|
name: 'health-assistant',
|
|
312
318
|
instructions: 'You are a health and wellness assistant.',
|
|
313
319
|
model: 'openai/gpt-5.5',
|
|
@@ -351,6 +357,7 @@ import { Memory } from '@mastra/memory'
|
|
|
351
357
|
import { Agent } from '@mastra/core/agent'
|
|
352
358
|
|
|
353
359
|
export const agent = new Agent({
|
|
360
|
+
id: 'my-agent',
|
|
354
361
|
name: 'my-agent',
|
|
355
362
|
instructions: 'You are a helpful assistant.',
|
|
356
363
|
model: 'openai/gpt-5-mini',
|
|
@@ -666,6 +673,7 @@ const om = new ObservationalMemory({
|
|
|
666
673
|
})
|
|
667
674
|
|
|
668
675
|
export const agent = new Agent({
|
|
676
|
+
id: 'my-agent',
|
|
669
677
|
name: 'my-agent',
|
|
670
678
|
instructions: 'You are a helpful assistant.',
|
|
671
679
|
model: 'openai/gpt-5-mini',
|
|
@@ -79,6 +79,7 @@ import { Memory } from '@mastra/memory'
|
|
|
79
79
|
import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
80
80
|
|
|
81
81
|
export const agent = new Agent({
|
|
82
|
+
id: 'context-limited-agent',
|
|
82
83
|
name: 'context-limited-agent',
|
|
83
84
|
instructions: 'You are a helpful assistant',
|
|
84
85
|
model: 'openai/gpt-5.5',
|
|
@@ -100,6 +101,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
100
101
|
import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
101
102
|
|
|
102
103
|
export const agent = new Agent({
|
|
104
|
+
id: 'multi-step-agent',
|
|
103
105
|
name: 'multi-step-agent',
|
|
104
106
|
instructions: 'You are a helpful research assistant with access to tools',
|
|
105
107
|
model: 'openai/gpt-5.5',
|
|
@@ -123,6 +125,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
123
125
|
import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
124
126
|
|
|
125
127
|
export const agent = new Agent({
|
|
128
|
+
id: 'response-limited-agent',
|
|
126
129
|
name: 'response-limited-agent',
|
|
127
130
|
instructions: 'You are a helpful assistant',
|
|
128
131
|
model: 'openai/gpt-5.5',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/memory",
|
|
3
|
-
"version": "1.22.0",
|
|
3
|
+
"version": "1.22.1-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"tokenx": "^1.3.0",
|
|
46
46
|
"xxhash-wasm": "^1.1.0",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@mastra/schema-compat": "1.3.
|
|
48
|
+
"@mastra/schema-compat": "1.3.3-alpha.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@ai-sdk/openai": "^1.3.24",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"typescript": "^6.0.3",
|
|
62
62
|
"typescript-eslint": "^8.57.0",
|
|
63
63
|
"vitest": "4.1.8",
|
|
64
|
+
"@internal/ai-sdk-v5": "0.0.57",
|
|
65
|
+
"@internal/ai-sdk-v4": "0.0.57",
|
|
64
66
|
"@internal/ai-v6": "0.0.57",
|
|
65
67
|
"@internal/lint": "0.0.110",
|
|
66
|
-
"@mastra/core": "1.48.0",
|
|
67
68
|
"@internal/types-builder": "0.0.85",
|
|
68
|
-
"@
|
|
69
|
-
"@internal/ai-sdk-v5": "0.0.57"
|
|
69
|
+
"@mastra/core": "1.49.0-alpha.1"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"@mastra/core": ">=1.4.1-0 <2.0.0-0"
|