@mastra/memory 1.28.2 → 1.28.3-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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-storage.md +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/processors/index.cjs +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/observational-memory/processor.d.ts +6 -1
- package/dist/processors/observational-memory/processor.d.ts.map +1 -1
- package/dist/processors/observational-memory/tracing.d.ts.map +1 -1
- package/dist/{src-BYrxAUzs.js → src-DG_pqwPQ.js} +39 -14
- package/dist/{src-BYrxAUzs.js.map → src-DG_pqwPQ.js.map} +1 -1
- package/dist/{src-Bewti2w5.cjs → src-UuzfQeGH.cjs} +39 -14
- package/dist/src-UuzfQeGH.cjs.map +1 -0
- package/package.json +3 -3
- package/dist/src-Bewti2w5.cjs.map +0 -1
|
@@ -19759,32 +19759,37 @@ function createTemporaryOmMemoryContext(prefix) {
|
|
|
19759
19759
|
//#region src/processors/observational-memory/tracing.ts
|
|
19760
19760
|
const PHASE_CONFIG = {
|
|
19761
19761
|
observer: {
|
|
19762
|
-
name: "
|
|
19763
|
-
entityName: "Observer"
|
|
19762
|
+
name: "memory: observe",
|
|
19763
|
+
entityName: "Observer",
|
|
19764
|
+
operationType: "observe"
|
|
19764
19765
|
},
|
|
19765
19766
|
"observer-multi-thread": {
|
|
19766
|
-
name: "
|
|
19767
|
-
entityName: "MultiThreadObserver"
|
|
19767
|
+
name: "memory: observe.multi-thread",
|
|
19768
|
+
entityName: "MultiThreadObserver",
|
|
19769
|
+
operationType: "observe",
|
|
19770
|
+
multiThread: true
|
|
19768
19771
|
},
|
|
19769
19772
|
reflector: {
|
|
19770
|
-
name: "
|
|
19771
|
-
entityName: "Reflector"
|
|
19773
|
+
name: "memory: reflect",
|
|
19774
|
+
entityName: "Reflector",
|
|
19775
|
+
operationType: "reflect"
|
|
19772
19776
|
}
|
|
19773
19777
|
};
|
|
19774
19778
|
async function withOmTracingSpan({ phase, model, inputTokens, requestContext, observabilityContext, metadata, callback }) {
|
|
19775
19779
|
const config = PHASE_CONFIG[phase];
|
|
19776
19780
|
const span = (0, _mastra_core_observability.getOrCreateSpan)({
|
|
19777
|
-
type: _mastra_core_observability.SpanType.
|
|
19781
|
+
type: _mastra_core_observability.SpanType.MEMORY_OPERATION,
|
|
19778
19782
|
name: config.name,
|
|
19779
|
-
entityType: _mastra_core_observability.EntityType.
|
|
19783
|
+
entityType: _mastra_core_observability.EntityType.MEMORY,
|
|
19780
19784
|
entityName: config.entityName,
|
|
19781
19785
|
tracingContext: observabilityContext?.tracingContext ?? observabilityContext?.tracing,
|
|
19782
|
-
|
|
19783
|
-
|
|
19784
|
-
|
|
19785
|
-
|
|
19786
|
-
...
|
|
19786
|
+
attributes: {
|
|
19787
|
+
operationType: config.operationType,
|
|
19788
|
+
inputTokens,
|
|
19789
|
+
selectedModel: typeof model === "string" ? model : "(dynamic-model)",
|
|
19790
|
+
...config.multiThread ? { multiThread: true } : {}
|
|
19787
19791
|
},
|
|
19792
|
+
metadata,
|
|
19788
19793
|
requestContext
|
|
19789
19794
|
});
|
|
19790
19795
|
const childObservabilityContext = (0, _mastra_core_observability.createObservabilityContext)({ currentSpan: span });
|
|
@@ -29668,9 +29673,29 @@ function injectObservationContextMessages({ messageList, systemMessages, continu
|
|
|
29668
29673
|
};
|
|
29669
29674
|
messageList.add(contMsg, "memory");
|
|
29670
29675
|
}
|
|
29676
|
+
/**
|
|
29677
|
+
* Observational memory runs on the processor pipeline, but a user configures
|
|
29678
|
+
* `memory`, not a processor — so its spans are labelled as memory operations
|
|
29679
|
+
* rather than as anonymous pipeline entries.
|
|
29680
|
+
*
|
|
29681
|
+
* The two phases do different things and are named separately: the input step
|
|
29682
|
+
* builds observation context into the system messages (a recall), and the
|
|
29683
|
+
* output result persists what the turn produced (a save).
|
|
29684
|
+
*/
|
|
29685
|
+
const OM_PHASE_OPERATION = {
|
|
29686
|
+
inputStep: "recall",
|
|
29687
|
+
output: "save",
|
|
29688
|
+
outputStep: "save"
|
|
29689
|
+
};
|
|
29671
29690
|
var ObservationalMemoryProcessor = class {
|
|
29672
29691
|
id = "observational-memory";
|
|
29673
29692
|
name = "Observational Memory";
|
|
29693
|
+
spanType = _mastra_core_observability.SpanType.MEMORY_OPERATION;
|
|
29694
|
+
spanName = (phase) => `memory: ${OM_PHASE_OPERATION[phase] ?? "observational"}`;
|
|
29695
|
+
spanAttributes = (phase) => {
|
|
29696
|
+
const operationType = OM_PHASE_OPERATION[phase];
|
|
29697
|
+
return operationType ? { operationType } : {};
|
|
29698
|
+
};
|
|
29674
29699
|
/** The underlying ObservationalMemory engine. */
|
|
29675
29700
|
engine;
|
|
29676
29701
|
/** Memory instance for loading context. */
|
|
@@ -32230,4 +32255,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
|
|
|
32230
32255
|
}
|
|
32231
32256
|
});
|
|
32232
32257
|
|
|
32233
|
-
//# sourceMappingURL=src-
|
|
32258
|
+
//# sourceMappingURL=src-UuzfQeGH.cjs.map
|