@mastra/memory 0.0.2-alpha.5 → 0.0.2-alpha.51

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 CHANGED
@@ -1,5 +1,357 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 0.0.2-alpha.51
4
+
5
+ ### Patch Changes
6
+
7
+ - bdaf834: publish packages
8
+
9
+ ## 0.0.2-alpha.50
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [dd6d87f]
14
+ - Updated dependencies [04434b6]
15
+ - @mastra/core@0.1.27-alpha.70
16
+
17
+ ## 0.0.2-alpha.49
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [1944807]
22
+ - Updated dependencies [9ade36e]
23
+ - @mastra/core@0.1.27-alpha.69
24
+
25
+ ## 0.0.2-alpha.48
26
+
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [0be7181]
30
+ - Updated dependencies [0be7181]
31
+ - @mastra/core@0.1.27-alpha.68
32
+
33
+ ## 0.0.2-alpha.47
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [c8ff2f5]
38
+ - @mastra/core@0.1.27-alpha.67
39
+
40
+ ## 0.0.2-alpha.46
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [14064f2]
45
+ - @mastra/core@0.1.27-alpha.66
46
+
47
+ ## 0.0.2-alpha.45
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [e66643a]
52
+ - @mastra/core@0.1.27-alpha.65
53
+
54
+ ## 0.0.2-alpha.44
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies [f368477]
59
+ - Updated dependencies [d5ec619]
60
+ - @mastra/core@0.1.27-alpha.64
61
+
62
+ ## 0.0.2-alpha.43
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [e097800]
67
+ - @mastra/core@0.1.27-alpha.63
68
+
69
+ ## 0.0.2-alpha.42
70
+
71
+ ### Patch Changes
72
+
73
+ - Updated dependencies [93a3719]
74
+ - @mastra/core@0.1.27-alpha.62
75
+
76
+ ## 0.0.2-alpha.41
77
+
78
+ ### Patch Changes
79
+
80
+ - Updated dependencies [dc90663]
81
+ - @mastra/core@0.1.27-alpha.61
82
+
83
+ ## 0.0.2-alpha.40
84
+
85
+ ### Patch Changes
86
+
87
+ - Updated dependencies [3967e69]
88
+ - @mastra/core@0.1.27-alpha.60
89
+
90
+ ## 0.0.2-alpha.39
91
+
92
+ ### Patch Changes
93
+
94
+ - Updated dependencies [b524c22]
95
+ - @mastra/core@0.1.27-alpha.59
96
+
97
+ ## 0.0.2-alpha.38
98
+
99
+ ### Patch Changes
100
+
101
+ - Updated dependencies [1874f40]
102
+ - Updated dependencies [4b1ce2c]
103
+ - @mastra/core@0.1.27-alpha.58
104
+
105
+ ## 0.0.2-alpha.37
106
+
107
+ ### Patch Changes
108
+
109
+ - Updated dependencies [fd494a3]
110
+ - @mastra/core@0.1.27-alpha.57
111
+
112
+ ## 0.0.2-alpha.36
113
+
114
+ ### Patch Changes
115
+
116
+ - Updated dependencies [9f3ab05]
117
+ - @mastra/core@0.1.27-alpha.56
118
+
119
+ ## 0.0.2-alpha.35
120
+
121
+ ### Patch Changes
122
+
123
+ - 837a288: MAJOR Revamp of tools, workflows, syncs.
124
+ - 0b74006: Workflow updates
125
+ - Updated dependencies [592e3cf]
126
+ - Updated dependencies [837a288]
127
+ - Updated dependencies [0b74006]
128
+ - @mastra/core@0.1.27-alpha.55
129
+
130
+ ## 0.0.2-alpha.34
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies [d2cd535]
135
+ - @mastra/core@0.1.27-alpha.54
136
+
137
+ ## 0.0.2-alpha.33
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies [8e7814f]
142
+ - @mastra/core@0.1.27-alpha.53
143
+
144
+ ## 0.0.2-alpha.32
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies [eedb829]
149
+ - @mastra/core@0.1.27-alpha.52
150
+
151
+ ## 0.0.2-alpha.31
152
+
153
+ ### Patch Changes
154
+
155
+ - Updated dependencies [a7b016d]
156
+ - Updated dependencies [da2e8d3]
157
+ - Updated dependencies [538a136]
158
+ - @mastra/core@0.1.27-alpha.51
159
+
160
+ ## 0.0.2-alpha.30
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [401a4d9]
165
+ - @mastra/core@0.1.27-alpha.50
166
+
167
+ ## 0.0.2-alpha.29
168
+
169
+ ### Patch Changes
170
+
171
+ - Updated dependencies [79acad0]
172
+ - Updated dependencies [f5dfa20]
173
+ - @mastra/core@0.1.27-alpha.49
174
+
175
+ ## 0.0.2-alpha.28
176
+
177
+ ### Patch Changes
178
+
179
+ - Updated dependencies [b726bf5]
180
+ - @mastra/core@0.1.27-alpha.48
181
+
182
+ ## 0.0.2-alpha.27
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [f6ba259]
187
+ - @mastra/core@0.1.27-alpha.47
188
+
189
+ ## 0.0.2-alpha.26
190
+
191
+ ### Patch Changes
192
+
193
+ - 8ae2bbc: Dane publishing
194
+ - 0bd142c: Fixes learned from docs
195
+ - ee4de15: Dane fixes
196
+ - Updated dependencies [8ae2bbc]
197
+ - Updated dependencies [0bd142c]
198
+ - Updated dependencies [ee4de15]
199
+ - @mastra/core@0.1.27-alpha.46
200
+
201
+ ## 0.0.2-alpha.25
202
+
203
+ ### Patch Changes
204
+
205
+ - 3220d26: Fix lastStep error in agent stream
206
+
207
+ ## 0.0.2-alpha.24
208
+
209
+ ### Patch Changes
210
+
211
+ - 002d6d8: add memory to playground agent
212
+ - Updated dependencies [e608d8c]
213
+ - Updated dependencies [002d6d8]
214
+ - @mastra/core@0.1.27-alpha.45
215
+
216
+ ## 0.0.2-alpha.23
217
+
218
+ ### Patch Changes
219
+
220
+ - Updated dependencies [2fa7f53]
221
+ - @mastra/core@0.1.27-alpha.44
222
+
223
+ ## 0.0.2-alpha.22
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [2e099d2]
228
+ - Updated dependencies [d6d8159]
229
+ - @mastra/core@0.1.27-alpha.43
230
+
231
+ ## 0.0.2-alpha.21
232
+
233
+ ### Patch Changes
234
+
235
+ - Updated dependencies [4a54c82]
236
+ - @mastra/core@0.1.27-alpha.42
237
+
238
+ ## 0.0.2-alpha.20
239
+
240
+ ### Patch Changes
241
+
242
+ - Updated dependencies [5cdfb88]
243
+ - @mastra/core@0.1.27-alpha.41
244
+
245
+ ## 0.0.2-alpha.19
246
+
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [9029796]
250
+ - @mastra/core@0.1.27-alpha.40
251
+
252
+ ## 0.0.2-alpha.18
253
+
254
+ ### Patch Changes
255
+
256
+ - Updated dependencies [2b01511]
257
+ - @mastra/core@0.1.27-alpha.39
258
+
259
+ ## 0.0.2-alpha.17
260
+
261
+ ### Patch Changes
262
+
263
+ - Updated dependencies [f031a1f]
264
+ - @mastra/core@0.1.27-alpha.38
265
+
266
+ ## 0.0.2-alpha.16
267
+
268
+ ### Patch Changes
269
+
270
+ - b5393f1: New example: Dane and many fixes to make it work
271
+ - Updated dependencies [c872875]
272
+ - Updated dependencies [f6da688]
273
+ - Updated dependencies [b5393f1]
274
+ - @mastra/core@0.1.27-alpha.37
275
+
276
+ ## 0.0.2-alpha.15
277
+
278
+ ### Patch Changes
279
+
280
+ - b898fad: Fix get context window in memory
281
+ - Updated dependencies [f537e33]
282
+ - Updated dependencies [bc40916]
283
+ - Updated dependencies [f7d1131]
284
+ - Updated dependencies [75bf3f0]
285
+ - Updated dependencies [3c4488b]
286
+ - Updated dependencies [d38f7a6]
287
+ - @mastra/core@0.1.27-alpha.36
288
+
289
+ ## 0.0.2-alpha.14
290
+
291
+ ### Patch Changes
292
+
293
+ - 033eda6: More fixes for refactor
294
+ - Updated dependencies [033eda6]
295
+ - @mastra/core@0.1.27-alpha.35
296
+
297
+ ## 0.0.2-alpha.13
298
+
299
+ ### Patch Changes
300
+
301
+ - 837a288: MAJOR Revamp of tools, workflows, syncs.
302
+ - Updated dependencies [837a288]
303
+ - Updated dependencies [5811de6]
304
+ - @mastra/core@0.1.27-alpha.34
305
+
306
+ ## 0.0.2-alpha.12
307
+
308
+ ### Patch Changes
309
+
310
+ - Updated dependencies [e1dd94a]
311
+ - @mastra/core@0.1.27-alpha.33
312
+
313
+ ## 0.0.2-alpha.11
314
+
315
+ ### Patch Changes
316
+
317
+ - Updated dependencies [2712098]
318
+ - @mastra/core@0.1.27-alpha.32
319
+
320
+ ## 0.0.2-alpha.10
321
+
322
+ ### Patch Changes
323
+
324
+ - Updated dependencies [c2dd6b5]
325
+ - @mastra/core@0.1.27-alpha.31
326
+
327
+ ## 0.0.2-alpha.9
328
+
329
+ ### Patch Changes
330
+
331
+ - Updated dependencies [963c15a]
332
+ - @mastra/core@0.1.27-alpha.30
333
+
334
+ ## 0.0.2-alpha.8
335
+
336
+ ### Patch Changes
337
+
338
+ - Updated dependencies [7d87a15]
339
+ - @mastra/core@0.1.27-alpha.29
340
+
341
+ ## 0.0.2-alpha.7
342
+
343
+ ### Patch Changes
344
+
345
+ - Updated dependencies [1ebd071]
346
+ - @mastra/core@0.1.27-alpha.28
347
+
348
+ ## 0.0.2-alpha.6
349
+
350
+ ### Patch Changes
351
+
352
+ - Updated dependencies [cd02c56]
353
+ - @mastra/core@0.1.27-alpha.27
354
+
3
355
  ## 0.0.2-alpha.5
