@mastra/memory 0.1.0-alpha.78 → 0.1.0-alpha.80
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/CHANGELOG.md +22 -0
- package/dist/index.js +5 -5
- package/package.json +3 -3
- package/src/index.ts +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @mastra/memory
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.80
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 70dabd9: Fix broken publish
|
|
8
|
+
- Updated dependencies [70dabd9]
|
|
9
|
+
- Updated dependencies [202d404]
|
|
10
|
+
- @mastra/core@0.2.0-alpha.98
|
|
11
|
+
|
|
12
|
+
## 0.1.0-alpha.79
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- a870123: Added local embedder class that uses fastembed-js, a Typescript/NodeJS implementation of @Qdrant/fastembed
|
|
17
|
+
- Updated dependencies [07c069d]
|
|
18
|
+
- Updated dependencies [7892533]
|
|
19
|
+
- Updated dependencies [e6d8055]
|
|
20
|
+
- Updated dependencies [5950de5]
|
|
21
|
+
- Updated dependencies [df843d3]
|
|
22
|
+
- Updated dependencies [a870123]
|
|
23
|
+
- @mastra/core@0.2.0-alpha.97
|
|
24
|
+
|
|
3
25
|
## 0.1.0-alpha.78
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -76,8 +76,8 @@ ${embedderExample}`
|
|
|
76
76
|
value: selectBy.vectorSearchString,
|
|
77
77
|
model: embedder
|
|
78
78
|
});
|
|
79
|
-
await this.
|
|
80
|
-
vectorResults = await this.vector.query(
|
|
79
|
+
const { indexName } = await this.createEmbeddingIndex();
|
|
80
|
+
vectorResults = await this.vector.query(indexName, embedding, vectorConfig.topK, {
|
|
81
81
|
thread_id: threadId
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -162,13 +162,13 @@ ${embedderExample}`
|
|
|
162
162
|
await this.saveWorkingMemory(messages);
|
|
163
163
|
this.mutateMessagesToHideWorkingMemory(messages);
|
|
164
164
|
if (this.vector) {
|
|
165
|
-
|
|
165
|
+
const embedder = this.getEmbedder();
|
|
166
|
+
const { indexName } = await this.createEmbeddingIndex();
|
|
166
167
|
for (const message of messages) {
|
|
167
168
|
if (typeof message.content !== `string`) continue;
|
|
168
|
-
const embedder = this.getEmbedder();
|
|
169
169
|
const { embedding } = await embed({ value: message.content, model: embedder, maxRetries: 3 });
|
|
170
170
|
await this.vector.upsert(
|
|
171
|
-
|
|
171
|
+
indexName,
|
|
172
172
|
[embedding],
|
|
173
173
|
[
|
|
174
174
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/memory",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.80",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"pg-pool": "^3.7.0",
|
|
37
37
|
"postgres": "^3.4.5",
|
|
38
38
|
"redis": "^4.7.0",
|
|
39
|
-
"@mastra/core": "^0.2.0-alpha.
|
|
39
|
+
"@mastra/core": "^0.2.0-alpha.98"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@babel/preset-env": "^7.26.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"scripts": {
|
|
51
51
|
"check": "tsc --noEmit",
|
|
52
52
|
"build": "pnpm run check && tsup src/index.ts --format esm --dts --clean --treeshake",
|
|
53
|
-
"
|
|
53
|
+
"build:watch": "pnpm build --watch",
|
|
54
54
|
"test:integration": "cd integration-tests && pnpm run test",
|
|
55
55
|
"test": "pnpm test:integration"
|
|
56
56
|
}
|
package/src/index.ts
CHANGED
|
@@ -94,8 +94,9 @@ ${embedderExample}`,
|
|
|
94
94
|
model: embedder,
|
|
95
95
|
});
|
|
96
96
|
|
|
97
|
-
await this.
|
|
98
|
-
|
|
97
|
+
const { indexName } = await this.createEmbeddingIndex();
|
|
98
|
+
|
|
99
|
+
vectorResults = await this.vector.query(indexName, embedding, vectorConfig.topK, {
|
|
99
100
|
thread_id: threadId,
|
|
100
101
|
});
|
|
101
102
|
}
|
|
@@ -226,13 +227,14 @@ ${embedderExample}`,
|
|
|
226
227
|
this.mutateMessagesToHideWorkingMemory(messages);
|
|
227
228
|
|
|
228
229
|
if (this.vector) {
|
|
229
|
-
|
|
230
|
+
const embedder = this.getEmbedder();
|
|
231
|
+
const { indexName } = await this.createEmbeddingIndex();
|
|
232
|
+
|
|
230
233
|
for (const message of messages) {
|
|
231
234
|
if (typeof message.content !== `string`) continue;
|
|
232
|
-
const embedder = this.getEmbedder();
|
|
233
235
|
const { embedding } = await embed({ value: message.content, model: embedder, maxRetries: 3 });
|
|
234
236
|
await this.vector.upsert(
|
|
235
|
-
|
|
237
|
+
indexName,
|
|
236
238
|
[embedding],
|
|
237
239
|
[
|
|
238
240
|
{
|