@mastra/memory 1.9.1-alpha.1 → 1.10.0-alpha.2

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/{chunk-T5FHEWK6.js → chunk-7A3UGAXY.js} +338 -116
  3. package/dist/chunk-7A3UGAXY.js.map +1 -0
  4. package/dist/{chunk-CNOHXG5O.cjs → chunk-EVBFYGDL.cjs} +338 -115
  5. package/dist/chunk-EVBFYGDL.cjs.map +1 -0
  6. package/dist/docs/SKILL.md +1 -1
  7. package/dist/docs/assets/SOURCE_MAP.json +52 -47
  8. package/dist/docs/references/docs-memory-observational-memory.md +36 -0
  9. package/dist/docs/references/reference-memory-observational-memory.md +42 -3
  10. package/dist/index.cjs +17 -10
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.ts +20 -2
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +7 -4
  15. package/dist/index.js.map +1 -1
  16. package/dist/{observational-memory-APEZUJUQ.cjs → observational-memory-COYJCVX3.cjs} +32 -28
  17. package/dist/{observational-memory-APEZUJUQ.cjs.map → observational-memory-COYJCVX3.cjs.map} +1 -1
  18. package/dist/observational-memory-K2U3QQIO.js +3 -0
  19. package/dist/{observational-memory-OZ7TG4DZ.js.map → observational-memory-K2U3QQIO.js.map} +1 -1
  20. package/dist/processors/index.cjs +30 -26
  21. package/dist/processors/index.js +1 -1
  22. package/dist/processors/observational-memory/index.d.ts +1 -0
  23. package/dist/processors/observational-memory/index.d.ts.map +1 -1
  24. package/dist/processors/observational-memory/model-by-input-tokens.d.ts +14 -0
  25. package/dist/processors/observational-memory/model-by-input-tokens.d.ts.map +1 -0
  26. package/dist/processors/observational-memory/observational-memory.d.ts +19 -5
  27. package/dist/processors/observational-memory/observational-memory.d.ts.map +1 -1
  28. package/dist/processors/observational-memory/types.d.ts +4 -2
  29. package/dist/processors/observational-memory/types.d.ts.map +1 -1
  30. package/package.json +3 -3
  31. package/dist/chunk-CNOHXG5O.cjs.map +0 -1
  32. package/dist/chunk-T5FHEWK6.js.map +0 -1
  33. package/dist/observational-memory-OZ7TG4DZ.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 1.10.0-alpha.2
4
+
5
+ ### Minor Changes
6
+
7
+ - Added `ModelByInputTokens` in `@mastra/memory` for token-threshold-based model selection in Observational Memory. ([#14614](https://github.com/mastra-ai/mastra/pull/14614))
8
+
9
+ When configured, OM automatically selects different observer or reflector models based on the actual input token count at the time the OM call runs.
10
+
11
+ Example usage:
12
+
13
+ ```ts
14
+ import { Memory, ModelByInputTokens } from '@mastra/memory';
15
+
16
+ const memory = new Memory({
17
+ options: {
18
+ observationalMemory: {
19
+ model: new ModelByInputTokens({
20
+ upTo: {
21
+ 10_000: 'google/gemini-2.5-flash',
22
+ 40_000: 'openai/gpt-4o',
23
+ 1_000_000: 'openai/gpt-4.5',
24
+ },
25
+ }),
26
+ },
27
+ },
28
+ });
29
+ ```
30
+
31
+ The `upTo` keys are inclusive upper bounds. OM resolves the matching tier directly at the observer or reflector call site. If the input exceeds the largest configured threshold, OM throws an error.
32
+
33
+ Improved Observational Memory tracing so traces show the observer and reflector spans and make it easier to see which resolved model was used at runtime.
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [[`f14604c`](https://github.com/mastra-ai/mastra/commit/f14604c7ef01ba794e1a8d5c7bae5415852aacec), [`e06b520`](https://github.com/mastra-ai/mastra/commit/e06b520bdd5fdef844760c5e692c7852cbc5c240), [`dd9c4e0`](https://github.com/mastra-ai/mastra/commit/dd9c4e0a47962f1413e9b72114fcad912e19a0a6)]:
38
+ - @mastra/core@1.16.0-alpha.4
39
+
3
40
  ## 1.9.1-alpha.1
4
41
 
5
42
  ### Patch Changes