@memoryrelay/plugin-memoryrelay-ai 0.12.6 → 0.12.8

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
@@ -677,6 +677,57 @@ curl -X POST https://api.memoryrelay.net/v1/memories \
677
677
 
678
678
  ## Changelog
679
679
 
680
+ ### v0.12.7 (2026-03-06)
681
+
682
+ **🎯 Tool Factory Pattern Fix - Session Tracking Now Works!**
683
+
684
+ - **FIX**: Converted all 39 tools from direct registration to factory pattern for context access
685
+ - **FIX**: Session tracking now works - `ctx.sessionId` properly captured via factory closure
686
+ - **CHANGE**: Tools now registered via `api.registerTool((ctx) => tool)` instead of direct objects
687
+ - **CHANGE**: Removed unused `context?` parameter from execute functions
688
+ - **ROOT CAUSE**: OpenClaw passes context to tool factories at registration time, NOT to execute functions
689
+ - **EVIDENCE**: Examined OpenClaw core source code (`src/plugins/types.ts`, `OpenClawPluginToolFactory`)
690
+ - **AUTOMATION**: Python script converted all 39 tools automatically
691
+ - **IMPACT**: Session-memory linking finally works end-to-end
692
+ - **BACKWARD COMPAT**: Fully compatible, no breaking changes, graceful degradation
693
+ - **RELATED**: Closes #26, part of session tracking fix chain (#24, #25, #226)
694
+
695
+ **Files changed**: 7 files, 5,176 insertions(+), 246 deletions(-)
696
+ **Implementation time**: 1.5 hours
697
+ **Total investigation**: ~7 hours across 6 sessions
698
+
699
+ ### v0.12.6 (2026-03-06)
700
+
701
+ **⚠️ Wrong Approach - Superseded by v0.12.7**
702
+
703
+ - **ATTEMPT**: Added context parameter to execute functions
704
+ - **ISSUE**: OpenClaw doesn't pass context to execute - wrong pattern
705
+ - **LESSON**: Should have checked OpenClaw source code first
706
+
707
+ ### v0.12.5 (2026-03-06)
708
+
709
+ **🔧 Version String Sync**
710
+
711
+ - **FIX**: Synchronized all version strings across package.json, openclaw.plugin.json, and index.ts
712
+ - **IMPACT**: Gateway now displays correct version (v0.12.5)
713
+
714
+ ### v0.12.4 (2026-03-06)
715
+
716
+ **❌ Failed Release**
717
+
718
+ - **ISSUE**: Created git tag before pushing version bump commit
719
+ - **RESULT**: Published to npm without version string updates
720
+ - **LESSON**: Always push commits before tagging releases
721
+
722
+ ### v0.12.3 (2026-03-06)
723
+
724
+ **🔗 Session Tracking - Plugin Fix**
725
+
726
+ - **FIX**: Extract session_id from metadata and pass as top-level parameter to API
727
+ - **CHANGE**: Backend expects `{ session_id, content, metadata }`, not `{ content, metadata: { session_id } }`
728
+ - **IMPACT**: Memories now correctly link to sessions in database
729
+ - **RELATED**: Backend fixed in PR #225, plugin integration fixed here
730
+
680
731
  ### v0.12.2 (2026-03-06)
681
732
 
682
733
  **📚 Documentation & Maintenance Release**
package/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * OpenClaw Memory Plugin - MemoryRelay
3
- * Version: 0.12.6 (Session Context Integration)
3
+ * Version: 0.12.8 (Session Context Integration)
4
4
  *
5
5
  * Long-term memory with vector search using MemoryRelay API.
6
6
  * Provides auto-recall and auto-capture via lifecycle hooks.
@@ -1483,8 +1483,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1483
1483
  // 1. memory_store
1484
1484
  // --------------------------------------------------------------------------