4
356
 
5
357
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,44 @@
1
+ Elastic License 2.0 (ELv2)
2
+
3
+ **Acceptance**
4
+ By using the software, you agree to all of the terms and conditions below.
5
+
6
+ **Copyright License**
7
+ The licensor grants you a non-exclusive, royalty-free, worldwide, non-sublicensable, non-transferable license to use, copy, distribute, make available, and prepare derivative works of the software, in each case subject to the limitations and conditions below
8
+
9
+ **Limitations**
10
+ You may not provide the software to third parties as a hosted or managed service, where the service provides users with access to any substantial set of the features or functionality of the software.
11
+
12
+ You may not move, change, disable, or circumvent the license key functionality in the software, and you may not remove or obscure any functionality in the software that is protected by the license key.
13
+
14
+ You may not alter, remove, or obscure any licensing, copyright, or other notices of the licensor in the software. Any use of the licensor’s trademarks is subject to applicable law.
15
+
16
+ **Patents**
17
+ The licensor grants you a license, under any patent claims the licensor can license, or becomes able to license, to make, have made, use, sell, offer for sale, import and have imported the software, in each case subject to the limitations and conditions in this license. This license does not cover any patent claims that you cause to be infringed by modifications or additions to the software. If you or your company make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
18
+
19
+ **Notices**
20
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms.
21
+
22
+ If you modify the software, you must include in any modified copies of the software prominent notices stating that you have modified the software.
23
+
24
+ **No Other Rights**
25
+ These terms do not imply any licenses other than those expressly granted in these terms.
26
+
27
+ **Termination**
28
+ If you use the software in violation of these terms, such use is not licensed, and your licenses will automatically terminate. If the licensor provides you with a notice of your violation, and you cease all violation of this license no later than 30 days after you receive that notice, your licenses will be reinstated retroactively. However, if you violate these terms after such reinstatement, any additional violation of these terms will cause your licenses to terminate automatically and permanently.
29
+
30
+ **No Liability**
31
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
32
+
33
+ **Definitions**
34
+ The _licensor_ is the entity offering these terms, and the _software_ is the software the licensor makes available under these terms, including any portion of it.
35
+
36
+ _you_ refers to the individual or entity agreeing to these terms.
37
+
38
+ _your company_ is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. _control_ means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
39
+
40
+ _your licenses_ are all the licenses granted to you for the software under these terms.
41
+
42
+ _use_ means anything you do with the software requiring one of your licenses.
43
+
44
+ _trademark_ means trademarks, service marks, and similar rights.
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './postgres';
2
2
  export * from './kv/upstash';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
