openclaw-memory-decay 0.1.10 → 0.1.11

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +16 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-memory-decay",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "type": "module",
5
5
  "description": "OpenClaw memory plugin backed by memory-decay engine",
6
6
  "main": "./src/index.js",
package/src/index.ts CHANGED
@@ -304,6 +304,22 @@ const memoryDecayPlugin = {
304
304
  api.logger.error(`Auto-save failed: ${err}`);
305
305
  }
306
306
  });
307
+
308
+ api.on("message_sent", async (event, ctx) => {
309
+ const content = event.content;
310
+ if (!content || content.length < MIN_MESSAGE_LENGTH) return;
311
+
312
+ try {
313
+ await client.store({
314
+ text: content,
315
+ importance: 0.3,
316
+ mtype: "episode",
317
+ speaker: "assistant",
318
+ });
319
+ } catch (err) {
320
+ api.logger.error(`Auto-save failed: ${err}`);
321
+ }
322
+ });
307
323
  }
308
324
 
309
325
  // Compaction: save session summary before context is compressed