1485
1485
  if (isToolEnabled("memory_store")) {
1486
- api.registerTool(
1487
- {
1486
+ api.registerTool((ctx) => ({
1487
+
1488
1488
  name: "memory_store",
1489
1489
  description:
1490
1490
  "Store a new memory in MemoryRelay. Use this to save important information, facts, preferences, or context that should be remembered for future conversations." +
@@ -1537,13 +1537,6 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1537
1537
  importance?: number;
1538
1538
  tier?: string;
1539
1539
  },
1540
- context?: {
1541
- sessionId?: string;
1542
- agentId?: string;
1543
- sessionKey?: string;
1544
- workspaceDir?: string;
1545
- config?: any;
1546
- },
1547
1540
  ) => {
1548
1541
  try {
1549
1542
  const { content, metadata, ...opts } = args;
@@ -1551,7 +1544,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1551
1544
  // Inject sessionId from OpenClaw context into metadata
1552
1545
  const enrichedMetadata = {
1553
1546
  ...metadata,
1554
- ...(context?.sessionId && { session_id: context.sessionId }),
1547
+ ...(ctx.sessionId && { session_id: ctx.sessionId }),
1555
1548
  };
1556
1549
 
1557
1550
  if (!opts.project && defaultProject) opts.project = defaultProject;
@@ -1572,7 +1565,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1572
1565
  };
1573
1566
  }
1574
1567
  },
1575
- },
1568
+ }),
1576
1569
  { name: "memory_store" },
1577
1570
  );
1578
1571
  }
@@ -1581,8 +1574,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1581
1574
  // 2. memory_recall
1582
1575
  // --------------------------------------------------------------------------
1583
1576
  if (isToolEnabled("memory_recall")) {
1584
- api.registerTool(
1585
- {
1577
+ api.registerTool((ctx) => ({
1578
+
1586
1579
  name: "memory_recall",
1587
1580
  description:
1588
1581
  "Search memories using natural language. Returns the most relevant memories based on semantic similarity to the query." +
@@ -1694,7 +1687,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1694
1687
  };
1695
1688
  }
1696
1689
  },
1697
- },
1690
+ }),
1698
1691
  { name: "memory_recall" },
1699
1692
  );
1700
1693
  }
@@ -1703,8 +1696,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1703
1696
  // 3. memory_forget
1704
1697
  // --------------------------------------------------------------------------
1705
1698
  if (isToolEnabled("memory_forget")) {
1706
- api.registerTool(
1707
- {
1699
+ api.registerTool((ctx) => ({
1700
+
1708
1701
  name: "memory_forget",
1709
1702
  description: "Delete a memory by ID, or search by query to find candidates. Provide memoryId for direct deletion, or query to search first. A single high-confidence match (>0.9) is auto-deleted; otherwise candidates are listed for you to choose.",
1710
1703
  parameters: {
@@ -1777,7 +1770,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1777
1770
  details: { error: "missing_param" },
1778
1771
  };
1779
1772
  },
1780
- },
1773
+ }),
1781
1774
  { name: "memory_forget" },
1782
1775
  );
1783
1776
  }
@@ -1786,8 +1779,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1786
1779
  // 4. memory_list
1787
1780
  // --------------------------------------------------------------------------
1788
1781
  if (isToolEnabled("memory_list")) {
1789
- api.registerTool(
1790
- {
1782
+ api.registerTool((ctx) => ({
1783
+
1791
1784
  name: "memory_list",
1792
1785
  description: "List recent memories chronologically for this agent. Use to review what has been stored or to find memory IDs for update/delete operations.",
1793
1786
  parameters: {
@@ -1829,7 +1822,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1829
1822
  };
1830
1823
  }
1831
1824
  },
1832
- },
1825
+ }),
1833
1826
  { name: "memory_list" },
1834
1827
  );
1835
1828
  }
@@ -1838,8 +1831,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1838
1831
  // 5. memory_get
1839
1832
  // --------------------------------------------------------------------------
1840
1833
  if (isToolEnabled("memory_get")) {
1841
- api.registerTool(
1842
- {
1834
+ api.registerTool((ctx) => ({
1835
+
1843
1836
  name: "memory_get",
1844
1837
  description: "Retrieve a specific memory by its ID.",
1845
1838
  parameters: {
@@ -1866,7 +1859,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1866
1859
  };
1867
1860
  }
1868
1861
  },
1869
- },
1862
+ }),
1870
1863
  { name: "memory_get" },
1871
1864
  );
1872
1865
  }
@@ -1875,8 +1868,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1875
1868
  // 6. memory_update
