@mastra/memory 0.3.1-alpha.0 → 0.3.1-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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +6 -4
- package/dist/index.js +7 -5
- package/package.json +2 -2
- package/src/index.ts +8 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/memory@0.3.1-alpha.
|
|
2
|
+
> @mastra/memory@0.3.1-alpha.1 build /home/runner/work/mastra/mastra/packages/memory
|
|
3
3
|
> pnpm run check && tsup src/index.ts src/processors/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @mastra/memory@0.3.1-alpha.
|
|
6
|
+
> @mastra/memory@0.3.1-alpha.1 check /home/runner/work/mastra/mastra/packages/memory
|
|
7
7
|
> tsc --noEmit
|
|
8
8
|
|
|
9
9
|
[34mCLI[39m Building entry: src/index.ts, src/processors/index.ts
|
|
10
10
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
11
11
|
[34mCLI[39m tsup v8.4.0
|
|
12
12
|
[34mTSC[39m Build start
|
|
13
|
-
[32mTSC[39m ⚡️ Build success in
|
|
13
|
+
[32mTSC[39m ⚡️ Build success in 9763ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
15
|
[34mCLI[39m Target: es2022
|
|
16
16
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
17
17
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/memory/dist/_tsup-dts-rollup.d.ts[39m
|
|
18
18
|
Analysis will use the bundled TypeScript version 5.8.2
|
|
19
19
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/memory/dist/_tsup-dts-rollup.d.cts[39m
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 10462ms
|
|
21
21
|
[34mCLI[39m Cleaning output folder
|
|
22
22
|
[34mESM[39m Build start
|
|
23
23
|
[34mCJS[39m Build start
|
|
24
|
-
[32mESM[39m [1mdist/index.js [22m[32m17.83 KB[39m
|
|
25
|
-
[32mESM[39m [1mdist/processors/index.js [22m[32m5.38 KB[39m
|
|
26
|
-
[32mESM[39m ⚡️ Build success in 1027ms
|
|
27
24
|
[32mCJS[39m [1mdist/processors/index.cjs [22m[32m5.59 KB[39m
|
|
28
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m18.
|
|
29
|
-
[32mCJS[39m ⚡️ Build success in
|
|
25
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m18.17 KB[39m
|
|
26
|
+
[32mCJS[39m ⚡️ Build success in 654ms
|
|
27
|
+
[32mESM[39m [1mdist/processors/index.js [22m[32m5.38 KB[39m
|
|
28
|
+
[32mESM[39m [1mdist/index.js [22m[32m17.99 KB[39m
|
|
29
|
+
[32mESM[39m ⚡️ Build success in 658ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 0.3.1-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 20275d4: Adding warnings for current implicit Memory default options as they will be changing soon in a breaking change. Also added memory to create-mastra w/ new defaults so new projects don't see these warnings
|
|
8
|
+
- Updated dependencies [20275d4]
|
|
9
|
+
- Updated dependencies [7d1892c]
|
|
10
|
+
- Updated dependencies [a90a082]
|
|
11
|
+
- Updated dependencies [35955b0]
|
|
12
|
+
- Updated dependencies [c1409ef]
|
|
13
|
+
- Updated dependencies [11d4485]
|
|
14
|
+
- Updated dependencies [2d4001d]
|
|
15
|
+
- @mastra/core@0.9.1-alpha.1
|
|
16
|
+
|
|
3
17
|
## 0.3.1-alpha.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -118,12 +118,14 @@ var Memory = class extends memory.MastraMemory {
|
|
|
118
118
|
threadConfig
|
|
119
119
|
});
|
|
120
120
|
const config = this.getMergedThreadConfig(threadConfig || {});
|
|
121
|
+
const defaultRange = core.memoryDefaultOptions.semanticRecall.messageRange;
|
|
122
|
+
const defaultTopK = core.memoryDefaultOptions.semanticRecall.topK;
|
|
121
123
|
const vectorConfig = typeof config?.semanticRecall === `boolean` ? {
|
|
122
|
-
topK:
|
|
123
|
-
messageRange:
|
|
124
|
+
topK: defaultTopK,
|
|
125
|
+
messageRange: defaultRange
|
|
124
126
|
} : {
|
|
125
|
-
topK: config?.semanticRecall?.topK ??
|
|
126
|
-
messageRange: config?.semanticRecall?.messageRange ??
|
|
127
|
+
topK: config?.semanticRecall?.topK ?? defaultTopK,
|
|
128
|
+
messageRange: config?.semanticRecall?.messageRange ?? defaultRange
|
|
127
129
|
};
|
|
128
130
|
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector && !!selectBy.vectorSearchString) {
|
|
129
131
|
const { embeddings, dimension } = await this.embedMessageContent(selectBy.vectorSearchString);
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deepMerge } from '@mastra/core';
|
|
1
|
+
import { memoryDefaultOptions, deepMerge } from '@mastra/core';
|
|
2
2
|
import { MastraMemory } from '@mastra/core/memory';
|
|
3
3
|
import { embedMany } from 'ai';
|
|
4
4
|
import xxhash from 'xxhash-wasm';
|
|
@@ -112,12 +112,14 @@ var Memory = class extends MastraMemory {
|
|
|
112
112
|
threadConfig
|
|
113
113
|
});
|
|
114
114
|
const config = this.getMergedThreadConfig(threadConfig || {});
|
|
115
|
+
const defaultRange = memoryDefaultOptions.semanticRecall.messageRange;
|
|
116
|
+
const defaultTopK = memoryDefaultOptions.semanticRecall.topK;
|
|
115
117
|
const vectorConfig = typeof config?.semanticRecall === `boolean` ? {
|
|
116
|
-
topK:
|
|
117
|
-
messageRange:
|
|
118
|
+
topK: defaultTopK,
|
|
119
|
+
messageRange: defaultRange
|
|
118
120
|
} : {
|
|
119
|
-
topK: config?.semanticRecall?.topK ??
|
|
120
|
-
messageRange: config?.semanticRecall?.messageRange ??
|
|
121
|
+
topK: config?.semanticRecall?.topK ?? defaultTopK,
|
|
122
|
+
messageRange: config?.semanticRecall?.messageRange ?? defaultRange
|
|
121
123
|
};
|
|
122
124
|
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector && !!selectBy.vectorSearchString) {
|
|
123
125
|
const { embeddings, dimension } = await this.embedMessageContent(selectBy.vectorSearchString);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/memory",
|
|
3
|
-
"version": "0.3.1-alpha.
|
|
3
|
+
"version": "0.3.1-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"redis": "^4.7.0",
|
|
42
42
|
"xxhash-wasm": "^1.1.0",
|
|
43
43
|
"zod": "^3.24.2",
|
|
44
|
-
"@mastra/core": "^0.9.1-alpha.
|
|
44
|
+
"@mastra/core": "^0.9.1-alpha.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@ai-sdk/openai": "^1.3.3",
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { deepMerge } from '@mastra/core';
|
|
1
|
+
import { deepMerge, memoryDefaultOptions } from '@mastra/core';
|
|
2
2
|
import type { AiMessageType, CoreMessage, CoreTool } from '@mastra/core';
|
|
3
3
|
import { MastraMemory } from '@mastra/core/memory';
|
|
4
4
|
import type { MessageType, MemoryConfig, SharedMemoryConfig, StorageThreadType } from '@mastra/core/memory';
|
|
@@ -66,15 +66,18 @@ export class Memory extends MastraMemory {
|
|
|
66
66
|
|
|
67
67
|
const config = this.getMergedThreadConfig(threadConfig || {});
|
|
68
68
|
|
|
69
|
+
const defaultRange = memoryDefaultOptions.semanticRecall.messageRange;
|
|
70
|
+
const defaultTopK = memoryDefaultOptions.semanticRecall.topK;
|
|
71
|
+
|
|
69
72
|
const vectorConfig =
|
|
70
73
|
typeof config?.semanticRecall === `boolean`
|
|
71
74
|
? {
|
|
72
|
-
topK:
|
|
73
|
-
messageRange:
|
|
75
|
+
topK: defaultTopK,
|
|
76
|
+
messageRange: defaultRange,
|
|
74
77
|
}
|
|
75
78
|
: {
|
|
76
|
-
topK: config?.semanticRecall?.topK ??
|
|
77
|
-
messageRange: config?.semanticRecall?.messageRange ??
|
|
79
|
+
topK: config?.semanticRecall?.topK ?? defaultTopK,
|
|
80
|
+
messageRange: config?.semanticRecall?.messageRange ?? defaultRange,
|
|
78
81
|
};
|
|
79
82
|
|
|
80
83
|
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector && !!selectBy.vectorSearchString) {
|