@t0ken.ai/memoryx-openclaw-plugin 1.1.16 → 1.1.18

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/README.md CHANGED
@@ -4,11 +4,43 @@ Official MemoryX plugin for OpenClaw. Enables long-term memory for agents by rec
4
4
 
5
5
  ## Features
6
6
 
7
- - **Recall**: `before_agent_start` → semantic search for relevant memories
8
- - **Add**: `message_received` + `assistant_response` → buffer and flush to MemoryX API
7
+ - **Auto Recall**: `before_agent_start` → semantic search for relevant memories
8
+ - **Auto Capture**: `message_received` + `assistant_response` → buffer and flush to MemoryX API
9
+ - **Function Calling**: LLM can actively search, list, and delete memories
9
10
  - **Auto Registration**: Agents auto-register with machine fingerprint
10
11
  - **Conversation Buffer**: Smart buffering with token counting and round-based flushing
11
12
 
13
+ ## Function Calling Tools
14
+
15
+ The plugin registers three tools that LLM can call during conversations:
16
+
17
+ | Tool | Description | When to Use |
18
+ |------|-------------|-------------|
19
+ | `memoryx_recall` | Search through long-term memories | User asks "do you remember X?" or needs context |
20
+ | `memoryx_store` | Save important information to memory | User says "remember this" or you identify important info |
21
+ | `memoryx_list` | List all stored memories | User asks "what do you remember about me?" |
22
+ | `memoryx_forget` | Delete a specific memory | User asks to forget/remove something |
23
+
24
+ ### memoryx_store Parameters
25
+
26
+ | Parameter | Type | Required | Description |
27
+ |-----------|------|----------|-------------|
28
+ | `content` | string | Yes | The information to remember (server will auto-categorize) |
29
+
30
+ ### Example Usage
31
+
32
+ **User**: "What do you remember about my preferences?"
33
+ **LLM**: *calls `memoryx_list`* → Returns list of stored memories
34
+
35
+ **User**: "Did I ever mention my favorite color?"
36
+ **LLM**: *calls `memoryx_recall` with query="favorite color"* → Searches and returns relevant memories
37
+
38
+ **User**: "Please forget about my old address"
39
+ **LLM**: *calls `memoryx_forget` with memory_id* → Deletes the memory
40
+
41
+ **User**: "Remember that my favorite color is blue"
42
+ **LLM**: *calls `memoryx_store` with content="User's favorite color is blue"* → Stores the memory
43
+
12
44
  ## Install
13
45
 