1876
1869
  // --------------------------------------------------------------------------
1877
1870
  if (isToolEnabled("memory_update")) {
1878
- api.registerTool(
1879
- {
1871
+ api.registerTool((ctx) => ({
1872
+
1880
1873
  name: "memory_update",
1881
1874
  description: "Update the content of an existing memory. Use to correct or expand stored information.",
1882
1875
  parameters: {
@@ -1912,7 +1905,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1912
1905
  };
1913
1906
  }
1914
1907
  },
1915
- },
1908
+ }),
1916
1909
  { name: "memory_update" },
1917
1910
  );
1918
1911
  }
@@ -1921,8 +1914,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1921
1914
  // 7. memory_batch_store
1922
1915
  // --------------------------------------------------------------------------
1923
1916
  if (isToolEnabled("memory_batch_store")) {
1924
- api.registerTool(
1925
- {
1917
+ api.registerTool((ctx) => ({
1918
+
1926
1919
  name: "memory_batch_store",
1927
1920
  description: "Store multiple memories at once. More efficient than individual calls for bulk storage.",
1928
1921
  parameters: {
@@ -1969,7 +1962,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1969
1962
  };
1970
1963
  }
1971
1964
  },
1972
- },
1965
+ }),
1973
1966
  { name: "memory_batch_store" },
1974
1967
  );
1975
1968
  }
@@ -1978,8 +1971,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1978
1971
  // 8. memory_context
1979
1972
  // --------------------------------------------------------------------------
1980
1973
  if (isToolEnabled("memory_context")) {
1981
- api.registerTool(
1982
- {
1974
+ api.registerTool((ctx) => ({
1975
+
1983
1976
  name: "memory_context",
1984
1977
  description:
1985
1978
  "Build a context window from relevant memories, optimized for injecting into agent prompts with token budget awareness." +
@@ -2034,7 +2027,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2034
2027
  };
2035
2028
  }
2036
2029
  },
2037
- },
2030
+ }),
2038
2031
  { name: "memory_context" },
2039
2032
  );
2040
2033
  }
@@ -2043,8 +2036,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2043
2036
  // 9. memory_promote
2044
2037
  // --------------------------------------------------------------------------
2045
2038
  if (isToolEnabled("memory_promote")) {
2046
- api.registerTool(
2047
- {
2039
+ api.registerTool((ctx) => ({
2040
+
2048
2041
  name: "memory_promote",
2049
2042
  description:
2050
2043
  "Promote a memory by updating its importance score and/or tier. Use to ensure critical memories are retained longer.",
@@ -2088,7 +2081,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2088
2081
  };
2089
2082
  }
2090
2083
  },
2091
- },
2084
+ }),
2092
2085
  { name: "memory_promote" },
2093
2086
  );
2094
2087
  }
@@ -2097,8 +2090,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2097
2090
  // 10. entity_create
2098
2091
  // --------------------------------------------------------------------------
2099
2092
  if (isToolEnabled("entity_create")) {
2100
- api.registerTool(
2101
- {
2093
+ api.registerTool((ctx) => ({
2094
+
2102
2095
  name: "entity_create",
2103
2096
  description:
2104
2097
  "Create a named entity (person, place, organization, project, concept) for the knowledge graph. Entities help organize and connect memories.",
@@ -2139,7 +2132,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2139
2132
  };
2140
2133
  }
2141
2134
  },
2142
- },
2135
+ }),
2143
2136
  { name: "entity_create" },
2144
2137
  );
2145
2138
  }
@@ -2148,8 +2141,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2148
2141
  // 11. entity_link
2149
2142
  // --------------------------------------------------------------------------
2150
2143
  if (isToolEnabled("entity_link")) {
2151
- api.registerTool(
2152
- {
2144
+ api.registerTool((ctx) => ({
2145
+
2153
2146
  name: "entity_link",
2154
2147
  description: "Link an entity to a memory to establish relationships in the knowledge graph.",
2155
2148
  parameters: {
@@ -2192,7 +2185,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2192
2185
  };
2193
2186
  }
2194
2187
  },
2195
- },
2188
+ }),
2196
2189
  { name: "entity_link" },
2197
2190
  );
