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

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,351 @@
1
1
  # @mastra/memory
2
2
 
3
+ ## 0.0.2-alpha.50
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [dd6d87f]
8
+ - Updated dependencies [04434b6]
9
+ - @mastra/core@0.1.27-alpha.70
10
+
11
+ ## 0.0.2-alpha.49
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [1944807]
16
+ - Updated dependencies [9ade36e]
17
+ - @mastra/core@0.1.27-alpha.69
18
+
19
+ ## 0.0.2-alpha.48
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies [0be7181]
24
+ - Updated dependencies [0be7181]
25
+ - @mastra/core@0.1.27-alpha.68
26
+
27
+ ## 0.0.2-alpha.47
28
+
29
+ ### Patch Changes
30
+
31
+ - Updated dependencies [c8ff2f5]
32
+ - @mastra/core@0.1.27-alpha.67
33
+
34
+ ## 0.0.2-alpha.46
35
+
36
+ ### Patch Changes
37
+
38
+ - Updated dependencies [14064f2]
39
+ - @mastra/core@0.1.27-alpha.66
40
+
41
+ ## 0.0.2-alpha.45
42
+
43
+ ### Patch Changes
44
+
45
+ - Updated dependencies [e66643a]
46
+ - @mastra/core@0.1.27-alpha.65
47
+
48
+ ## 0.0.2-alpha.44
49
+
50
+ ### Patch Changes
51
+
52
+ - Updated dependencies [f368477]
53
+ - Updated dependencies [d5ec619]
54
+ - @mastra/core@0.1.27-alpha.64
55
+
56
+ ## 0.0.2-alpha.43
57
+
58
+ ### Patch Changes
59
+
60
+ - Updated dependencies [e097800]
61
+ - @mastra/core@0.1.27-alpha.63
62
+
63
+ ## 0.0.2-alpha.42
64
+
65
+ ### Patch Changes
66
+
67
+ - Updated dependencies [93a3719]
68
+ - @mastra/core@0.1.27-alpha.62
69
+
70
+ ## 0.0.2-alpha.41
71
+
72
+ ### Patch Changes
73
+
74
+ - Updated dependencies [dc90663]
75
+ - @mastra/core@0.1.27-alpha.61
76
+
77
+ ## 0.0.2-alpha.40
78
+
79
+ ### Patch Changes
80
+
81
+ - Updated dependencies [3967e69]
82
+ - @mastra/core@0.1.27-alpha.60
83
+
84
+ ## 0.0.2-alpha.39
85
+
86
+ ### Patch Changes
87
+
88
+ - Updated dependencies [b524c22]
89
+ - @mastra/core@0.1.27-alpha.59
90
+
91
+ ## 0.0.2-alpha.38
92
+
93
+ ### Patch Changes
94
+
95
+ - Updated dependencies [1874f40]
96
+ - Updated dependencies [4b1ce2c]
97
+ - @mastra/core@0.1.27-alpha.58
98
+
99
+ ## 0.0.2-alpha.37
100
+
101
+ ### Patch Changes
102
+
103
+ - Updated dependencies [fd494a3]
104
+ - @mastra/core@0.1.27-alpha.57
105
+
106
+ ## 0.0.2-alpha.36
107
+
108
+ ### Patch Changes
109
+
110
+ - Updated dependencies [9f3ab05]
111
+ - @mastra/core@0.1.27-alpha.56
112
+
113
+ ## 0.0.2-alpha.35
114
+
115
+ ### Patch Changes
116
+
117
+ - 837a288: MAJOR Revamp of tools, workflows, syncs.
118
+ - 0b74006: Workflow updates
119
+ - Updated dependencies [592e3cf]
120
+ - Updated dependencies [837a288]
121
+ - Updated dependencies [0b74006]
122
+ - @mastra/core@0.1.27-alpha.55
123
+
124
+ ## 0.0.2-alpha.34
125
+
126
+ ### Patch Changes
127
+
128
+ - Updated dependencies [d2cd535]
129
+ - @mastra/core@0.1.27-alpha.54
130
+
131
+ ## 0.0.2-alpha.33
132
+
133
+ ### Patch Changes
134
+
135
+ - Updated dependencies [8e7814f]
136
+ - @mastra/core@0.1.27-alpha.53
137
+
138
+ ## 0.0.2-alpha.32
139
+
140
+ ### Patch Changes
141
+
142
+ - Updated dependencies [eedb829]
143
+ - @mastra/core@0.1.27-alpha.52
144
+
145
+ ## 0.0.2-alpha.31
146
+
147
+ ### Patch Changes
148
+
149
+ - Updated dependencies [a7b016d]
150
+ - Updated dependencies [da2e8d3]
151
+ - Updated dependencies [538a136]
152
+ - @mastra/core@0.1.27-alpha.51
153
+
154
+ ## 0.0.2-alpha.30
155
+
156
+ ### Patch Changes
157
+
158
+ - Updated dependencies [401a4d9]
159
+ - @mastra/core@0.1.27-alpha.50
160
+
161
+ ## 0.0.2-alpha.29
162
+
163
+ ### Patch Changes
164
+
165
+ - Updated dependencies [79acad0]
166
+ - Updated dependencies [f5dfa20]
167
+ - @mastra/core@0.1.27-alpha.49
168
+
169
+ ## 0.0.2-alpha.28
170
+
171
+ ### Patch Changes
172
+
173
+ - Updated dependencies [b726bf5]
174
+ - @mastra/core@0.1.27-alpha.48
175
+
176
+ ## 0.0.2-alpha.27
177
+
178
+ ### Patch Changes
179
+
180
+ - Updated dependencies [f6ba259]
181
+ - @mastra/core@0.1.27-alpha.47
182
+
183
+ ## 0.0.2-alpha.26
184
+
185
+ ### Patch Changes
186
+
187
+ - 8ae2bbc: Dane publishing
188
+ - 0bd142c: Fixes learned from docs
189
+ - ee4de15: Dane fixes
190
+ - Updated dependencies [8ae2bbc]
191
+ - Updated dependencies [0bd142c]
192
+ - Updated dependencies [ee4de15]
193
+ - @mastra/core@0.1.27-alpha.46
194
+
195
+ ## 0.0.2-alpha.25
196
+
197
+ ### Patch Changes
198
+
199
+ - 3220d26: Fix lastStep error in agent stream
200
+
201
+ ## 0.0.2-alpha.24
202
+
203
+ ### Patch Changes
204
+
205
+ - 002d6d8: add memory to playground agent
206
+ - Updated dependencies [e608d8c]
207
+ - Updated dependencies [002d6d8]
208
+ - @mastra/core@0.1.27-alpha.45
209
+
210
+ ## 0.0.2-alpha.23
211
+
212
+ ### Patch Changes
213
+
214
+ - Updated dependencies [2fa7f53]
215
+ - @mastra/core@0.1.27-alpha.44
216
+
217
+ ## 0.0.2-alpha.22
218
+
219
+ ### Patch Changes
220
+
221
+ - Updated dependencies [2e099d2]
222
+ - Updated dependencies [d6d8159]
223
+ - @mastra/core@0.1.27-alpha.43
224
+
225
+ ## 0.0.2-alpha.21
226
+
227
+ ### Patch Changes
228
+
229
+ - Updated dependencies [4a54c82]
230
+ - @mastra/core@0.1.27-alpha.42
231
+
232
+ ## 0.0.2-alpha.20
233
+
234
+ ### Patch Changes
235
+
236
+ - Updated dependencies [5cdfb88]
237
+ - @mastra/core@0.1.27-alpha.41
238
+
239
+ ## 0.0.2-alpha.19
240
+
241
+ ### Patch Changes
242
+
243
+ - Updated dependencies [9029796]
244
+ - @mastra/core@0.1.27-alpha.40
245
+
246
+ ## 0.0.2-alpha.18
247
+
248
+ ### Patch Changes
249
+
250
+ - Updated dependencies [2b01511]
251
+ - @mastra/core@0.1.27-alpha.39
252
+
253
+ ## 0.0.2-alpha.17
254
+
255
+ ### Patch Changes
256
+
257
+ - Updated dependencies [f031a1f]
258
+ - @mastra/core@0.1.27-alpha.38
259
+
260
+ ## 0.0.2-alpha.16
261
+
262
+ ### Patch Changes
263
+
264
+ - b5393f1: New example: Dane and many fixes to make it work
265
+ - Updated dependencies [c872875]
266
+ - Updated dependencies [f6da688]
267
+ - Updated dependencies [b5393f1]
268
+ - @mastra/core@0.1.27-alpha.37
269
+
270
+ ## 0.0.2-alpha.15
271
+
272
+ ### Patch Changes
273
+
274
+ - b898fad: Fix get context window in memory
275
+ - Updated dependencies [f537e33]
276
+ - Updated dependencies [bc40916]
277
+ - Updated dependencies [f7d1131]
278
+ - Updated dependencies [75bf3f0]
279
+ - Updated dependencies [3c4488b]
280
+ - Updated dependencies [d38f7a6]
281
+ - @mastra/core@0.1.27-alpha.36
282
+
283
+ ## 0.0.2-alpha.14
284
+
285
+ ### Patch Changes
286
+
287
+ - 033eda6: More fixes for refactor
288
+ - Updated dependencies [033eda6]
289
+ - @mastra/core@0.1.27-alpha.35
290
+
291
+ ## 0.0.2-alpha.13
292
+
293
+ ### Patch Changes
294
+
295
+ - 837a288: MAJOR Revamp of tools, workflows, syncs.
296
+ - Updated dependencies [837a288]
297
+ - Updated dependencies [5811de6]
298
+ - @mastra/core@0.1.27-alpha.34
299
+
300
+ ## 0.0.2-alpha.12
301
+
302
+ ### Patch Changes
303
+
304
+ - Updated dependencies [e1dd94a]
305
+ - @mastra/core@0.1.27-alpha.33
306
+
307
+ ## 0.0.2-alpha.11
308
+
309
+ ### Patch Changes
310
+
311
+ - Updated dependencies [2712098]
312
+ - @mastra/core@0.1.27-alpha.32
313
+
314
+ ## 0.0.2-alpha.10
315
+
316
+ ### Patch Changes
317
+
318
+ - Updated dependencies [c2dd6b5]
319
+ - @mastra/core@0.1.27-alpha.31
320
+
321
+ ## 0.0.2-alpha.9
322
+
323
+ ### Patch Changes
324
+
325
+ - Updated dependencies [963c15a]
326
+ - @mastra/core@0.1.27-alpha.30
327
+
328
+ ## 0.0.2-alpha.8
329
+
330
+ ### Patch Changes
331
+
332
+ - Updated dependencies [7d87a15]
333
+ - @mastra/core@0.1.27-alpha.29
334
+
335
+ ## 0.0.2-alpha.7
336
+
337
+ ### Patch Changes
338
+
339
+ - Updated dependencies [1ebd071]
340
+ - @mastra/core@0.1.27-alpha.28
341
+
342
+ ## 0.0.2-alpha.6
343
+
344
+ ### Patch Changes
345
+
346
+ - Updated dependencies [cd02c56]
347
+ - @mastra/core@0.1.27-alpha.27
348
+
3
349
  ## 0.0.2-alpha.5
4
350
 
5
351
  ### 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
  }