@mastra/memory 1.0.1 → 1.1.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 +60 -0
- package/dist/chunk-6TXUWFIU.js +3188 -0
- package/dist/chunk-6TXUWFIU.js.map +1 -0
- package/dist/chunk-FQJWVCDF.cjs +3205 -0
- package/dist/chunk-FQJWVCDF.cjs.map +1 -0
- package/dist/docs/README.md +1 -1
- package/dist/docs/SKILL.md +12 -1
- package/dist/docs/SOURCE_MAP.json +62 -2
- package/dist/docs/memory/02-storage.md +10 -0
- package/dist/index.cjs +108 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +62 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +108 -5
- package/dist/index.js.map +1 -1
- package/dist/observational-memory-3Q42SITP.cjs +52 -0
- package/dist/observational-memory-3Q42SITP.cjs.map +1 -0
- package/dist/observational-memory-VXLHOSDZ.js +3 -0
- package/dist/observational-memory-VXLHOSDZ.js.map +1 -0
- package/dist/processors/index.cjs +52 -0
- package/dist/processors/index.cjs.map +1 -0
- package/dist/processors/index.d.ts +2 -0
- package/dist/processors/index.d.ts.map +1 -0
- package/dist/processors/index.js +3 -0
- package/dist/processors/index.js.map +1 -0
- package/dist/processors/observational-memory/index.d.ts +18 -0
- package/dist/processors/observational-memory/index.d.ts.map +1 -0
- package/dist/processors/observational-memory/observational-memory.d.ts +579 -0
- package/dist/processors/observational-memory/observational-memory.d.ts.map +1 -0
- package/dist/processors/observational-memory/observer-agent.d.ts +117 -0
- package/dist/processors/observational-memory/observer-agent.d.ts.map +1 -0
- package/dist/processors/observational-memory/reflector-agent.d.ts +46 -0
- package/dist/processors/observational-memory/reflector-agent.d.ts.map +1 -0
- package/dist/processors/observational-memory/token-counter.d.ts +30 -0
- package/dist/processors/observational-memory/token-counter.d.ts.map +1 -0
- package/dist/processors/observational-memory/types.d.ts +288 -0
- package/dist/processors/observational-memory/types.d.ts.map +1 -0
- package/package.json +15 -5
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkFQJWVCDF_cjs = require('./chunk-FQJWVCDF.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "OBSERVATIONAL_MEMORY_DEFAULTS", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkFQJWVCDF_cjs.OBSERVATIONAL_MEMORY_DEFAULTS; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "OBSERVER_SYSTEM_PROMPT", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkFQJWVCDF_cjs.OBSERVER_SYSTEM_PROMPT; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "ObservationalMemory", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkFQJWVCDF_cjs.ObservationalMemory; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "TokenCounter", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkFQJWVCDF_cjs.TokenCounter; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "buildObserverPrompt", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkFQJWVCDF_cjs.buildObserverPrompt; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "buildObserverSystemPrompt", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkFQJWVCDF_cjs.buildObserverSystemPrompt; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "extractCurrentTask", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkFQJWVCDF_cjs.extractCurrentTask; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "formatMessagesForObserver", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkFQJWVCDF_cjs.formatMessagesForObserver; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "hasCurrentTaskSection", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkFQJWVCDF_cjs.hasCurrentTaskSection; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "optimizeObservationsForContext", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkFQJWVCDF_cjs.optimizeObservationsForContext; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "parseObserverOutput", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkFQJWVCDF_cjs.parseObserverOutput; }
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=observational-memory-3Q42SITP.cjs.map
|
|
52
|
+
//# sourceMappingURL=observational-memory-3Q42SITP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-3Q42SITP.cjs"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, extractCurrentTask, formatMessagesForObserver, hasCurrentTaskSection, optimizeObservationsForContext, parseObserverOutput } from './chunk-6TXUWFIU.js';
|
|
2
|
+
//# sourceMappingURL=observational-memory-VXLHOSDZ.js.map
|
|
3
|
+
//# sourceMappingURL=observational-memory-VXLHOSDZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"observational-memory-VXLHOSDZ.js"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkFQJWVCDF_cjs = require('../chunk-FQJWVCDF.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "OBSERVATIONAL_MEMORY_DEFAULTS", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkFQJWVCDF_cjs.OBSERVATIONAL_MEMORY_DEFAULTS; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "OBSERVER_SYSTEM_PROMPT", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkFQJWVCDF_cjs.OBSERVER_SYSTEM_PROMPT; }
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "ObservationalMemory", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunkFQJWVCDF_cjs.ObservationalMemory; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "TokenCounter", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunkFQJWVCDF_cjs.TokenCounter; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "buildObserverPrompt", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunkFQJWVCDF_cjs.buildObserverPrompt; }
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "buildObserverSystemPrompt", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function () { return chunkFQJWVCDF_cjs.buildObserverSystemPrompt; }
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "extractCurrentTask", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return chunkFQJWVCDF_cjs.extractCurrentTask; }
|
|
34
|
+
});
|
|
35
|
+
Object.defineProperty(exports, "formatMessagesForObserver", {
|
|
36
|
+
enumerable: true,
|
|
37
|
+
get: function () { return chunkFQJWVCDF_cjs.formatMessagesForObserver; }
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "hasCurrentTaskSection", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return chunkFQJWVCDF_cjs.hasCurrentTaskSection; }
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, "optimizeObservationsForContext", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () { return chunkFQJWVCDF_cjs.optimizeObservationsForContext; }
|
|
46
|
+
});
|
|
47
|
+
Object.defineProperty(exports, "parseObserverOutput", {
|
|
48
|
+
enumerable: true,
|
|
49
|
+
get: function () { return chunkFQJWVCDF_cjs.parseObserverOutput; }
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.cjs.map
|
|
52
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/processors/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { OBSERVATIONAL_MEMORY_DEFAULTS, OBSERVER_SYSTEM_PROMPT, ObservationalMemory, TokenCounter, buildObserverPrompt, buildObserverSystemPrompt, extractCurrentTask, formatMessagesForObserver, hasCurrentTaskSection, optimizeObservationsForContext, parseObserverOutput } from '../chunk-6TXUWFIU.js';
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Observational Memory (OM)
|
|
3
|
+
*
|
|
4
|
+
* A memory system that keeps agents performant across long conversations by:
|
|
5
|
+
* 1. Automatically compressing turn-based message history into structured observations
|
|
6
|
+
* 2. Reflecting on observations when they grow too large
|
|
7
|
+
*
|
|
8
|
+
* Three-agent architecture:
|
|
9
|
+
* - Actor: The main agent, sees observations + recent unobserved messages
|
|
10
|
+
* - Observer: Extracts observations when history exceeds threshold
|
|
11
|
+
* - Reflector: Condenses observations when they exceed threshold
|
|
12
|
+
*/
|
|
13
|
+
export { ObservationalMemory, OBSERVATIONAL_MEMORY_DEFAULTS, type ObservationalMemoryConfig, type ObservationDebugEvent, } from './observational-memory.js';
|
|
14
|
+
export type { ObservationConfig, ReflectionConfig, ObserverResult, ReflectorResult } from './types.js';
|
|
15
|
+
export { OBSERVER_SYSTEM_PROMPT, buildObserverSystemPrompt, buildObserverPrompt, parseObserverOutput, optimizeObservationsForContext, formatMessagesForObserver, hasCurrentTaskSection, extractCurrentTask, type ObserverResult as ObserverAgentResult, } from './observer-agent.js';
|
|
16
|
+
export type { ObservationalMemoryRecord, ObservationalMemoryScope, ObservationalMemoryOriginType, CreateObservationalMemoryInput, UpdateActiveObservationsInput, UpdateBufferedObservationsInput, CreateReflectionGenerationInput, } from '@mastra/core/storage';
|
|
17
|
+
export { TokenCounter } from './token-counter.js';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/processors/observational-memory/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,MAAM,wBAAwB,CAAC;AAGhC,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAGpG,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,mBAAmB,EACnB,mBAAmB,EACnB,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,cAAc,IAAI,mBAAmB,GAC3C,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,8BAA8B,EAC9B,6BAA6B,EAC7B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|