2198
2191
  }
@@ -2201,8 +2194,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2201
2194
  // 12. entity_list
2202
2195
  // --------------------------------------------------------------------------
2203
2196
  if (isToolEnabled("entity_list")) {
2204
- api.registerTool(
2205
- {
2197
+ api.registerTool((ctx) => ({
2198
+
2206
2199
  name: "entity_list",
2207
2200
  description: "List entities in the knowledge graph.",
2208
2201
  parameters: {
@@ -2235,7 +2228,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2235
2228
  };
2236
2229
  }
2237
2230
  },
2238
- },
2231
+ }),
2239
2232
  { name: "entity_list" },
2240
2233
  );
2241
2234
  }
@@ -2244,8 +2237,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2244
2237
  // 13. entity_graph
2245
2238
  // --------------------------------------------------------------------------
2246
2239
  if (isToolEnabled("entity_graph")) {
2247
- api.registerTool(
2248
- {
2240
+ api.registerTool((ctx) => ({
2241
+
2249
2242
  name: "entity_graph",
2250
2243
  description:
2251
2244
  "Explore the knowledge graph around an entity. Returns the entity and its neighborhood of connected entities and memories.",
@@ -2292,7 +2285,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2292
2285
  };
2293
2286
  }
2294
2287
  },
2295
- },
2288
+ }),
2296
2289
  { name: "entity_graph" },
2297
2290
  );
2298
2291
  }
@@ -2301,8 +2294,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2301
2294
  // 14. agent_list
2302
2295
  // --------------------------------------------------------------------------
2303
2296
  if (isToolEnabled("agent_list")) {
2304
- api.registerTool(
2305
- {
2297
+ api.registerTool((ctx) => ({
2298
+
2306
2299
  name: "agent_list",
2307
2300
  description: "List available agents.",
2308
2301
  parameters: {
@@ -2330,7 +2323,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2330
2323
  };
2331
2324
  }
2332
2325
  },
2333
- },
2326
+ }),
2334
2327
  { name: "agent_list" },
2335
2328
  );
2336
2329
  }
@@ -2339,8 +2332,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2339
2332
  // 15. agent_create
2340
2333
  // --------------------------------------------------------------------------
2341
2334
  if (isToolEnabled("agent_create")) {
2342
- api.registerTool(
2343
- {
2335
+ api.registerTool((ctx) => ({
2336
+
2344
2337
  name: "agent_create",
2345
2338
  description: "Create a new agent. Agents serve as memory namespaces and isolation boundaries.",
2346
2339
  parameters: {
@@ -2371,7 +2364,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2371
2364
  };
2372
2365
  }
2373
2366
  },
2374
- },
2367
+ }),
2375
2368
  { name: "agent_create" },
2376
2369
  );
2377
2370
  }
@@ -2380,8 +2373,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2380
2373
  // 16. agent_get
2381
2374
  // --------------------------------------------------------------------------
2382
2375
  if (isToolEnabled("agent_get")) {
2383
- api.registerTool(
2384
- {
2376
+ api.registerTool((ctx) => ({
2377
+
2385
2378
  name: "agent_get",
2386
2379
  description: "Get details about a specific agent by ID.",
2387
2380
  parameters: {
@@ -2408,7 +2401,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2408
2401
  };
2409
2402
  }
2410
2403
  },
2411
- },
2404
+ }),
2412
2405
  { name: "agent_get" },
2413
2406
  );
2414
2407
  }
@@ -2417,8 +2410,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2417
2410
  // 17. session_start
2418
2411
  // --------------------------------------------------------------------------
2419
2412
  if (isToolEnabled("session_start")) {
2420
- api.registerTool(
2421
- {
2413
+ api.registerTool((ctx) => ({
2414
+
2422
2415
  name: "session_start",
2423
2416
  description:
2424
2417
  "Start a new work session. Sessions track the lifecycle of a task or conversation for later review. Call this early in your workflow and save the returned session ID for session_end later." +
@@ -2459,7 +2452,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2459
2452
  };
2460
2453
  }
2461
2454
  },
2462
- },
2455
+ }),
2463
2456
  { name: "session_start" },