@@ -1,6 +1,6 @@
1
- import { MastraMemory, MessageType as BaseMastraMessageType, ThreadType, MessageResponse } from '@mastra/core';
1
+ import { MastraMemory, MessageType as BaseMastraMessageType, ThreadType, MessageResponse, AiMessageType } from '@mastra/core';
2
2
  import { Redis } from '@upstash/redis';
3
- import { ToolResultPart, Message as AiMessage } from 'ai';
3
+ import { ToolResultPart } from 'ai';
4
4
  interface MessageType extends BaseMastraMessageType {
5
5
  tokens?: number;
6
6
  }
@@ -51,11 +51,11 @@ export declare class UpstashKVMemory extends MastraMemory {
51
51
  /**
52
52
  * Messages
53
53
  */
54
- getMessages({ threadId }: {
54
+ getMessages({ threadId, }: {
55
55
  threadId: string;
56
56
  }): Promise<{
57
57
  messages: MessageType[];
58
- uiMessages: AiMessage[];
58
+ uiMessages: AiMessageType[];
59
59
  }>;
60
60
  saveMessages({ messages }: {
61
61
  messages: MessageType[];
@@ -69,3 +69,4 @@ export declare class UpstashKVMemory extends MastraMemory {
69
69
  parseMessages(messages: MessageType[]): MessageType[];
70
70
  }
71
71
  export {};
72
+ //# sourceMappingURL=upstash.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstash.d.ts","sourceRoot":"","sources":["../../src/kv/upstash.ts"],"names":[],"mappings":"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"}
@@ -712,14 +712,14 @@ var PgMemory = /*#__PURE__*/function (_MastraMemory) {
712
712
  break;
713
713
  }
714
714
  _context8.next = 10;
715
- return client.query("WITH RankedMessages AS (\n SELECT *,\n SUM(tokens) OVER (ORDER BY created_at DESC) as running_total\n FROM mastra_messages\n WHERE thread_id = $1\n AND type = 'text'\n " + (startDate ? "AND created_at >= '" + startDate.toISOString() + "'" : '') + "\n " + (endDate ? "AND created_at <= '" + endDate.toISOString() + "'" : '') + "\n ORDER BY created_at DESC\n )\n SELECT id, \n content, \n role, \n type,\n created_at AS createdAt, \n thread_id AS threadId\n FROM RankedMessages\n WHERE running_total <= $2\n ORDER BY created_at ASC", [threadId, this.MAX_CONTEXT_TOKENS]);
715
+ return client.query("WITH RankedMessages AS (\n SELECT *,\n SUM(tokens) OVER (ORDER BY created_at DESC) as running_total\n FROM mastra_messages\n WHERE thread_id = $1\n " + (startDate ? "AND created_at >= '" + startDate.toISOString() + "'" : '') + "\n " + (endDate ? "AND created_at <= '" + endDate.toISOString() + "'" : '') + "\n ORDER BY created_at DESC\n )\n SELECT id, \n content, \n role, \n type,\n created_at AS createdAt, \n thread_id AS threadId\n FROM RankedMessages\n WHERE running_total <= $2\n ORDER BY created_at ASC", [threadId, this.MAX_CONTEXT_TOKENS]);
716
716
  case 10:
717
717
  _result = _context8.sent;
718
718
  console.log('Format', format);
719
719
  return _context8.abrupt("return", this.parseMessages(_result.rows));
720
720
  case 13:
721
721
  _context8.next = 15;
722
- return client.query("SELECT id, \n content, \n role, \n type,\n created_at AS createdAt, \n thread_id AS threadId\n FROM mastra_messages\n WHERE thread_id = $1\n AND type = 'text'\n " + (startDate ? "AND created_at >= '" + startDate.toISOString() + "'" : '') + "\n " + (endDate ? "AND created_at <= '" + endDate.toISOString() + "'" : '') + "\n ORDER BY created_at ASC", [threadId]);
722
+ return client.query("SELECT id, \n content, \n role, \n type,\n created_at AS createdAt, \n thread_id AS threadId\n FROM mastra_messages\n WHERE thread_id = $1\n " + (startDate ? "AND created_at >= '" + startDate.toISOString() + "'" : '') + "\n " + (endDate ? "AND created_at <= '" + endDate.toISOString() + "'" : '') + "\n ORDER BY created_at ASC", [threadId]);
723
723
  case 15:
724
724
  result = _context8.sent;
725
725
  console.log('Format', format);
@@ -1261,19 +1261,17 @@ var UpstashKVMemory = /*#__PURE__*/function (_MastraMemory) {
1261
1261
  }();
1262
1262
  _proto.getContextWindow = /*#__PURE__*/function () {
1263
1263
  var _getContextWindow = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_ref6) {
1264
- var threadId, startDate, endDate, _ref6$format, format, messagesKey, messages, filteredMessages, totalTokens, messagesWithinTokenLimit, _iterator, _step, _message$content$, message, content, tokens;
1264
+ var threadId, startDate, endDate, messagesKey, messages, filteredMessages, totalTokens, messagesWithinTokenLimit, _iterator, _step, _message$content$, message, content, tokens;
1265
1265
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
1266
1266
  while (1) switch (_context8.prev = _context8.next) {
1267
1267
  case 0:
1268
- threadId = _ref6.threadId, startDate = _ref6.startDate, endDate = _ref6.endDate, _ref6$format = _ref6.format, format = _ref6$format === void 0 ? 'raw' : _ref6$format;
1268
+ threadId = _ref6.threadId, startDate = _ref6.startDate, endDate = _ref6.endDate;
1269
1269
  messagesKey = this.getMessagesKey(threadId);
1270
1270
  _context8.next = 4;
1271
1271
  return this.kv.lrange(messagesKey, 0, -1);
1272
1272
  case 4:
1273
1273
  messages = _context8.sent;
1274
- filteredMessages = messages.filter(function (msg) {
1275
- return msg.type === 'text';
1276
- });
1274
+ filteredMessages = messages;
1277
1275
  if (startDate) {
1278
1276
  filteredMessages = filteredMessages.filter(function (msg) {
1279
1277
  return new Date(msg.createdAt) >= startDate;
@@ -1285,7 +1283,7 @@ var UpstashKVMemory = /*#__PURE__*/function (_MastraMemory) {
1285
1283
  });
1286
1284
  }
1287
1285
  if (!this.MAX_CONTEXT_TOKENS) {
1288
- _context8.next = 24;
1286
+ _context8.next = 23;
1289
1287
  break;
1290
1288
  }
1291
1289
  totalTokens = 0;
@@ -1314,12 +1312,10 @@ var UpstashKVMemory = /*#__PURE__*/function (_MastraMemory) {
1314
1312
  _context8.next = 12;
1315
1313
  break;
1316
1314
  case 22:
1317
- console.log('Format:', format);
1318
- // Return messages in chronological order
1319
1315
  return _context8.abrupt("return", this.parseMessages(messagesWithinTokenLimit));
1320
- case 24:
1316
+ case 23:
1321
1317
  return _context8.abrupt("return", this.parseMessages(filteredMessages));
1322
- case 25:
1318
+ case 24:
1323
1319
  case "end":
1324
1320
  return _context8.stop();
1325
1321
  }