@mastra/memory 1.8.3 → 1.9.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 +38 -0
- package/dist/{chunk-4KPXPQX3.js → chunk-5SMKVGJP.js} +205 -37
- package/dist/chunk-5SMKVGJP.js.map +1 -0
- package/dist/{chunk-LGCREJMO.cjs → chunk-AR52LM55.cjs} +205 -37
- package/dist/chunk-AR52LM55.cjs.map +1 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +27 -27
- package/dist/docs/references/docs-memory-observational-memory.md +2 -0
- package/dist/docs/references/reference-memory-observational-memory.md +2 -0
- package/dist/index.cjs +7 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/{observational-memory-UEDVTWS2.js → observational-memory-5NFPG6M3.js} +3 -3
- package/dist/{observational-memory-UEDVTWS2.js.map → observational-memory-5NFPG6M3.js.map} +1 -1
- package/dist/{observational-memory-4TV5KKFV.cjs → observational-memory-NH7VDTXM.cjs} +18 -18
- package/dist/{observational-memory-4TV5KKFV.cjs.map → observational-memory-NH7VDTXM.cjs.map} +1 -1
- package/dist/processors/index.cjs +16 -16
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/markers.d.ts +10 -1
- package/dist/processors/observational-memory/markers.d.ts.map +1 -1
- package/dist/processors/observational-memory/observational-memory.d.ts +2 -0
- package/dist/processors/observational-memory/observational-memory.d.ts.map +1 -1
- package/dist/processors/observational-memory/observer-agent.d.ts +16 -6
- package/dist/processors/observational-memory/observer-agent.d.ts.map +1 -1
- package/dist/processors/observational-memory/reflector-agent.d.ts.map +1 -1
- package/dist/processors/observational-memory/types.d.ts +27 -1
- package/dist/processors/observational-memory/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/chunk-4KPXPQX3.js.map +0 -1
- package/dist/chunk-LGCREJMO.cjs.map +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.9.0-alpha.1",
|
|
3
3
|
"package": "@mastra/memory",
|
|
4
4
|
"exports": {
|
|
5
5
|
"OBSERVATIONAL_MEMORY_DEFAULTS": {
|
|
6
6
|
"types": "dist/processors/index.d.ts",
|
|
7
|
-
"implementation": "dist/chunk-
|
|
7
|
+
"implementation": "dist/chunk-5SMKVGJP.js"
|
|
8
8
|
},
|
|
9
9
|
"OBSERVATION_CONTEXT_INSTRUCTIONS": {
|
|
10
10
|
"types": "dist/processors/index.d.ts",
|
|
11
|
-
"implementation": "dist/chunk-
|
|
11
|
+
"implementation": "dist/chunk-5SMKVGJP.js"
|
|
12
12
|
},
|
|
13
13
|
"OBSERVATION_CONTEXT_PROMPT": {
|
|
14
14
|
"types": "dist/processors/index.d.ts",
|
|
15
|
-
"implementation": "dist/chunk-
|
|
15
|
+
"implementation": "dist/chunk-5SMKVGJP.js"
|
|
16
16
|
},
|
|
17
17
|
"OBSERVATION_CONTINUATION_HINT": {
|
|
18
18
|
"types": "dist/processors/index.d.ts",
|
|
19
|
-
"implementation": "dist/chunk-
|
|
19
|
+
"implementation": "dist/chunk-5SMKVGJP.js"
|
|
20
20
|
},
|
|
21
21
|
"OBSERVER_SYSTEM_PROMPT": {
|
|
22
22
|
"types": "dist/processors/index.d.ts",
|
|
23
|
-
"implementation": "dist/chunk-
|
|
23
|
+
"implementation": "dist/chunk-5SMKVGJP.js"
|
|
24
24
|
},
|
|
25
25
|
"ObservationalMemory": {
|
|
26
26
|
"types": "dist/processors/index.d.ts",
|
|
27
|
-
"implementation": "dist/chunk-
|
|
28
|
-
"line":
|
|
27
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
28
|
+
"line": 3160
|
|
29
29
|
},
|
|
30
30
|
"TokenCounter": {
|
|
31
31
|
"types": "dist/processors/index.d.ts",
|
|
32
|
-
"implementation": "dist/chunk-
|
|
33
|
-
"line":
|
|
32
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
33
|
+
"line": 2649
|
|
34
34
|
},
|
|
35
35
|
"buildObserverPrompt": {
|
|
36
36
|
"types": "dist/processors/index.d.ts",
|
|
37
|
-
"implementation": "dist/chunk-
|
|
38
|
-
"line":
|
|
37
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
38
|
+
"line": 1256
|
|
39
39
|
},
|
|
40
40
|
"buildObserverSystemPrompt": {
|
|
41
41
|
"types": "dist/processors/index.d.ts",
|
|
42
|
-
"implementation": "dist/chunk-
|
|
43
|
-
"line":
|
|
42
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
43
|
+
"line": 723
|
|
44
44
|
},
|
|
45
45
|
"extractCurrentTask": {
|
|
46
46
|
"types": "dist/processors/index.d.ts",
|
|
47
|
-
"implementation": "dist/chunk-
|
|
48
|
-
"line":
|
|
47
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
48
|
+
"line": 1370
|
|
49
49
|
},
|
|
50
50
|
"formatMessagesForObserver": {
|
|
51
51
|
"types": "dist/processors/index.d.ts",
|
|
52
|
-
"implementation": "dist/chunk-
|
|
53
|
-
"line":
|
|
52
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
53
|
+
"line": 989
|
|
54
54
|
},
|
|
55
55
|
"getObservationsAsOf": {
|
|
56
56
|
"types": "dist/processors/index.d.ts",
|
|
57
|
-
"implementation": "dist/chunk-
|
|
58
|
-
"line":
|
|
57
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
58
|
+
"line": 7254
|
|
59
59
|
},
|
|
60
60
|
"hasCurrentTaskSection": {
|
|
61
61
|
"types": "dist/processors/index.d.ts",
|
|
62
|
-
"implementation": "dist/chunk-
|
|
63
|
-
"line":
|
|
62
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
63
|
+
"line": 1358
|
|
64
64
|
},
|
|
65
65
|
"optimizeObservationsForContext": {
|
|
66
66
|
"types": "dist/processors/index.d.ts",
|
|
67
|
-
"implementation": "dist/chunk-
|
|
68
|
-
"line":
|
|
67
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
68
|
+
"line": 1381
|
|
69
69
|
},
|
|
70
70
|
"parseObserverOutput": {
|
|
71
71
|
"types": "dist/processors/index.d.ts",
|
|
72
|
-
"implementation": "dist/chunk-
|
|
73
|
-
"line":
|
|
72
|
+
"implementation": "dist/chunk-5SMKVGJP.js",
|
|
73
|
+
"line": 1266
|
|
74
74
|
},
|
|
75
75
|
"extractWorkingMemoryContent": {
|
|
76
76
|
"types": "dist/index.d.ts",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"processors": {
|
|
102
102
|
"index": "dist/processors/index.js",
|
|
103
103
|
"chunks": [
|
|
104
|
-
"chunk-
|
|
104
|
+
"chunk-5SMKVGJP.js"
|
|
105
105
|
]
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -75,6 +75,8 @@ Date: 2026-01-15
|
|
|
75
75
|
|
|
76
76
|
The compression is typically 5–40×. The Observer also tracks a **current task** and **suggested response** so the agent picks up where it left off.
|
|
77
77
|
|
|
78
|
+
If you enable `observation.threadTitle`, the Observer can also suggest a short thread title when the conversation topic meaningfully changes. Thread title generation is opt-in and updates the thread metadata, so apps like Mastra Code can show the latest title in thread lists and status UI.
|
|
79
|
+
|
|
78
80
|
Example: an agent using Playwright MCP might see 50,000+ tokens per page snapshot. With OM, the Observer watches the interaction and creates a few hundred tokens of observations about what was on the page and what actions were taken. The agent stays on task without carrying every raw snapshot.
|
|
79
81
|
|
|
80
82
|
### Reflections
|
|
@@ -44,6 +44,8 @@ OM performs thresholding with fast local token estimation. Text uses `tokenx`, a
|
|
|
44
44
|
|
|
45
45
|
**observation.instruction** (`string`): Custom instruction appended to the Observer's system prompt. Use this to customize what the Observer focuses on, such as domain-specific preferences or priorities.
|
|
46
46
|
|
|
47
|
+
**observation.threadTitle** (`boolean`): When \`true\`, the Observer suggests short thread titles and updates the thread title when the conversation topic meaningfully changes. This is opt-in and defaults to disabled.
|
|
48
|
+
|
|
47
49
|
**observation.messageTokens** (`number`): Token count of unobserved messages that triggers observation. When unobserved message tokens exceed this threshold, the Observer agent is called. Text is estimated locally with \`tokenx\`. Image parts are included with model-aware heuristics when possible, with deterministic fallbacks when image metadata is incomplete. Image-like \`file\` parts are counted the same way when uploads are normalized as files.
|
|
48
50
|
|
|
49
51
|
**observation.maxTokensPerBatch** (`number`): Maximum tokens per batch when observing multiple threads in resource scope. Threads are chunked into batches of this size and processed in parallel. Lower values mean more parallelism but more API calls.
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkCK4U3AYR_cjs = require('./chunk-CK4U3AYR.cjs');
|
|
4
4
|
var chunkIDRQZVB4_cjs = require('./chunk-IDRQZVB4.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkAR52LM55_cjs = require('./chunk-AR52LM55.cjs');
|
|
6
6
|
var v3 = require('zod/v3');
|
|
7
7
|
var zod = require('zod');
|
|
8
8
|
var z4 = require('zod/v4');
|
|
@@ -7341,7 +7341,7 @@ async function getVercelRequestId() {
|
|
|
7341
7341
|
var _a932;
|
|
7342
7342
|
return (_a932 = (0, import_oidc.getContext)().headers) == null ? void 0 : _a932["x-vercel-id"];
|
|
7343
7343
|
}
|
|
7344
|
-
var VERSION3 = "2.0.
|
|
7344
|
+
var VERSION3 = "2.0.59";
|
|
7345
7345
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
7346
7346
|
function createGatewayProvider(options = {}) {
|
|
7347
7347
|
var _a932, _b93;
|
|
@@ -8302,7 +8302,7 @@ function getGlobalProvider() {
|
|
|
8302
8302
|
var _a163;
|
|
8303
8303
|
return (_a163 = globalThis.AI_SDK_DEFAULT_PROVIDER) != null ? _a163 : gateway;
|
|
8304
8304
|
}
|
|
8305
|
-
var VERSION32 = "5.0.
|
|
8305
|
+
var VERSION32 = "5.0.155";
|
|
8306
8306
|
var dataContentSchema2 = z4.z.union([
|
|
8307
8307
|
z4.z.string(),
|
|
8308
8308
|
z4.z.instanceof(Uint8Array),
|
|
@@ -17015,7 +17015,7 @@ Notes:
|
|
|
17015
17015
|
"Observational memory requires @mastra/core support for request-response-id-rotation. Please bump @mastra/core to a newer version."
|
|
17016
17016
|
);
|
|
17017
17017
|
}
|
|
17018
|
-
const { ObservationalMemory } = await import('./observational-memory-
|
|
17018
|
+
const { ObservationalMemory } = await import('./observational-memory-NH7VDTXM.cjs');
|
|
17019
17019
|
return new ObservationalMemory({
|
|
17020
17020
|
storage: memoryStore,
|
|
17021
17021
|
scope: omConfig.scope,
|
|
@@ -17031,7 +17031,8 @@ Notes:
|
|
|
17031
17031
|
bufferActivation: omConfig.observation.bufferActivation,
|
|
17032
17032
|
blockAfter: omConfig.observation.blockAfter,
|
|
17033
17033
|
previousObserverTokens: omConfig.observation.previousObserverTokens,
|
|
17034
|
-
instruction: omConfig.observation.instruction
|
|
17034
|
+
instruction: omConfig.observation.instruction,
|
|
17035
|
+
threadTitle: omConfig.observation.threadTitle
|
|
17035
17036
|
} : void 0,
|
|
17036
17037
|
reflection: omConfig.reflection ? {
|
|
17037
17038
|
model: omConfig.reflection.model,
|
|
@@ -17048,7 +17049,7 @@ Notes:
|
|
|
17048
17049
|
|
|
17049
17050
|
Object.defineProperty(exports, "getObservationsAsOf", {
|
|
17050
17051
|
enumerable: true,
|
|
17051
|
-
get: function () { return
|
|
17052
|
+
get: function () { return chunkAR52LM55_cjs.getObservationsAsOf; }
|
|
17052
17053
|
});
|
|
17053
17054
|
Object.defineProperty(exports, "extractWorkingMemoryContent", {
|
|
17054
17055
|
enumerable: true,
|