2464
2457
  );
2465
2458
  }
@@ -2468,8 +2461,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2468
2461
  // 18. session_end
2469
2462
  // --------------------------------------------------------------------------
2470
2463
  if (isToolEnabled("session_end")) {
2471
- api.registerTool(
2472
- {
2464
+ api.registerTool((ctx) => ({
2465
+
2473
2466
  name: "session_end",
2474
2467
  description: "End an active session with a summary of what was accomplished. Always include a meaningful summary — it serves as the historical record of the session.",
2475
2468
  parameters: {
@@ -2500,7 +2493,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2500
2493
  };
2501
2494
  }
2502
2495
  },
2503
- },
2496
+ }),
2504
2497
  { name: "session_end" },
2505
2498
  );
2506
2499
  }
@@ -2509,8 +2502,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2509
2502
  // 19. session_recall
2510
2503
  // --------------------------------------------------------------------------
2511
2504
  if (isToolEnabled("session_recall")) {
2512
- api.registerTool(
2513
- {
2505
+ api.registerTool((ctx) => ({
2506
+
2514
2507
  name: "session_recall",
2515
2508
  description: "Retrieve details of a specific session including its timeline and associated memories.",
2516
2509
  parameters: {
@@ -2537,7 +2530,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2537
2530
  };
2538
2531
  }
2539
2532
  },
2540
- },
2533
+ }),
2541
2534
  { name: "session_recall" },
2542
2535
  );
2543
2536
  }
@@ -2546,8 +2539,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2546
2539
  // 20. session_list
2547
2540
  // --------------------------------------------------------------------------
2548
2541
  if (isToolEnabled("session_list")) {
2549
- api.registerTool(
2550
- {
2542
+ api.registerTool((ctx) => ({
2543
+
2551
2544
  name: "session_list",
2552
2545
  description: "List sessions, optionally filtered by project or status." +
2553
2546
  (defaultProject ? ` Scoped to project '${defaultProject}' by default.` : ""),
@@ -2589,7 +2582,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2589
2582
  };
2590
2583
  }
2591
2584
  },
2592
- },
2585
+ }),
2593
2586
  { name: "session_list" },
2594
2587
  );
2595
2588
  }
@@ -2598,8 +2591,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2598
2591
  // 21. decision_record
2599
2592
  // --------------------------------------------------------------------------
2600
2593
  if (isToolEnabled("decision_record")) {
2601
- api.registerTool(
2602
- {
2594
+ api.registerTool((ctx) => ({
2595
+
2603
2596
  name: "decision_record",
2604
2597
  description:
2605
2598
  "Record an architectural or design decision. Captures the rationale and alternatives considered for future reference. Always check existing decisions with decision_check first to avoid contradictions." +
@@ -2668,7 +2661,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2668
2661
  };
2669
2662
  }
2670
2663
  },
2671
- },
2664
+ }),
2672
2665
  { name: "decision_record" },
2673
2666
  );
2674
2667
  }
@@ -2677,8 +2670,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2677
2670
  // 22. decision_list
2678
2671
  // --------------------------------------------------------------------------
2679
2672
  if (isToolEnabled("decision_list")) {
2680
- api.registerTool(
2681
- {
2673
+ api.registerTool((ctx) => ({
2674
+
2682
2675
  name: "decision_list",
2683
2676
  description: "List recorded decisions, optionally filtered by project, status, or tags." +
2684
2677
  (defaultProject ? ` Scoped to project '${defaultProject}' by default.` : ""),
@@ -2724,7 +2717,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2724
2717
  };
2725
2718
  }
2726
2719
  },
2727
- },
2720
+ }),
2728
2721
  { name: "decision_list" },
2729
2722
  );
2730
2723
  }
@@ -2733,8 +2726,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2733
2726
  // 23. decision_supersede
2734
2727
  // --------------------------------------------------------------------------
2735
2728
  if (isToolEnabled("decision_supersede")) {
2736
- api.registerTool(
2737
- {
2729
+ api.registerTool((ctx) => ({
2730
+
2738
2731
  name: "decision_supersede",
2739
2732
  description:
2740
2733
  "Supersede an existing decision with a new one. The old decision is marked as superseded and linked to the replacement.",
@@ -2794,7 +2787,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2794
2787
  };
2795
2788
  }
2796
2789
  },
2797
- },
2790
+ }),
2798
2791
  { name: "decision_supersede" },
