@mastra/memory 1.20.1-alpha.0 → 1.20.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 +34 -0
- package/dist/_types/@internal_ai-sdk-v4/dist/index.d.ts +2 -160
- package/dist/{chunk-LXU26UVM.js → chunk-KMJQDCCZ.js} +128 -12
- package/dist/{chunk-LXU26UVM.js.map → chunk-KMJQDCCZ.js.map} +1 -1
- package/dist/{chunk-R2H7SJS2.cjs → chunk-P4BYW7GY.cjs} +127 -11
- package/dist/chunk-P4BYW7GY.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +28 -28
- package/dist/docs/references/docs-agents-agent-approval.md +15 -1
- package/dist/docs/references/docs-agents-background-tasks.md +2 -2
- package/dist/docs/references/docs-agents-networks.md +1 -1
- package/dist/docs/references/docs-agents-supervisor-agents.md +2 -2
- package/dist/docs/references/docs-memory-memory-processors.md +6 -6
- package/dist/docs/references/docs-memory-multi-user-threads.md +1 -1
- package/dist/docs/references/docs-memory-semantic-recall.md +2 -2
- package/dist/docs/references/docs-memory-storage.md +2 -1
- package/dist/docs/references/docs-memory-working-memory.md +1 -1
- package/dist/docs/references/reference-memory-memory-class.md +3 -3
- package/dist/docs/references/reference-memory-observational-memory.md +4 -4
- package/dist/docs/references/reference-processors-token-limiter-processor.md +3 -3
- package/dist/docs/references/reference-storage-dsql.md +1 -1
- package/dist/docs/references/reference-storage-mongodb.md +1 -1
- package/dist/docs/references/reference-storage-postgresql.md +1 -1
- package/dist/docs/references/reference-storage-redis.md +1 -1
- package/dist/docs/references/reference-storage-upstash.md +1 -1
- package/dist/docs/references/reference-vectors-libsql.md +1 -1
- package/dist/docs/references/reference-vectors-mongodb.md +1 -1
- package/dist/docs/references/reference-vectors-pg.md +3 -1
- package/dist/docs/references/reference-vectors-upstash.md +1 -1
- package/dist/index.cjs +198 -203
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +189 -194
- package/dist/index.js.map +1 -1
- package/dist/{observational-memory-L32TPJ5J.cjs → observational-memory-CDLGZL67.cjs} +26 -26
- package/dist/{observational-memory-L32TPJ5J.cjs.map → observational-memory-CDLGZL67.cjs.map} +1 -1
- package/dist/{observational-memory-GE5MP6W7.js → observational-memory-TJFOX3YN.js} +3 -3
- package/dist/{observational-memory-GE5MP6W7.js.map → observational-memory-TJFOX3YN.js.map} +1 -1
- package/dist/processors/index.cjs +24 -24
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/temporal-markers.d.ts.map +1 -1
- package/dist/processors/observational-memory/token-counter.d.ts +1 -0
- package/dist/processors/observational-memory/token-counter.d.ts.map +1 -1
- package/dist/tools/working-memory.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/chunk-R2H7SJS2.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.20.1
|
|
2
|
+
"version": "1.20.1",
|
|
3
3
|
"package": "@mastra/memory",
|
|
4
4
|
"exports": {
|
|
5
5
|
"ModelByInputTokens": {
|
|
6
6
|
"types": "dist/processors/index.d.ts",
|
|
7
|
-
"implementation": "dist/chunk-
|
|
7
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
8
8
|
"line": 787
|
|
9
9
|
},
|
|
10
10
|
"OBSERVER_SYSTEM_PROMPT": {
|
|
11
11
|
"types": "dist/processors/index.d.ts",
|
|
12
|
-
"implementation": "dist/chunk-
|
|
12
|
+
"implementation": "dist/chunk-KMJQDCCZ.js"
|
|
13
13
|
},
|
|
14
14
|
"ObservationalMemory": {
|
|
15
15
|
"types": "dist/processors/index.d.ts",
|
|
16
|
-
"implementation": "dist/chunk-
|
|
17
|
-
"line":
|
|
16
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
17
|
+
"line": 7175
|
|
18
18
|
},
|
|
19
19
|
"ObservationalMemoryProcessor": {
|
|
20
20
|
"types": "dist/processors/index.d.ts",
|
|
21
|
-
"implementation": "dist/chunk-
|
|
22
|
-
"line":
|
|
21
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
22
|
+
"line": 9747
|
|
23
23
|
},
|
|
24
24
|
"TokenCounter": {
|
|
25
25
|
"types": "dist/processors/index.d.ts",
|
|
26
|
-
"implementation": "dist/chunk-
|
|
26
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
27
27
|
"line": 6506
|
|
28
28
|
},
|
|
29
29
|
"buildObserverPrompt": {
|
|
30
30
|
"types": "dist/processors/index.d.ts",
|
|
31
|
-
"implementation": "dist/chunk-
|
|
31
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
32
32
|
"line": 3774
|
|
33
33
|
},
|
|
34
34
|
"buildObserverSystemPrompt": {
|
|
35
35
|
"types": "dist/processors/index.d.ts",
|
|
36
|
-
"implementation": "dist/chunk-
|
|
36
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
37
37
|
"line": 3045
|
|
38
38
|
},
|
|
39
39
|
"combineObservationGroupRanges": {
|
|
40
40
|
"types": "dist/processors/index.d.ts",
|
|
41
|
-
"implementation": "dist/chunk-
|
|
41
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
42
42
|
"line": 879
|
|
43
43
|
},
|
|
44
44
|
"deriveObservationGroupProvenance": {
|
|
45
45
|
"types": "dist/processors/index.d.ts",
|
|
46
|
-
"implementation": "dist/chunk-
|
|
46
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
47
47
|
"line": 913
|
|
48
48
|
},
|
|
49
49
|
"extractCurrentTask": {
|
|
50
50
|
"types": "dist/processors/index.d.ts",
|
|
51
|
-
"implementation": "dist/chunk-
|
|
51
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
52
52
|
"line": 3888
|
|
53
53
|
},
|
|
54
54
|
"formatMessagesForObserver": {
|
|
55
55
|
"types": "dist/processors/index.d.ts",
|
|
56
|
-
"implementation": "dist/chunk-
|
|
56
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
57
57
|
"line": 3500
|
|
58
58
|
},
|
|
59
59
|
"getObservationsAsOf": {
|
|
60
60
|
"types": "dist/processors/index.d.ts",
|
|
61
|
-
"implementation": "dist/chunk-
|
|
62
|
-
"line":
|
|
61
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
62
|
+
"line": 9960
|
|
63
63
|
},
|
|
64
64
|
"hasCurrentTaskSection": {
|
|
65
65
|
"types": "dist/processors/index.d.ts",
|
|
66
|
-
"implementation": "dist/chunk-
|
|
66
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
67
67
|
"line": 3876
|
|
68
68
|
},
|
|
69
69
|
"injectAnchorIds": {
|
|
70
70
|
"types": "dist/processors/index.d.ts",
|
|
71
|
-
"implementation": "dist/chunk-
|
|
71
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
72
72
|
"line": 2593
|
|
73
73
|
},
|
|
74
74
|
"optimizeObservationsForContext": {
|
|
75
75
|
"types": "dist/processors/index.d.ts",
|
|
76
|
-
"implementation": "dist/chunk-
|
|
76
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
77
77
|
"line": 3899
|
|
78
78
|
},
|
|
79
79
|
"parseAnchorId": {
|
|
80
80
|
"types": "dist/processors/index.d.ts",
|
|
81
|
-
"implementation": "dist/chunk-
|
|
81
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
82
82
|
"line": 2566
|
|
83
83
|
},
|
|
84
84
|
"parseObservationGroups": {
|
|
85
85
|
"types": "dist/processors/index.d.ts",
|
|
86
|
-
"implementation": "dist/chunk-
|
|
86
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
87
87
|
"line": 848
|
|
88
88
|
},
|
|
89
89
|
"parseObserverOutput": {
|
|
90
90
|
"types": "dist/processors/index.d.ts",
|
|
91
|
-
"implementation": "dist/chunk-
|
|
91
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
92
92
|
"line": 3784
|
|
93
93
|
},
|
|
94
94
|
"reconcileObservationGroupsFromReflection": {
|
|
95
95
|
"types": "dist/processors/index.d.ts",
|
|
96
|
-
"implementation": "dist/chunk-
|
|
96
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
97
97
|
"line": 937
|
|
98
98
|
},
|
|
99
99
|
"renderObservationGroupsForReflection": {
|
|
100
100
|
"types": "dist/processors/index.d.ts",
|
|
101
|
-
"implementation": "dist/chunk-
|
|
101
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
102
102
|
"line": 893
|
|
103
103
|
},
|
|
104
104
|
"stripEphemeralAnchorIds": {
|
|
105
105
|
"types": "dist/processors/index.d.ts",
|
|
106
|
-
"implementation": "dist/chunk-
|
|
106
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
107
107
|
"line": 2623
|
|
108
108
|
},
|
|
109
109
|
"stripObservationGroups": {
|
|
110
110
|
"types": "dist/processors/index.d.ts",
|
|
111
|
-
"implementation": "dist/chunk-
|
|
111
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
112
112
|
"line": 870
|
|
113
113
|
},
|
|
114
114
|
"wrapInObservationGroup": {
|
|
115
115
|
"types": "dist/processors/index.d.ts",
|
|
116
|
-
"implementation": "dist/chunk-
|
|
116
|
+
"implementation": "dist/chunk-KMJQDCCZ.js",
|
|
117
117
|
"line": 841
|
|
118
118
|
},
|
|
119
119
|
"OBSERVATIONAL_MEMORY_DEFAULTS": {
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"processors": {
|
|
150
150
|
"index": "dist/processors/index.js",
|
|
151
151
|
"chunks": [
|
|
152
|
-
"chunk-
|
|
152
|
+
"chunk-KMJQDCCZ.js",
|
|
153
153
|
"chunk-VKRZ3O5X.js"
|
|
154
154
|
]
|
|
155
155
|
}
|
|
@@ -86,6 +86,20 @@ for await (const chunk of stream.fullStream) {
|
|
|
86
86
|
}
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
+
#### Conditional approval with a function
|
|
90
|
+
|
|
91
|
+
Instead of a boolean, `requireToolApproval` accepts a function that decides per tool call. It receives the `toolName`, the `args` the model passed, the `requestContext`, and the `workspace`. Return `true` to require approval for that call, or `false` to allow it. This lets you gate approval dynamically — for example, only for tools whose name matches a pattern:
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
const stream = await agent.stream('Clean up old records', {
|
|
95
|
+
requireToolApproval: ({ toolName }) => /^delete_/.test(toolName),
|
|
96
|
+
})
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
A tool's own `requireApproval` setting still takes precedence: if a tool defines its own approval rule, that rule decides for that tool and the function above does not override it. If the function throws, the call requires approval (fail-safe).
|
|
100
|
+
|
|
101
|
+
> **Note:** Function-based `requireToolApproval` is only available on regular `stream()` / `generate()` calls. Durable agents and stored agents persist their options, and a function can't be serialized, so they accept only a boolean. If you pass a function in those contexts it falls back to requiring approval for every tool call.
|
|
102
|
+
|
|
89
103
|
### Runtime suspension with `suspend()`
|
|
90
104
|
|
|
91
105
|
A tool can also pause _during_ its `execute` function by calling `suspend()`. This is useful when the tool starts running and then discovers it needs additional user input or confirmation before it can finish.
|
|
@@ -398,7 +412,7 @@ const supervisorAgent = new Agent({
|
|
|
398
412
|
name: 'Supervisor Agent',
|
|
399
413
|
instructions: `You coordinate data retrieval tasks.
|
|
400
414
|
Delegate to data-agent for user lookups.`,
|
|
401
|
-
model: 'openai/gpt-5.
|
|
415
|
+
model: 'openai/gpt-5.5',
|
|
402
416
|
agents: { dataAgent },
|
|
403
417
|
memory: new Memory(),
|
|
404
418
|
})
|
|
@@ -80,7 +80,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
80
80
|
export const researcher = new Agent({
|
|
81
81
|
id: 'researcher',
|
|
82
82
|
instructions: 'You research topics and answer questions.',
|
|
83
|
-
model: 'openai/gpt-5.
|
|
83
|
+
model: 'openai/gpt-5.5',
|
|
84
84
|
tools: { researchTool, summarizeTool },
|
|
85
85
|
backgroundTasks: {
|
|
86
86
|
tools: {
|
|
@@ -175,7 +175,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
175
175
|
const supervisor = new Agent({
|
|
176
176
|
id: 'supervisor',
|
|
177
177
|
instructions: 'Coordinate research and writing using the available agents.',
|
|
178
|
-
model: 'openai/gpt-5.
|
|
178
|
+
model: 'openai/gpt-5.5',
|
|
179
179
|
agents: { researchAgent, writingAgent },
|
|
180
180
|
backgroundTasks: {
|
|
181
181
|
tools: {
|
|
@@ -27,7 +27,7 @@ export const routingAgent = new Agent({
|
|
|
27
27
|
name: 'Routing Agent',
|
|
28
28
|
instructions: `
|
|
29
29
|
You are a network of writers and researchers. The user will ask you to research a topic. Always respond with a complete report—no bullet points. Write in full paragraphs, like a blog post. Do not answer with incomplete or uncertain information.`,
|
|
30
|
-
model: 'openai/gpt-5.
|
|
30
|
+
model: 'openai/gpt-5.5',
|
|
31
31
|
agents: {
|
|
32
32
|
researchAgent,
|
|
33
33
|
writingAgent,
|
|
@@ -41,7 +41,7 @@ const supervisor = new Agent({
|
|
|
41
41
|
id: 'supervisor',
|
|
42
42
|
instructions: `You coordinate research and writing using specialized agents.
|
|
43
43
|
Delegate to research-agent for facts, then writing-agent for content.`,
|
|
44
|
-
model: 'openai/gpt-5.
|
|
44
|
+
model: 'openai/gpt-5.5',
|
|
45
45
|
agents: { researchAgent, writingAgent },
|
|
46
46
|
memory: new Memory({
|
|
47
47
|
storage: new LibSQLStore({ id: 'storage', url: 'file:mastra.db' }),
|
|
@@ -326,7 +326,7 @@ Enable the [backgroundTasks manager](https://mastra.ai/reference/configuration)
|
|
|
326
326
|
const supervisor = new Agent({
|
|
327
327
|
id: 'supervisor',
|
|
328
328
|
instructions: 'Coordinate research and writing using the available agents.',
|
|
329
|
-
model: 'openai/gpt-5.
|
|
329
|
+
model: 'openai/gpt-5.5',
|
|
330
330
|
agents: { researchAgent, writingAgent },
|
|
331
331
|
backgroundTasks: {
|
|
332
332
|
tools: {
|
|
@@ -45,7 +45,7 @@ const agent = new Agent({
|
|
|
45
45
|
id: 'test-agent',
|
|
46
46
|
name: 'Test Agent',
|
|
47
47
|
instructions: 'You are a helpful assistant',
|
|
48
|
-
model: 'openai/gpt-5.
|
|
48
|
+
model: 'openai/gpt-5.5',
|
|
49
49
|
memory: new Memory({
|
|
50
50
|
storage: new LibSQLStore({
|
|
51
51
|
id: 'memory-store',
|
|
@@ -95,7 +95,7 @@ import { openai } from '@ai-sdk/openai'
|
|
|
95
95
|
const agent = new Agent({
|
|
96
96
|
name: 'semantic-agent',
|
|
97
97
|
instructions: 'You are a helpful assistant with semantic memory',
|
|
98
|
-
model: 'openai/gpt-5.
|
|
98
|
+
model: 'openai/gpt-5.5',
|
|
99
99
|
memory: new Memory({
|
|
100
100
|
storage: new LibSQLStore({
|
|
101
101
|
id: 'memory-store',
|
|
@@ -148,7 +148,7 @@ import { openai } from '@ai-sdk/openai'
|
|
|
148
148
|
const agent = new Agent({
|
|
149
149
|
name: 'working-memory-agent',
|
|
150
150
|
instructions: 'You are an assistant with working memory',
|
|
151
|
-
model: 'openai/gpt-5.
|
|
151
|
+
model: 'openai/gpt-5.5',
|
|
152
152
|
memory: new Memory({
|
|
153
153
|
storage: new LibSQLStore({
|
|
154
154
|
id: 'memory-store',
|
|
@@ -180,7 +180,7 @@ const customMessageHistory = new MessageHistory({
|
|
|
180
180
|
const agent = new Agent({
|
|
181
181
|
name: 'custom-memory-agent',
|
|
182
182
|
instructions: 'You are a helpful assistant',
|
|
183
|
-
model: 'openai/gpt-5.
|
|
183
|
+
model: 'openai/gpt-5.5',
|
|
184
184
|
memory: new Memory({
|
|
185
185
|
storage: new LibSQLStore({ id: 'memory-store', url: 'file:memory.db' }),
|
|
186
186
|
lastMessages: 10, // This would normally add MessageHistory(10)
|
|
@@ -250,7 +250,7 @@ const contentBlocker = {
|
|
|
250
250
|
const agent = new Agent({
|
|
251
251
|
name: 'safe-agent',
|
|
252
252
|
instructions: 'You are a helpful assistant',
|
|
253
|
-
model: 'openai/gpt-5.
|
|
253
|
+
model: 'openai/gpt-5.5',
|
|
254
254
|
memory: new Memory({ lastMessages: 10 }),
|
|
255
255
|
// Your guardrail runs BEFORE memory saves
|
|
256
256
|
outputProcessors: [contentBlocker],
|
|
@@ -289,7 +289,7 @@ const inputValidator = {
|
|
|
289
289
|
const agent = new Agent({
|
|
290
290
|
name: 'validated-agent',
|
|
291
291
|
instructions: 'You are a helpful assistant',
|
|
292
|
-
model: 'openai/gpt-5.
|
|
292
|
+
model: 'openai/gpt-5.5',
|
|
293
293
|
memory: new Memory({ lastMessages: 10 }),
|
|
294
294
|
// Your guardrail runs AFTER memory loads history
|
|
295
295
|
inputProcessors: [inputValidator],
|
|
@@ -65,7 +65,7 @@ const memory = new Memory({
|
|
|
65
65
|
export const collabAgent = new Agent({
|
|
66
66
|
id: 'collab',
|
|
67
67
|
name: 'CollabAgent',
|
|
68
|
-
model: '
|
|
68
|
+
model: 'openai/gpt-5-mini',
|
|
69
69
|
memory,
|
|
70
70
|
instructions: `
|
|
71
71
|
You are a collaborative document assistant. Multiple users talk to you in the SAME thread.
|
|
@@ -30,7 +30,7 @@ const agent = new Agent({
|
|
|
30
30
|
id: 'support-agent',
|
|
31
31
|
name: 'SupportAgent',
|
|
32
32
|
instructions: 'You are a helpful support agent.',
|
|
33
|
-
model: 'openai/gpt-5.
|
|
33
|
+
model: 'openai/gpt-5.5',
|
|
34
34
|
memory: new Memory({
|
|
35
35
|
storage: new LibSQLStore({
|
|
36
36
|
id: 'agent-storage',
|
|
@@ -247,7 +247,7 @@ const agent = new Agent({
|
|
|
247
247
|
})
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
The model router automatically handles API key detection from environment variables (`OPENAI_API_KEY`, `
|
|
250
|
+
The model router automatically handles API key detection from environment variables (`OPENAI_API_KEY`, `GOOGLE_API_KEY`, `OPENROUTER_API_KEY`). Google models also fall back to `GOOGLE_GENERATIVE_AI_API_KEY`.
|
|
251
251
|
|
|
252
252
|
### Using AI SDK Packages
|
|
253
253
|
|
|
@@ -41,6 +41,7 @@ Each provider page includes installation instructions, configuration parameters,
|
|
|
41
41
|
- [DynamoDB](https://mastra.ai/reference/storage/dynamodb)
|
|
42
42
|
- [LanceDB](https://mastra.ai/reference/storage/lance)
|
|
43
43
|
- [Microsoft SQL Server](https://mastra.ai/reference/storage/mssql)
|
|
44
|
+
- [Google Cloud Spanner](https://mastra.ai/reference/storage/spanner)
|
|
44
45
|
|
|
45
46
|
> **Tip:** libSQL is the easiest way to get started because it doesn’t require running a separate database server.
|
|
46
47
|
|
|
@@ -179,7 +180,7 @@ export const agent = new Agent({
|
|
|
179
180
|
memory: new Memory({
|
|
180
181
|
options: {
|
|
181
182
|
generateTitle: {
|
|
182
|
-
model: '
|
|
183
|
+
model: 'openai/gpt-5-mini',
|
|
183
184
|
instructions: 'Generate a 1 word title',
|
|
184
185
|
},
|
|
185
186
|
},
|
|
@@ -11,7 +11,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
11
11
|
export const agent = new Agent({
|
|
12
12
|
name: 'test-agent',
|
|
13
13
|
instructions: 'You are an agent with memory.',
|
|
14
|
-
model: 'openai/gpt-5.
|
|
14
|
+
model: 'openai/gpt-5.5',
|
|
15
15
|
memory: new Memory({
|
|
16
16
|
options: {
|
|
17
17
|
workingMemory: {
|
|
@@ -60,7 +60,7 @@ import { LibSQLStore, LibSQLVector } from '@mastra/libsql'
|
|
|
60
60
|
export const agent = new Agent({
|
|
61
61
|
name: 'test-agent',
|
|
62
62
|
instructions: 'You are an agent with memory.',
|
|
63
|
-
model: 'openai/gpt-5.
|
|
63
|
+
model: 'openai/gpt-5.5',
|
|
64
64
|
memory: new Memory({
|
|
65
65
|
storage: new LibSQLStore({
|
|
66
66
|
id: 'test-agent-storage',
|
|
@@ -97,7 +97,7 @@ import { PgStore, PgVector } from '@mastra/pg'
|
|
|
97
97
|
export const agent = new Agent({
|
|
98
98
|
name: 'pg-agent',
|
|
99
99
|
instructions: 'You are an agent with optimized PostgreSQL memory.',
|
|
100
|
-
model: 'openai/gpt-5.
|
|
100
|
+
model: 'openai/gpt-5.5',
|
|
101
101
|
memory: new Memory({
|
|
102
102
|
storage: new PgStore({
|
|
103
103
|
id: 'pg-agent-storage',
|
|
@@ -181,7 +181,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
181
181
|
export const agent = new Agent({
|
|
182
182
|
name: 'my-agent',
|
|
183
183
|
instructions: 'You are a helpful assistant.',
|
|
184
|
-
model: 'openai/gpt-5.
|
|
184
|
+
model: 'openai/gpt-5.5',
|
|
185
185
|
memory: new Memory({
|
|
186
186
|
options: {
|
|
187
187
|
observationalMemory: {
|
|
@@ -201,7 +201,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
201
201
|
export const agent = new Agent({
|
|
202
202
|
name: 'my-agent',
|
|
203
203
|
instructions: 'You are a helpful assistant.',
|
|
204
|
-
model: 'openai/gpt-5.
|
|
204
|
+
model: 'openai/gpt-5.5',
|
|
205
205
|
memory: new Memory({
|
|
206
206
|
options: {
|
|
207
207
|
observationalMemory: {
|
|
@@ -228,7 +228,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
228
228
|
export const agent = new Agent({
|
|
229
229
|
name: 'health-assistant',
|
|
230
230
|
instructions: 'You are a health and wellness assistant.',
|
|
231
|
-
model: 'openai/gpt-5.
|
|
231
|
+
model: 'openai/gpt-5.5',
|
|
232
232
|
memory: new Memory({
|
|
233
233
|
options: {
|
|
234
234
|
observationalMemory: {
|
|
@@ -677,7 +677,7 @@ const selector = new ModelByInputTokens({
|
|
|
677
677
|
upTo: {
|
|
678
678
|
10_000: 'google/gemini-2.5-flash', // Fast for small inputs
|
|
679
679
|
40_000: 'openai/gpt-5-mini', // Stronger for medium inputs
|
|
680
|
-
1_000_000: 'openai/gpt-5.
|
|
680
|
+
1_000_000: 'openai/gpt-5.5', // Most capable for large inputs
|
|
681
681
|
},
|
|
682
682
|
})
|
|
683
683
|
```
|
|
@@ -81,7 +81,7 @@ import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
|
81
81
|
export const agent = new Agent({
|
|
82
82
|
name: 'context-limited-agent',
|
|
83
83
|
instructions: 'You are a helpful assistant',
|
|
84
|
-
model: 'openai/gpt-5.
|
|
84
|
+
model: 'openai/gpt-5.5',
|
|
85
85
|
memory: new Memory({
|
|
86
86
|
/* ... */
|
|
87
87
|
}),
|
|
@@ -102,7 +102,7 @@ import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
|
102
102
|
export const agent = new Agent({
|
|
103
103
|
name: 'multi-step-agent',
|
|
104
104
|
instructions: 'You are a helpful research assistant with access to tools',
|
|
105
|
-
model: 'openai/gpt-5.
|
|
105
|
+
model: 'openai/gpt-5.5',
|
|
106
106
|
inputProcessors: [
|
|
107
107
|
new TokenLimiterProcessor({ limit: 8000 }), // Applied at every step
|
|
108
108
|
],
|
|
@@ -125,7 +125,7 @@ import { TokenLimiterProcessor } from '@mastra/core/processors'
|
|
|
125
125
|
export const agent = new Agent({
|
|
126
126
|
name: 'response-limited-agent',
|
|
127
127
|
instructions: 'You are a helpful assistant',
|
|
128
|
-
model: 'openai/gpt-5.
|
|
128
|
+
model: 'openai/gpt-5.5',
|
|
129
129
|
outputProcessors: [
|
|
130
130
|
new TokenLimiterProcessor({
|
|
131
131
|
limit: 1000,
|
|
@@ -241,7 +241,7 @@ export const dsqlAgent = new Agent({
|
|
|
241
241
|
name: 'DSQL Agent',
|
|
242
242
|
instructions:
|
|
243
243
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
244
|
-
model: 'openai/gpt-5.
|
|
244
|
+
model: 'openai/gpt-5.5',
|
|
245
245
|
memory: new Memory({
|
|
246
246
|
storage: new DSQLStore({
|
|
247
247
|
id: 'dsql-agent-storage',
|
|
@@ -206,7 +206,7 @@ export const mongodbAgent = new Agent({
|
|
|
206
206
|
name: 'mongodb-agent',
|
|
207
207
|
instructions:
|
|
208
208
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
209
|
-
model: 'openai/gpt-5.
|
|
209
|
+
model: 'openai/gpt-5.5',
|
|
210
210
|
memory: new Memory({
|
|
211
211
|
storage: new MongoDBStore({
|
|
212
212
|
uri: process.env.MONGODB_URI!,
|
|
@@ -332,7 +332,7 @@ export const pgAgent = new Agent({
|
|
|
332
332
|
name: 'PG Agent',
|
|
333
333
|
instructions:
|
|
334
334
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
335
|
-
model: 'openai/gpt-5.
|
|
335
|
+
model: 'openai/gpt-5.5',
|
|
336
336
|
memory: new Memory({
|
|
337
337
|
storage: new PostgresStore({
|
|
338
338
|
id: 'pg-agent-storage',
|
|
@@ -181,7 +181,7 @@ export const redisAgent = new Agent({
|
|
|
181
181
|
name: 'Redis Agent',
|
|
182
182
|
instructions:
|
|
183
183
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
184
|
-
model: 'openai/gpt-5.
|
|
184
|
+
model: 'openai/gpt-5.5',
|
|
185
185
|
memory: new Memory({
|
|
186
186
|
storage: new RedisStore({
|
|
187
187
|
id: 'redis-agent-storage',
|
|
@@ -103,7 +103,7 @@ export const upstashAgent = new Agent({
|
|
|
103
103
|
name: 'Upstash Agent',
|
|
104
104
|
instructions:
|
|
105
105
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
106
|
-
model: 'openai/gpt-5.
|
|
106
|
+
model: 'openai/gpt-5.5',
|
|
107
107
|
memory: new Memory({
|
|
108
108
|
storage: new UpstashStore({
|
|
109
109
|
id: 'upstash-agent-storage',
|
|
@@ -277,7 +277,7 @@ export const libsqlAgent = new Agent({
|
|
|
277
277
|
name: 'libSQL Agent',
|
|
278
278
|
instructions:
|
|
279
279
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
280
|
-
model: 'openai/gpt-5.
|
|
280
|
+
model: 'openai/gpt-5.5',
|
|
281
281
|
memory: new Memory({
|
|
282
282
|
storage: new LibSQLStore({
|
|
283
283
|
id: 'libsql-agent-storage',
|
|
@@ -263,7 +263,7 @@ export const mongodbAgent = new Agent({
|
|
|
263
263
|
name: 'mongodb-agent',
|
|
264
264
|
instructions:
|
|
265
265
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
266
|
-
model: 'openai/gpt-5.
|
|
266
|
+
model: 'openai/gpt-5.5',
|
|
267
267
|
memory: new Memory({
|
|
268
268
|
storage: new MongoDBStore({
|
|
269
269
|
id: 'mongodb-storage',
|
|
@@ -26,6 +26,8 @@ The PgVector class provides vector search using [PostgreSQL](https://www.postgre
|
|
|
26
26
|
|
|
27
27
|
**pgPoolOptions** (`PoolConfig`): Additional pg pool configuration options
|
|
28
28
|
|
|
29
|
+
**disableInit** (`boolean`): When true, automatic DDL (schema, extension, table, and index creation) inside \`createIndex\` is skipped. Useful for CI/CD pipelines where schema and indexes are managed separately and the runtime database role lacks DDL privileges. Can also be enabled with the \`MASTRA\_DISABLE\_STORAGE\_INIT\` environment variable. (Default: `false`)
|
|
30
|
+
|
|
29
31
|
## Constructor examples
|
|
30
32
|
|
|
31
33
|
### Connection String
|
|
@@ -399,7 +401,7 @@ export const pgAgent = new Agent({
|
|
|
399
401
|
name: 'PG Agent',
|
|
400
402
|
instructions:
|
|
401
403
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
402
|
-
model: 'openai/gpt-5.
|
|
404
|
+
model: 'openai/gpt-5.5',
|
|
403
405
|
memory: new Memory({
|
|
404
406
|
storage: new PostgresStore({
|
|
405
407
|
id: 'pg-agent-storage',
|
|
@@ -265,7 +265,7 @@ export const upstashAgent = new Agent({
|
|
|
265
265
|
name: 'Upstash Agent',
|
|
266
266
|
instructions:
|
|
267
267
|
'You are an AI agent with the ability to automatically recall memories from previous interactions.',
|
|
268
|
-
model: 'openai/gpt-5.
|
|
268
|
+
model: 'openai/gpt-5.5',
|
|
269
269
|
memory: new Memory({
|
|
270
270
|
storage: new UpstashStore({
|
|
271
271
|
id: 'upstash-agent-storage',
|