@mastra/memory 0.2.0 → 0.2.1-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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +8 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +2 -2
- package/src/index.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/memory@0.2.
|
|
2
|
+
> @mastra/memory@0.2.1-alpha.0 build /home/runner/work/mastra/mastra/packages/memory
|
|
3
3
|
> pnpm run check && tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @mastra/memory@0.2.
|
|
6
|
+
> @mastra/memory@0.2.1-alpha.0 check /home/runner/work/mastra/mastra/packages/memory
|
|
7
7
|
> tsc --noEmit
|
|
8
8
|
|
|
9
9
|
[34mCLI[39m Building entry: src/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 8908ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
15
|
[34mCLI[39m Target: es2022
|
|
16
16
|
Analysis will use the bundled TypeScript version 5.7.3
|
|
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.7.3
|
|
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 9605ms
|
|
21
21
|
[34mCLI[39m Cleaning output folder
|
|
22
22
|
[34mESM[39m Build start
|
|
23
23
|
[34mCJS[39m Build start
|
|
24
|
-
[
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
24
|
+
[32mESM[39m [1mdist/index.js [22m[32m12.85 KB[39m
|
|
25
|
+
[32mESM[39m ⚡️ Build success in 540ms
|
|
26
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m12.88 KB[39m
|
|
27
|
+
[32mCJS[39m ⚡️ Build success in 540ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 0.2.1-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3729dbd: Fixed a bug where useChat with client side tool calling and Memory would not work. Added docs for using Memory with useChat()
|
|
8
|
+
- Updated dependencies [3729dbd]
|
|
9
|
+
- @mastra/core@0.5.1-alpha.0
|
|
10
|
+
|
|
3
11
|
## 0.2.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -77,7 +77,7 @@ var Memory = class extends memory.MastraMemory {
|
|
|
77
77
|
topK: config?.semanticRecall?.topK ?? 2,
|
|
78
78
|
messageRange: config?.semanticRecall?.messageRange ?? { before: 2, after: 2 }
|
|
79
79
|
};
|
|
80
|
-
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector) {
|
|
80
|
+
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector && !!selectBy.vectorSearchString) {
|
|
81
81
|
const { embedding } = await ai.embed({
|
|
82
82
|
value: selectBy.vectorSearchString,
|
|
83
83
|
model: this.embedder
|
|
@@ -186,7 +186,7 @@ var Memory = class extends memory.MastraMemory {
|
|
|
186
186
|
if (this.vector && config.semanticRecall) {
|
|
187
187
|
const { indexName } = await this.createEmbeddingIndex();
|
|
188
188
|
for (const message of messages) {
|
|
189
|
-
if (typeof message.content !== `string`) continue;
|
|
189
|
+
if (typeof message.content !== `string` || message.content === "") continue;
|
|
190
190
|
const { embedding } = await ai.embed({ value: message.content, model: this.embedder, maxRetries: 3 });
|
|
191
191
|
await this.vector.upsert({
|
|
192
192
|
indexName,
|
package/dist/index.js
CHANGED
|
@@ -75,7 +75,7 @@ var Memory = class extends MastraMemory {
|
|
|
75
75
|
topK: config?.semanticRecall?.topK ?? 2,
|
|
76
76
|
messageRange: config?.semanticRecall?.messageRange ?? { before: 2, after: 2 }
|
|
77
77
|
};
|
|
78
|
-
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector) {
|
|
78
|
+
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector && !!selectBy.vectorSearchString) {
|
|
79
79
|
const { embedding } = await embed({
|
|
80
80
|
value: selectBy.vectorSearchString,
|
|
81
81
|
model: this.embedder
|
|
@@ -184,7 +184,7 @@ var Memory = class extends MastraMemory {
|
|
|
184
184
|
if (this.vector && config.semanticRecall) {
|
|
185
185
|
const { indexName } = await this.createEmbeddingIndex();
|
|
186
186
|
for (const message of messages) {
|
|
187
|
-
if (typeof message.content !== `string`) continue;
|
|
187
|
+
if (typeof message.content !== `string` || message.content === "") continue;
|
|
188
188
|
const { embedding } = await embed({ value: message.content, model: this.embedder, maxRetries: 3 });
|
|
189
189
|
await this.vector.upsert({
|
|
190
190
|
indexName,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/memory",
|
|
3
|
-
"version": "0.2.0",
|
|
3
|
+
"version": "0.2.1-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"postgres": "^3.4.5",
|
|
50
50
|
"redis": "^4.7.0",
|
|
51
51
|
"zod": "^3.24.2",
|
|
52
|
-
"@mastra/core": "^0.5.0"
|
|
52
|
+
"@mastra/core": "^0.5.1-alpha.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@microsoft/api-extractor": "^7.52.1",
|
package/src/index.ts
CHANGED
|
@@ -71,7 +71,7 @@ export class Memory extends MastraMemory {
|
|
|
71
71
|
messageRange: config?.semanticRecall?.messageRange ?? { before: 2, after: 2 },
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector) {
|
|
74
|
+
if (config?.semanticRecall && selectBy?.vectorSearchString && this.vector && !!selectBy.vectorSearchString) {
|
|
75
75
|
const { embedding } = await embed({
|
|
76
76
|
value: selectBy.vectorSearchString,
|
|
77
77
|
model: this.embedder,
|
|
@@ -239,7 +239,7 @@ export class Memory extends MastraMemory {
|
|
|
239
239
|
const { indexName } = await this.createEmbeddingIndex();
|
|
240
240
|
|
|
241
241
|
for (const message of messages) {
|
|
242
|
-
if (typeof message.content !== `string`) continue;
|
|
242
|
+
if (typeof message.content !== `string` || message.content === '') continue;
|
|
243
243
|
const { embedding } = await embed({ value: message.content, model: this.embedder, maxRetries: 3 });
|
|
244
244
|
await this.vector.upsert({
|
|
245
245
|
indexName,
|