2799
2792
  );
2800
2793
  }
@@ -2803,8 +2796,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2803
2796
  // 24. decision_check
2804
2797
  // --------------------------------------------------------------------------
2805
2798
  if (isToolEnabled("decision_check")) {
2806
- api.registerTool(
2807
- {
2799
+ api.registerTool((ctx) => ({
2800
+
2808
2801
  name: "decision_check",
2809
2802
  description:
2810
2803
  "Check if there are existing decisions relevant to a topic. ALWAYS call this before making architectural choices to avoid contradicting past decisions." +
@@ -2865,7 +2858,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2865
2858
  };
2866
2859
  }
2867
2860
  },
2868
- },
2861
+ }),
2869
2862
  { name: "decision_check" },
2870
2863
  );
2871
2864
  }
@@ -2874,8 +2867,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2874
2867
  // 25. pattern_create
2875
2868
  // --------------------------------------------------------------------------
2876
2869
  if (isToolEnabled("pattern_create")) {
2877
- api.registerTool(
2878
- {
2870
+ api.registerTool((ctx) => ({
2871
+
2879
2872
  name: "pattern_create",
2880
2873
  description:
2881
2874
  "Create a reusable pattern (coding convention, architecture pattern, or best practice) that can be shared across projects. Include example_code for maximum usefulness." +
@@ -2950,7 +2943,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2950
2943
  };
2951
2944
  }
2952
2945
  },
2953
- },
2946
+ }),
2954
2947
  { name: "pattern_create" },
2955
2948
  );
2956
2949
  }
@@ -2959,8 +2952,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2959
2952
  // 26. pattern_search
2960
2953
  // --------------------------------------------------------------------------
2961
2954
  if (isToolEnabled("pattern_search")) {
2962
- api.registerTool(
2963
- {
2955
+ api.registerTool((ctx) => ({
2956
+
2964
2957
  name: "pattern_search",
2965
2958
  description: "Search for established patterns by natural language query. Call this before writing code to find and follow existing conventions." +
2966
2959
  (defaultProject ? ` Scoped to project '${defaultProject}' by default.` : ""),
@@ -3020,7 +3013,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3020
3013
  };
3021
3014
  }
3022
3015
  },
3023
- },
3016
+ }),
3024
3017
  { name: "pattern_search" },
3025
3018
  );
3026
3019
  }
@@ -3029,8 +3022,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3029
3022
  // 27. pattern_adopt
3030
3023
  // --------------------------------------------------------------------------
3031
3024
  if (isToolEnabled("pattern_adopt")) {
3032
- api.registerTool(
3033
- {
3025
+ api.registerTool((ctx) => ({
3026
+
3034
3027
  name: "pattern_adopt",
3035
3028
  description: "Adopt an existing pattern for use in a project. Creates a link between the pattern and the project.",
3036
3029
  parameters: {
@@ -3061,7 +3054,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3061
3054
  };
3062
3055
  }
3063
3056
  },
3064
- },
3057
+ }),
3065
3058
  { name: "pattern_adopt" },
3066
3059
  );
3067
3060
  }
@@ -3070,8 +3063,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3070
3063
  // 28. pattern_suggest
3071
3064
  // --------------------------------------------------------------------------
3072
3065
  if (isToolEnabled("pattern_suggest")) {
3073
- api.registerTool(
3074
- {
3066
+ api.registerTool((ctx) => ({
3067
+
3075
3068
  name: "pattern_suggest",
3076
3069
  description:
3077
3070
  "Get pattern suggestions for a project based on its stack and existing patterns from related projects.",
@@ -3103,7 +3096,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3103
3096
  };
3104
3097
  }
3105
3098
  },
3106
- },
3099
+ }),
3107
3100
  { name: "pattern_suggest" },
3108
3101
  );
3109
3102
  }
@@ -3112,8 +3105,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3112
3105
  // 29. project_register
3113
3106
  // --------------------------------------------------------------------------