14
46
  ```bash
package/dist/index.d.ts CHANGED
@@ -82,6 +82,12 @@ declare class MemoryXPlugin {
82
82
  recall(query: string, limit?: number): Promise<RecallResult>;
83
83
  endConversation(): Promise<void>;
84
84
  forget(memoryId: string): Promise<boolean>;
85
+ store(content: string): Promise<{
86
+ success: boolean;
87
+ task_id?: string;
88
+ duplicate?: boolean;
89
+ existing?: string;
90
+ }>;
85
91
  list(limit?: number): Promise<any[]>;
86
92
  getStatus(): Promise<{
87
93
  initialized: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAqDH,UAAU,YAAY;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAiBD,UAAU,YAAY;IAClB,QAAQ,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,eAAe,EAAE,KAAK,CAAC;QACnB,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AA0JD,cAAM,mBAAmB;IACrB,OAAO,CAAC,qBAAqB,CAAc;IAC3C,OAAO,CAAC,qBAAqB,CAAyC;IACtE,OAAO,CAAC,cAAc,CAAsB;IAE5C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAK;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkB;;IAM7C,OAAO,CAAC,UAAU;IAIlB,iBAA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AAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAqC/G,IAAI,CAAC,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAuCxC,SAAS,IAAI,OAAO,CAAC;QAC9B,WAAW,EAAE,OAAO,CAAC;QACrB,SAAS,EAAE,OAAO,CAAC;QACnB,kBAAkB,EAAE;YAAE,YAAY,EAAE,MAAM,CAAC;YAAC,cAAc,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KACvF,CAAC;CAQL;;;;;;kBAUiB,GAAG,iBAAiB,YAAY,GAAG,IAAI;;AANzD,wBAuUE;AAEF,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -516,6 +516,39 @@ class MemoryXPlugin {
516
516
  return false;
517
517
  }
518
518
  }
519
+ async store(content) {
520
+ this.init();
521
+ if (!this.config.apiKey) {
522
+ log("Store failed: no API key");
523
+ return { success: false };
524
+ }
525
+ try {
526
+ const response = await fetch(`${this.apiBase}/v1/memories`, {
527
+ method: "POST",
528
+ headers: {
529
+ "Content-Type": "application/json",
530
+ "X-API-Key": this.config.apiKey
531
+ },
532
+ body: JSON.stringify({
533
+ content,
534
+ project_id: this.config.projectId,
535
+ metadata: { source: "function_call" }
536
+ })
537
+ });
538
+ if (!response.ok) {
539
+ const errorData = await response.json().catch(() => ({}));
540
+ log(`Store failed: ${response.status} ${JSON.stringify(errorData)}`);
541
+ return { success: false };
542
+ }
543
+ const data = await response.json();
544
+ log(`Stored memory, task_id: ${data.task_id}`);
545
+ return { success: true, task_id: data.task_id };
546
+ }
547
+ catch (e) {
548
+ log(`Store failed: ${e}`);
549
+ return { success: false };
550
+ }
551
+ }
519
552
  async list(limit = 10) {
520
553
  this.init();
521
554
  if (!this.config.apiKey) {
@@ -564,7 +597,7 @@ let plugin;
564
597
  export default {
565
598
  id: "memoryx-openclaw-plugin",
566
599
  name: "MemoryX Realtime Plugin",
567
- version: "1.1.16",
600
+ version: "1.1.18",
568
601
  description: "Real-time memory capture and recall for OpenClaw",
569
602
  register(api, pluginConfig) {
570
603
  api.logger.info("[MemoryX] Plugin registering...");
@@ -691,6 +724,63 @@ export default {
691
724
  }
692
725
  }
693
726
  }, { name: "memoryx_forget" });
727
+ api.registerTool({
728
+ name: "memoryx_store",
729
+ label: "MemoryX Store",
730
+ description: "Save important information to long-term memory. Use when user explicitly asks to remember something, or when you identify important user preferences, facts, or decisions that should be persisted. The server will automatically categorize the memory.",
731
+ parameters: {
732
+ type: "object",
733
+ properties: {
734
+ content: {
735
+ type: "string",
736
+ description: "The information to remember. Should be a clear, concise statement. Examples: 'User prefers dark mode in all applications', 'User birthday is January 15th', 'User works as a software engineer at Acme Corp'"
737
+ }
738
+ },
739
+ required: ["content"]
740
+ },
741
+ async execute(_toolCallId, params) {
742
+ const { content } = params;
743
+ if (!plugin) {
744
+ return {
745
+ content: [{ type: "text", text: "MemoryX plugin not initialized." }],
746
+ details: { error: "not_initialized" }
747
+ };
748
+ }
749
+ if (!content || content.trim().length < 5) {
750
+ return {
751
+ content: [{ type: "text", text: "Content too short. Please provide more meaningful information to remember." }],
752
+ details: { error: "content_too_short" }
753
+ };
754
+ }
755
+ try {
756
+ const result = await plugin.store(content.trim());
757
+ if (result.success) {
758
+ return {
759
+ content: [{ type: "text", text: `Stored: "${content.slice(0, 100)}${content.length > 100 ? '...' : ''}"` }],
760
+ details: { action: "stored", task_id: result.task_id }
761
+ };
762
+ }
763
+ else if (result.duplicate) {
764
+ return {
765
+ content: [{ type: "text", text: `Similar memory already exists: "${result.existing}"` }],
766
+ details: { action: "duplicate" }
767
+ };
768
+ }
769
+ else {
770
+ return {
771
+ content: [{ type: "text", text: "Failed to store memory. Please try again." }],
772
+ details: { error: "store_failed" }
773
+ };
774
+ }
775
+ }
776
+ catch (error) {
777
+ return {
778
+ content: [{ type: "text", text: `Failed to store memory: ${error.message}` }],
779
+ details: { error: error.message }
780
+ };
781
+ }
782
+ }
783
+ }, { name: "memoryx_store" });
694
784
  api.registerTool({
695
785
  name: "memoryx_list",
696
786
  label: "MemoryX List",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "memoryx-openclaw-plugin",
3
3
  "name": "MemoryX Real-time Plugin",
4
- "version": "1.1.15",
4
+ "version": "1.1.18",
5
5
  "description": "Real-time memory capture and recall for OpenClaw",
6
6
  "kind": "memory",
7
7
  "main": "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@t0ken.ai/memoryx-openclaw-plugin",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "MemoryX real-time memory capture and recall plugin for OpenClaw",
5
5
  "type": "module",
6
6
  "author": "MemoryX Team",