@mastra/memory 1.6.0 → 1.6.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/{chunk-5UYAHJVJ.cjs → chunk-D6II7EP4.cjs} +660 -531
  3. package/dist/chunk-D6II7EP4.cjs.map +1 -0
  4. package/dist/{chunk-A62BQK35.js → chunk-GBBQIJQF.js} +660 -531
  5. package/dist/chunk-GBBQIJQF.js.map +1 -0
  6. package/dist/docs/SKILL.md +1 -1
  7. package/dist/docs/assets/SOURCE_MAP.json +25 -25
  8. package/dist/docs/references/docs-agents-agent-approval.md +61 -31
  9. package/dist/docs/references/docs-agents-supervisor-agents.md +1 -1
  10. package/dist/docs/references/docs-memory-observational-memory.md +9 -0
  11. package/dist/docs/references/docs-memory-semantic-recall.md +17 -1
  12. package/dist/docs/references/reference-core-getMemory.md +2 -2
  13. package/dist/docs/references/reference-core-listMemory.md +1 -1
  14. package/dist/docs/references/reference-memory-clone-utilities.md +5 -5
  15. package/dist/docs/references/reference-memory-cloneThread.md +17 -21
  16. package/dist/docs/references/reference-memory-createThread.md +10 -10
  17. package/dist/docs/references/reference-memory-getThreadById.md +2 -2
  18. package/dist/docs/references/reference-memory-listThreads.md +5 -5
  19. package/dist/docs/references/reference-memory-memory-class.md +12 -14
  20. package/dist/docs/references/reference-memory-observational-memory.md +102 -94
  21. package/dist/docs/references/reference-processors-token-limiter-processor.md +11 -13
  22. package/dist/docs/references/reference-storage-dynamodb.md +9 -9
  23. package/dist/docs/references/reference-storage-libsql.md +2 -2
  24. package/dist/docs/references/reference-storage-mongodb.md +5 -5
  25. package/dist/docs/references/reference-storage-postgresql.md +25 -25
  26. package/dist/docs/references/reference-storage-upstash.md +3 -3
  27. package/dist/docs/references/reference-vectors-libsql.md +31 -31
  28. package/dist/docs/references/reference-vectors-mongodb.md +32 -32
  29. package/dist/docs/references/reference-vectors-pg.md +60 -44
  30. package/dist/docs/references/reference-vectors-upstash.md +25 -25
  31. package/dist/index.cjs +246 -57
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.ts +19 -0
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +246 -57
  36. package/dist/index.js.map +1 -1
  37. package/dist/{observational-memory-MXI54VC7.cjs → observational-memory-AHVELJX4.cjs} +17 -17
  38. package/dist/{observational-memory-MXI54VC7.cjs.map → observational-memory-AHVELJX4.cjs.map} +1 -1
  39. package/dist/{observational-memory-SR6G4HN5.js → observational-memory-QFQUF5EY.js} +3 -3
  40. package/dist/{observational-memory-SR6G4HN5.js.map → observational-memory-QFQUF5EY.js.map} +1 -1
  41. package/dist/processors/index.cjs +15 -15
  42. package/dist/processors/index.js +1 -1
  43. package/dist/processors/observational-memory/date-utils.d.ts +35 -0
  44. package/dist/processors/observational-memory/date-utils.d.ts.map +1 -0
  45. package/dist/processors/observational-memory/markers.d.ts +94 -0
  46. package/dist/processors/observational-memory/markers.d.ts.map +1 -0
  47. package/dist/processors/observational-memory/observational-memory.d.ts +0 -76
  48. package/dist/processors/observational-memory/observational-memory.d.ts.map +1 -1
  49. package/dist/processors/observational-memory/operation-registry.d.ts +14 -0
  50. package/dist/processors/observational-memory/operation-registry.d.ts.map +1 -0
  51. package/dist/processors/observational-memory/thresholds.d.ts +52 -0
  52. package/dist/processors/observational-memory/thresholds.d.ts.map +1 -0
  53. package/dist/processors/observational-memory/token-counter.d.ts +4 -0
  54. package/dist/processors/observational-memory/token-counter.d.ts.map +1 -1
  55. package/dist/tools/working-memory.d.ts.map +1 -1
  56. package/package.json +7 -7
  57. package/dist/chunk-5UYAHJVJ.cjs.map +0 -1
  58. package/dist/chunk-A62BQK35.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Improved confidence in observational memory threshold behavior through expanded automated test coverage. No public API changes. ([#13785](https://github.com/mastra-ai/mastra/pull/13785))
8
+
9
+ - Improved Observational Memory reliability: fixed future-date annotations producing invalid strings, fixed a duplicate inline-date matching bug, and hardened the process-level operation registry against concurrent operation tracking errors. ([#13774](https://github.com/mastra-ai/mastra/pull/13774))
10
+
11
+ - Fixed buffered activation cleanup to respect the configured retention floor so message history does not collapse unexpectedly after activation. ([#13745](https://github.com/mastra-ai/mastra/pull/13745))
12
+
13
+ - Fixed orphaned vector embeddings accumulating when memory threads or messages are deleted. Calling `memory.deleteThread()` or `memory.deleteMessages()` now automatically cleans up associated vector embeddings across all supported vector store backends. Cleanup is non-blocking and does not slow down the delete call. Also fixed `updateMessages` not cleaning up old vectors correctly when using a non-default index separator (e.g. Pinecone). ([#12227](https://github.com/mastra-ai/mastra/pull/12227))
14
+
15
+ - Repeated token counts in OM are faster and more reliable, estimates are now persisted on metadata, and totals remain consistent after saving and loading conversations. ([#13745](https://github.com/mastra-ai/mastra/pull/13745))
16
+
17
+ - Improved observational memory marker creation consistency for more reliable debugging and UI status behavior. No public API changes. ([#13779](https://github.com/mastra-ai/mastra/pull/13779))
18
+
19
+ - Fixed observational memory token counting to use stored model output for tool results transformed with toModelOutput. ([#13862](https://github.com/mastra-ai/mastra/pull/13862))
20
+
21
+ - Fix working memory data corruption when using resource scope across threads ([#12415](https://github.com/mastra-ai/mastra/pull/12415))
22
+ - Add mutex protection to `updateWorkingMemory()` to prevent race conditions during concurrent updates
23
+ - Add normalized whitespace comparison to `__experimental_updateWorkingMemoryVNext()` to detect template duplicates with whitespace variations
24
+ - Add validation to `updateWorkingMemoryTool` to prevent LLM from accidentally wiping existing data by sending empty template
25
+ - Improve template removal logic to handle line ending variations
26
+
27
+ - Updated dependencies [[`41e48c1`](https://github.com/mastra-ai/mastra/commit/41e48c198eee846478e60c02ec432c19d322a517), [`82469d3`](https://github.com/mastra-ai/mastra/commit/82469d3135d5a49dd8dc8feec0ff398b4e0225a0), [`33e2fd5`](https://github.com/mastra-ai/mastra/commit/33e2fd5088f83666df17401e2da68c943dbc0448), [`7ef6e2c`](https://github.com/mastra-ai/mastra/commit/7ef6e2c61be5a42e26f55d15b5902866fc76634f), [`b12d2a5`](https://github.com/mastra-ai/mastra/commit/b12d2a59a48be0477cabae66eb6cf0fc94a7d40d), [`fa37d39`](https://github.com/mastra-ai/mastra/commit/fa37d39910421feaf8847716292e3d65dd4f30c2), [`b12d2a5`](https://github.com/mastra-ai/mastra/commit/b12d2a59a48be0477cabae66eb6cf0fc94a7d40d), [`71c38bf`](https://github.com/mastra-ai/mastra/commit/71c38bf905905148ecd0e75c07c1f9825d299b76), [`f993c38`](https://github.com/mastra-ai/mastra/commit/f993c3848c97479b813231be872443bedeced6ab), [`f51849a`](https://github.com/mastra-ai/mastra/commit/f51849a568935122b5100b7ee69704e6d680cf7b), [`9bf3a0d`](https://github.com/mastra-ai/mastra/commit/9bf3a0dac602787925f1762f1f0387d7b4a59620), [`cafa045`](https://github.com/mastra-ai/mastra/commit/cafa0453c9de141ad50c09a13894622dffdd9978), [`1fd9ddb`](https://github.com/mastra-ai/mastra/commit/1fd9ddbb3fe83b281b12bd2e27e426ae86288266), [`6135ef4`](https://github.com/mastra-ai/mastra/commit/6135ef4f5288652bf45f616ec590607e4c95f443), [`d9d228c`](https://github.com/mastra-ai/mastra/commit/d9d228c0c6ae82ae6ce3b540a3a56b2b1c2b8d98), [`5576507`](https://github.com/mastra-ai/mastra/commit/55765071e360fb97e443aa0a91ccf7e1cd8d92aa), [`79d69c9`](https://github.com/mastra-ai/mastra/commit/79d69c9d5f842ff1c31352fb6026f04c1f6190f3), [`94f44b8`](https://github.com/mastra-ai/mastra/commit/94f44b827ce57b179e50f4916a84c0fa6e7f3b8c), [`13187db`](https://github.com/mastra-ai/mastra/commit/13187dbac880174232dedc5a501ff6c5d0fe59bc), [`2ae5311`](https://github.com/mastra-ai/mastra/commit/2ae531185fff66a80fa165c0999e3d801900e89d), [`6135ef4`](https://github.com/mastra-ai/mastra/commit/6135ef4f5288652bf45f616ec590607e4c95f443)]:
28
+ - @mastra/core@1.10.0
29
+
30
+ ## 1.6.1-alpha.0
31
+
32
+ ### Patch Changes
33
+
34
+ - Improved confidence in observational memory threshold behavior through expanded automated test coverage. No public API changes. ([#13785](https://github.com/mastra-ai/mastra/pull/13785))
35
+
36
+ - Improved Observational Memory reliability: fixed future-date annotations producing invalid strings, fixed a duplicate inline-date matching bug, and hardened the process-level operation registry against concurrent operation tracking errors. ([#13774](https://github.com/mastra-ai/mastra/pull/13774))
37
+
38
+ - Fixed buffered activation cleanup to respect the configured retention floor so message history does not collapse unexpectedly after activation. ([#13745](https://github.com/mastra-ai/mastra/pull/13745))
39
+
40
+ - Fixed orphaned vector embeddings accumulating when memory threads or messages are deleted. Calling `memory.deleteThread()` or `memory.deleteMessages()` now automatically cleans up associated vector embeddings across all supported vector store backends. Cleanup is non-blocking and does not slow down the delete call. Also fixed `updateMessages` not cleaning up old vectors correctly when using a non-default index separator (e.g. Pinecone). ([#12227](https://github.com/mastra-ai/mastra/pull/12227))
41
+
42
+ - Repeated token counts in OM are faster and more reliable, estimates are now persisted on metadata, and totals remain consistent after saving and loading conversations. ([#13745](https://github.com/mastra-ai/mastra/pull/13745))
43
+
44
+ - Improved observational memory marker creation consistency for more reliable debugging and UI status behavior. No public API changes. ([#13779](https://github.com/mastra-ai/mastra/pull/13779))
45
+
46
+ - Fixed observational memory token counting to use stored model output for tool results transformed with toModelOutput. ([#13862](https://github.com/mastra-ai/mastra/pull/13862))
47
+
48
+ - Fix working memory data corruption when using resource scope across threads ([#12415](https://github.com/mastra-ai/mastra/pull/12415))
49
+ - Add mutex protection to `updateWorkingMemory()` to prevent race conditions during concurrent updates
50
+ - Add normalized whitespace comparison to `__experimental_updateWorkingMemoryVNext()` to detect template duplicates with whitespace variations
51
+ - Add validation to `updateWorkingMemoryTool` to prevent LLM from accidentally wiping existing data by sending empty template
52
+ - Improve template removal logic to handle line ending variations
53
+
54
+ - Updated dependencies [[`41e48c1`](https://github.com/mastra-ai/mastra/commit/41e48c198eee846478e60c02ec432c19d322a517), [`82469d3`](https://github.com/mastra-ai/mastra/commit/82469d3135d5a49dd8dc8feec0ff398b4e0225a0), [`33e2fd5`](https://github.com/mastra-ai/mastra/commit/33e2fd5088f83666df17401e2da68c943dbc0448), [`7ef6e2c`](https://github.com/mastra-ai/mastra/commit/7ef6e2c61be5a42e26f55d15b5902866fc76634f), [`b12d2a5`](https://github.com/mastra-ai/mastra/commit/b12d2a59a48be0477cabae66eb6cf0fc94a7d40d), [`fa37d39`](https://github.com/mastra-ai/mastra/commit/fa37d39910421feaf8847716292e3d65dd4f30c2), [`b12d2a5`](https://github.com/mastra-ai/mastra/commit/b12d2a59a48be0477cabae66eb6cf0fc94a7d40d), [`71c38bf`](https://github.com/mastra-ai/mastra/commit/71c38bf905905148ecd0e75c07c1f9825d299b76), [`f993c38`](https://github.com/mastra-ai/mastra/commit/f993c3848c97479b813231be872443bedeced6ab), [`f51849a`](https://github.com/mastra-ai/mastra/commit/f51849a568935122b5100b7ee69704e6d680cf7b), [`9bf3a0d`](https://github.com/mastra-ai/mastra/commit/9bf3a0dac602787925f1762f1f0387d7b4a59620), [`cafa045`](https://github.com/mastra-ai/mastra/commit/cafa0453c9de141ad50c09a13894622dffdd9978), [`1fd9ddb`](https://github.com/mastra-ai/mastra/commit/1fd9ddbb3fe83b281b12bd2e27e426ae86288266), [`6135ef4`](https://github.com/mastra-ai/mastra/commit/6135ef4f5288652bf45f616ec590607e4c95f443), [`d9d228c`](https://github.com/mastra-ai/mastra/commit/d9d228c0c6ae82ae6ce3b540a3a56b2b1c2b8d98), [`5576507`](https://github.com/mastra-ai/mastra/commit/55765071e360fb97e443aa0a91ccf7e1cd8d92aa), [`79d69c9`](https://github.com/mastra-ai/mastra/commit/79d69c9d5f842ff1c31352fb6026f04c1f6190f3), [`94f44b8`](https://github.com/mastra-ai/mastra/commit/94f44b827ce57b179e50f4916a84c0fa6e7f3b8c), [`13187db`](https://github.com/mastra-ai/mastra/commit/13187dbac880174232dedc5a501ff6c5d0fe59bc), [`2ae5311`](https://github.com/mastra-ai/mastra/commit/2ae531185fff66a80fa165c0999e3d801900e89d), [`6135ef4`](https://github.com/mastra-ai/mastra/commit/6135ef4f5288652bf45f616ec590607e4c95f443)]:
55
+ - @mastra/core@1.10.0-alpha.0
56
+
3
57
  ## 1.6.0
4
58
 
5
59
  ### Minor Changes