3114
3107
  if (isToolEnabled("project_register")) {
3115
- api.registerTool(
3116
- {
3108
+ api.registerTool((ctx) => ({
3109
+
3117
3110
  name: "project_register",
3118
3111
  description: "Register a new project in MemoryRelay. Projects organize memories, decisions, patterns, and sessions.",
3119
3112
  parameters: {
@@ -3171,7 +3164,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3171
3164
  };
3172
3165
  }
3173
3166
  },
3174
- },
3167
+ }),
3175
3168
  { name: "project_register" },
3176
3169
  );
3177
3170
  }
@@ -3180,8 +3173,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3180
3173
  // 30. project_list
3181
3174
  // --------------------------------------------------------------------------
3182
3175
  if (isToolEnabled("project_list")) {
3183
- api.registerTool(
3184
- {
3176
+ api.registerTool((ctx) => ({
3177
+
3185
3178
  name: "project_list",
3186
3179
  description: "List all registered projects.",
3187
3180
  parameters: {
@@ -3209,7 +3202,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3209
3202
  };
3210
3203
  }
3211
3204
  },
3212
- },
3205
+ }),
3213
3206
  { name: "project_list" },
3214
3207
  );
3215
3208
  }
@@ -3218,8 +3211,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3218
3211
  // 31. project_info
3219
3212
  // --------------------------------------------------------------------------
3220
3213
  if (isToolEnabled("project_info")) {
3221
- api.registerTool(
3222
- {
3214
+ api.registerTool((ctx) => ({
3215
+
3223
3216
  name: "project_info",
3224
3217
  description: "Get detailed information about a specific project.",
3225
3218
  parameters: {
@@ -3246,7 +3239,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3246
3239
  };
3247
3240
  }
3248
3241
  },
3249
- },
3242
+ }),
3250
3243
  { name: "project_info" },
3251
3244
  );
3252
3245
  }
@@ -3255,8 +3248,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3255
3248
  // 32. project_add_relationship
3256
3249
  // --------------------------------------------------------------------------
3257
3250
  if (isToolEnabled("project_add_relationship")) {
3258
- api.registerTool(
3259
- {
3251
+ api.registerTool((ctx) => ({
3252
+
3260
3253
  name: "project_add_relationship",
3261
3254
  description:
3262
3255
  "Add a relationship between two projects (e.g., depends_on, api_consumer, shares_schema, shares_infra, pattern_source, forked_from).",
@@ -3304,7 +3297,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3304
3297
  };
3305
3298
  }
3306
3299
  },
3307
- },
3300
+ }),
3308
3301
  { name: "project_add_relationship" },
3309
3302
  );
3310
3303
  }
@@ -3313,8 +3306,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3313
3306
  // 33. project_dependencies
3314
3307
  // --------------------------------------------------------------------------
3315
3308
  if (isToolEnabled("project_dependencies")) {
3316
- api.registerTool(
3317
- {
3309
+ api.registerTool((ctx) => ({
3310
+
3318
3311
  name: "project_dependencies",
3319
3312
  description: "List projects that a given project depends on.",
3320
3313
  parameters: {
@@ -3341,7 +3334,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3341
3334
  };
3342
3335
  }
3343
3336
  },
3344
- },
3337
+ }),
3345
3338
  { name: "project_dependencies" },
3346
3339
  );
3347
3340
  }
@@ -3350,8 +3343,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3350
3343
  // 34. project_dependents
3351
3344
  // --------------------------------------------------------------------------
3352
3345
  if (isToolEnabled("project_dependents")) {
3353
- api.registerTool(
3354
- {
3346
+ api.registerTool((ctx) => ({
3347
+
3355
3348
  name: "project_dependents",
3356
3349
  description: "List projects that depend on a given project.",
3357
3350
  parameters: {
@@ -3378,7 +3371,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3378
3371
  };
3379
3372
  }
3380
3373
  },
3381
- },
3374
+ }),
3382
3375
  { name: "project_dependents" },
3383
3376
  );
3384
3377
  }
@@ -3387,8 +3380,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3387
3380
  // 35. project_related
3388
3381
  // --------------------------------------------------------------------------
3389
3382
  if (isToolEnabled("project_related")) {
3390
- api.registerTool(
3391
- {
3383
+ api.registerTool((ctx) => ({
3384
+
3392
3385
  name: "project_related",
3393
3386
  description: "List all projects related to a given project (any relationship direction).",
3394
3387
  parameters: {
@@ -3415,7 +3408,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3415
3408
  };
3416
3409
  }
3417
3410
  },
3418
- },
3411
+ }),
3419
3412
  { name: "project_related" },
3420
3413
  );
3421
3414
  }
@@ -3424,8 +3417,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3424
3417
  // 36. project_impact
3425
3418
  // --------------------------------------------------------------------------
3426
3419
  if (isToolEnabled("project_impact")) {
3427
- api.registerTool(
3428
- {
3420
+ api.registerTool((ctx) => ({
3421
+
3429
3422
  name: "project_impact",
3430
3423
  description:
3431
3424
  "Analyze the impact of a proposed change on a project and its dependents. Helps understand blast radius before making changes.",
@@ -3457,7 +3450,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3457
3450
  };
3458
3451
  }
3459
3452
  },
3460
- },
3453
+ }),
3461
3454
  { name: "project_impact" },
3462
3455
  );
3463
3456
  }
@@ -3466,8 +3459,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3466
3459
  // 37. project_shared_patterns
3467
3460
  // --------------------------------------------------------------------------
3468
3461
  if (isToolEnabled("project_shared_patterns")) {
3469
- api.registerTool(
3470
- {
3462
+ api.registerTool((ctx) => ({
3463
+
3471
3464
  name: "project_shared_patterns",
3472
3465
  description: "Find patterns shared between two projects. Useful for maintaining consistency across related projects.",
3473
3466
  parameters: {
@@ -3498,7 +3491,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3498
3491
  };
3499
3492
  }
3500
3493
  },
3501
- },
3494
+ }),
3502
3495
  { name: "project_shared_patterns" },
3503
3496
  );
3504
3497
  }
@@ -3507,8 +3500,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3507
3500
  // 38. project_context
3508
3501
  // --------------------------------------------------------------------------
3509
3502
  if (isToolEnabled("project_context")) {
3510
- api.registerTool(
3511
- {
3503
+ api.registerTool((ctx) => ({
3504
+
3512
3505
  name: "project_context",
3513
3506
  description:
3514
3507
  "Load full project context including hot-tier memories, active decisions, adopted patterns, and recent sessions. Call this FIRST when starting work on a project to understand existing context before making changes.",
@@ -3536,7 +3529,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3536
3529
  };
3537
3530
  }
3538
3531
  },
3539
- },
3532
+ }),
3540
3533
  { name: "project_context" },
3541
3534
  );
3542
3535
  }
@@ -3545,8 +3538,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3545
3538
  // 39. memory_health
3546
3539
  // --------------------------------------------------------------------------
3547
3540
  if (isToolEnabled("memory_health")) {
3548
- api.registerTool(
3549
- {
3541
+ api.registerTool((ctx) => ({
3542
+
3550
3543
  name: "memory_health",
3551
3544
  description: "Check the MemoryRelay API connectivity and health status.",
3552
3545
  parameters: {
@@ -3567,7 +3560,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3567
3560
  };
3568
3561
  }
3569
3562
  },
3570
- },
3563
+ }),
3571
3564
  { name: "memory_health" },
3572
3565
  );
3573
3566
  }
@@ -3,7 +3,7 @@
3
3
  "kind": "memory",
4
4
  "name": "MemoryRelay AI",
5
5
  "description": "MemoryRelay v0.12.6 - Long-term memory with sessions, decisions, patterns & projects (api.memoryrelay.net)",
6
- "version": "0.12.6",
6
+ "version": "0.12.8",
7
7
  "uiHints": {
8
8
  "apiKey": {
9
9
  "label": "MemoryRelay API Key",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memoryrelay/plugin-memoryrelay-ai",
3
- "version": "0.12.6",
3
+ "version": "0.12.8",
4
4
  "description": "OpenClaw memory plugin for MemoryRelay API - sessions, decisions, patterns, projects & semantic search",
5
5
  "type": "module",
6
6
  "main": "index.ts",