@memoryrelay/plugin-memoryrelay-ai 0.12.5 → 0.12.7

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/index.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  /**
2
2
  * OpenClaw Memory Plugin - MemoryRelay
3
- * Version: 0.12.3 (Phase 1 - Adoption Framework)
3
+ * Version: 0.12.7 (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.
7
7
  * Includes: memories, entities, agents, sessions, decisions, patterns, projects.
8
+ * New in v0.12.6: OpenClaw session context integration for session tracking
8
9
  * New in v0.12.3: Smart auto-capture, daily stats, CLI commands, onboarding
9
10
  *
10
11
  * API: https://api.memoryrelay.net
@@ -1482,8 +1483,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1482
1483
  // 1. memory_store
1483
1484
  // --------------------------------------------------------------------------
1484
1485
  if (isToolEnabled("memory_store")) {
1485
- api.registerTool(
1486
- {
1486
+ api.registerTool((ctx) => ({
1487
+
1487
1488
  name: "memory_store",
1488
1489
  description:
1489
1490
  "Store a new memory in MemoryRelay. Use this to save important information, facts, preferences, or context that should be remembered for future conversations." +
@@ -1539,8 +1540,15 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1539
1540
  ) => {
1540
1541
  try {
1541
1542
  const { content, metadata, ...opts } = args;
1543
+
1544
+ // Inject sessionId from OpenClaw context into metadata
1545
+ const enrichedMetadata = {
1546
+ ...metadata,
1547
+ ...(ctx.sessionId && { session_id: ctx.sessionId }),
1548
+ };
1549
+
1542
1550
  if (!opts.project && defaultProject) opts.project = defaultProject;
1543
- const memory = await client.store(content, metadata, opts);
1551
+ const memory = await client.store(content, enrichedMetadata, opts);
1544
1552
  return {
1545
1553
  content: [
1546
1554
  {
@@ -1557,7 +1565,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1557
1565
  };
1558
1566
  }
1559
1567
  },
1560
- },
1568
+ }),
1561
1569
  { name: "memory_store" },
1562
1570
  );
1563
1571
  }
@@ -1566,8 +1574,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1566
1574
  // 2. memory_recall
1567
1575
  // --------------------------------------------------------------------------
1568
1576
  if (isToolEnabled("memory_recall")) {
1569
- api.registerTool(
1570
- {
1577
+ api.registerTool((ctx) => ({
1578
+
1571
1579
  name: "memory_recall",
1572
1580
  description:
1573
1581
  "Search memories using natural language. Returns the most relevant memories based on semantic similarity to the query." +
@@ -1679,7 +1687,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1679
1687
  };
1680
1688
  }
1681
1689
  },
1682
- },
1690
+ }),
1683
1691
  { name: "memory_recall" },
1684
1692
  );
1685
1693
  }
@@ -1688,8 +1696,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1688
1696
  // 3. memory_forget
1689
1697
  // --------------------------------------------------------------------------
1690
1698
  if (isToolEnabled("memory_forget")) {
1691
- api.registerTool(
1692
- {
1699
+ api.registerTool((ctx) => ({
1700
+
1693
1701
  name: "memory_forget",
1694
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.",
1695
1703
  parameters: {
@@ -1762,7 +1770,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1762
1770
  details: { error: "missing_param" },
1763
1771
  };
1764
1772
  },
1765
- },
1773
+ }),
1766
1774
  { name: "memory_forget" },
1767
1775
  );
1768
1776
  }
@@ -1771,8 +1779,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1771
1779
  // 4. memory_list
1772
1780
  // --------------------------------------------------------------------------
1773
1781
  if (isToolEnabled("memory_list")) {
1774
- api.registerTool(
1775
- {
1782
+ api.registerTool((ctx) => ({
1783
+
1776
1784
  name: "memory_list",
1777
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.",
1778
1786
  parameters: {
@@ -1814,7 +1822,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1814
1822
  };
1815
1823
  }
1816
1824
  },
1817
- },
1825
+ }),
1818
1826
  { name: "memory_list" },
1819
1827
  );
1820
1828
  }
@@ -1823,8 +1831,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1823
1831
  // 5. memory_get
1824
1832
  // --------------------------------------------------------------------------
1825
1833
  if (isToolEnabled("memory_get")) {
1826
- api.registerTool(
1827
- {
1834
+ api.registerTool((ctx) => ({
1835
+
1828
1836
  name: "memory_get",
1829
1837
  description: "Retrieve a specific memory by its ID.",
1830
1838
  parameters: {
@@ -1851,7 +1859,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1851
1859
  };
1852
1860
  }
1853
1861
  },
1854
- },
1862
+ }),
1855
1863
  { name: "memory_get" },
1856
1864
  );
1857
1865
  }
@@ -1860,8 +1868,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1860
1868
  // 6. memory_update
1861
1869
  // --------------------------------------------------------------------------
1862
1870
  if (isToolEnabled("memory_update")) {
1863
- api.registerTool(
1864
- {
1871
+ api.registerTool((ctx) => ({
1872
+
1865
1873
  name: "memory_update",
1866
1874
  description: "Update the content of an existing memory. Use to correct or expand stored information.",
1867
1875
  parameters: {
@@ -1897,7 +1905,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1897
1905
  };
1898
1906
  }
1899
1907
  },
1900
- },
1908
+ }),
1901
1909
  { name: "memory_update" },
1902
1910
  );
1903
1911
  }
@@ -1906,8 +1914,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1906
1914
  // 7. memory_batch_store
1907
1915
  // --------------------------------------------------------------------------
1908
1916
  if (isToolEnabled("memory_batch_store")) {
1909
- api.registerTool(
1910
- {
1917
+ api.registerTool((ctx) => ({
1918
+
1911
1919
  name: "memory_batch_store",
1912
1920
  description: "Store multiple memories at once. More efficient than individual calls for bulk storage.",
1913
1921
  parameters: {
@@ -1954,7 +1962,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1954
1962
  };
1955
1963
  }
1956
1964
  },
1957
- },
1965
+ }),
1958
1966
  { name: "memory_batch_store" },
1959
1967
  );
1960
1968
  }
@@ -1963,8 +1971,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
1963
1971
  // 8. memory_context
1964
1972
  // --------------------------------------------------------------------------
1965
1973
  if (isToolEnabled("memory_context")) {
1966
- api.registerTool(
1967
- {
1974
+ api.registerTool((ctx) => ({
1975
+
1968
1976
  name: "memory_context",
1969
1977
  description:
1970
1978
  "Build a context window from relevant memories, optimized for injecting into agent prompts with token budget awareness." +
@@ -2019,7 +2027,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2019
2027
  };
2020
2028
  }
2021
2029
  },
2022
- },
2030
+ }),
2023
2031
  { name: "memory_context" },
2024
2032
  );
2025
2033
  }
@@ -2028,8 +2036,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2028
2036
  // 9. memory_promote
2029
2037
  // --------------------------------------------------------------------------
2030
2038
  if (isToolEnabled("memory_promote")) {
2031
- api.registerTool(
2032
- {
2039
+ api.registerTool((ctx) => ({
2040
+
2033
2041
  name: "memory_promote",
2034
2042
  description:
2035
2043
  "Promote a memory by updating its importance score and/or tier. Use to ensure critical memories are retained longer.",
@@ -2073,7 +2081,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2073
2081
  };
2074
2082
  }
2075
2083
  },
2076
- },
2084
+ }),
2077
2085
  { name: "memory_promote" },
2078
2086
  );
2079
2087
  }
@@ -2082,8 +2090,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2082
2090
  // 10. entity_create
2083
2091
  // --------------------------------------------------------------------------
2084
2092
  if (isToolEnabled("entity_create")) {
2085
- api.registerTool(
2086
- {
2093
+ api.registerTool((ctx) => ({
2094
+
2087
2095
  name: "entity_create",
2088
2096
  description:
2089
2097
  "Create a named entity (person, place, organization, project, concept) for the knowledge graph. Entities help organize and connect memories.",
@@ -2124,7 +2132,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2124
2132
  };
2125
2133
  }
2126
2134
  },
2127
- },
2135
+ }),
2128
2136
  { name: "entity_create" },
2129
2137
  );
2130
2138
  }
@@ -2133,8 +2141,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2133
2141
  // 11. entity_link
2134
2142
  // --------------------------------------------------------------------------
2135
2143
  if (isToolEnabled("entity_link")) {
2136
- api.registerTool(
2137
- {
2144
+ api.registerTool((ctx) => ({
2145
+
2138
2146
  name: "entity_link",
2139
2147
  description: "Link an entity to a memory to establish relationships in the knowledge graph.",
2140
2148
  parameters: {
@@ -2177,7 +2185,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2177
2185
  };
2178
2186
  }
2179
2187
  },
2180
- },
2188
+ }),
2181
2189
  { name: "entity_link" },
2182
2190
  );
2183
2191
  }
@@ -2186,8 +2194,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2186
2194
  // 12. entity_list
2187
2195
  // --------------------------------------------------------------------------
2188
2196
  if (isToolEnabled("entity_list")) {
2189
- api.registerTool(
2190
- {
2197
+ api.registerTool((ctx) => ({
2198
+
2191
2199
  name: "entity_list",
2192
2200
  description: "List entities in the knowledge graph.",
2193
2201
  parameters: {
@@ -2220,7 +2228,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2220
2228
  };
2221
2229
  }
2222
2230
  },
2223
- },
2231
+ }),
2224
2232
  { name: "entity_list" },
2225
2233
  );
2226
2234
  }
@@ -2229,8 +2237,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2229
2237
  // 13. entity_graph
2230
2238
  // --------------------------------------------------------------------------
2231
2239
  if (isToolEnabled("entity_graph")) {
2232
- api.registerTool(
2233
- {
2240
+ api.registerTool((ctx) => ({
2241
+
2234
2242
  name: "entity_graph",
2235
2243
  description:
2236
2244
  "Explore the knowledge graph around an entity. Returns the entity and its neighborhood of connected entities and memories.",
@@ -2277,7 +2285,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2277
2285
  };
2278
2286
  }
2279
2287
  },
2280
- },
2288
+ }),
2281
2289
  { name: "entity_graph" },
2282
2290
  );
2283
2291
  }
@@ -2286,8 +2294,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2286
2294
  // 14. agent_list
2287
2295
  // --------------------------------------------------------------------------
2288
2296
  if (isToolEnabled("agent_list")) {
2289
- api.registerTool(
2290
- {
2297
+ api.registerTool((ctx) => ({
2298
+
2291
2299
  name: "agent_list",
2292
2300
  description: "List available agents.",
2293
2301
  parameters: {
@@ -2315,7 +2323,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2315
2323
  };
2316
2324
  }
2317
2325
  },
2318
- },
2326
+ }),
2319
2327
  { name: "agent_list" },
2320
2328
  );
2321
2329
  }
@@ -2324,8 +2332,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2324
2332
  // 15. agent_create
2325
2333
  // --------------------------------------------------------------------------
2326
2334
  if (isToolEnabled("agent_create")) {
2327
- api.registerTool(
2328
- {
2335
+ api.registerTool((ctx) => ({
2336
+
2329
2337
  name: "agent_create",
2330
2338
  description: "Create a new agent. Agents serve as memory namespaces and isolation boundaries.",
2331
2339
  parameters: {
@@ -2356,7 +2364,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2356
2364
  };
2357
2365
  }
2358
2366
  },
2359
- },
2367
+ }),
2360
2368
  { name: "agent_create" },
2361
2369
  );
2362
2370
  }
@@ -2365,8 +2373,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2365
2373
  // 16. agent_get
2366
2374
  // --------------------------------------------------------------------------
2367
2375
  if (isToolEnabled("agent_get")) {
2368
- api.registerTool(
2369
- {
2376
+ api.registerTool((ctx) => ({
2377
+
2370
2378
  name: "agent_get",
2371
2379
  description: "Get details about a specific agent by ID.",
2372
2380
  parameters: {
@@ -2393,7 +2401,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2393
2401
  };
2394
2402
  }
2395
2403
  },
2396
- },
2404
+ }),
2397
2405
  { name: "agent_get" },
2398
2406
  );
2399
2407
  }
@@ -2402,8 +2410,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2402
2410
  // 17. session_start
2403
2411
  // --------------------------------------------------------------------------
2404
2412
  if (isToolEnabled("session_start")) {
2405
- api.registerTool(
2406
- {
2413
+ api.registerTool((ctx) => ({
2414
+
2407
2415
  name: "session_start",
2408
2416
  description:
2409
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." +
@@ -2444,7 +2452,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2444
2452
  };
2445
2453
  }
2446
2454
  },
2447
- },
2455
+ }),
2448
2456
  { name: "session_start" },
2449
2457
  );
2450
2458
  }
@@ -2453,8 +2461,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2453
2461
  // 18. session_end
2454
2462
  // --------------------------------------------------------------------------
2455
2463
  if (isToolEnabled("session_end")) {
2456
- api.registerTool(
2457
- {
2464
+ api.registerTool((ctx) => ({
2465
+
2458
2466
  name: "session_end",
2459
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.",
2460
2468
  parameters: {
@@ -2485,7 +2493,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2485
2493
  };
2486
2494
  }
2487
2495
  },
2488
- },
2496
+ }),
2489
2497
  { name: "session_end" },
2490
2498
  );
2491
2499
  }
@@ -2494,8 +2502,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2494
2502
  // 19. session_recall
2495
2503
  // --------------------------------------------------------------------------
2496
2504
  if (isToolEnabled("session_recall")) {
2497
- api.registerTool(
2498
- {
2505
+ api.registerTool((ctx) => ({
2506
+
2499
2507
  name: "session_recall",
2500
2508
  description: "Retrieve details of a specific session including its timeline and associated memories.",
2501
2509
  parameters: {
@@ -2522,7 +2530,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2522
2530
  };
2523
2531
  }
2524
2532
  },
2525
- },
2533
+ }),
2526
2534
  { name: "session_recall" },
2527
2535
  );
2528
2536
  }
@@ -2531,8 +2539,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2531
2539
  // 20. session_list
2532
2540
  // --------------------------------------------------------------------------
2533
2541
  if (isToolEnabled("session_list")) {
2534
- api.registerTool(
2535
- {
2542
+ api.registerTool((ctx) => ({
2543
+
2536
2544
  name: "session_list",
2537
2545
  description: "List sessions, optionally filtered by project or status." +
2538
2546
  (defaultProject ? ` Scoped to project '${defaultProject}' by default.` : ""),
@@ -2574,7 +2582,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2574
2582
  };
2575
2583
  }
2576
2584
  },
2577
- },
2585
+ }),
2578
2586
  { name: "session_list" },
2579
2587
  );
2580
2588
  }
@@ -2583,8 +2591,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2583
2591
  // 21. decision_record
2584
2592
  // --------------------------------------------------------------------------
2585
2593
  if (isToolEnabled("decision_record")) {
2586
- api.registerTool(
2587
- {
2594
+ api.registerTool((ctx) => ({
2595
+
2588
2596
  name: "decision_record",
2589
2597
  description:
2590
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." +
@@ -2653,7 +2661,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2653
2661
  };
2654
2662
  }
2655
2663
  },
2656
- },
2664
+ }),
2657
2665
  { name: "decision_record" },
2658
2666
  );
2659
2667
  }
@@ -2662,8 +2670,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2662
2670
  // 22. decision_list
2663
2671
  // --------------------------------------------------------------------------
2664
2672
  if (isToolEnabled("decision_list")) {
2665
- api.registerTool(
2666
- {
2673
+ api.registerTool((ctx) => ({
2674
+
2667
2675
  name: "decision_list",
2668
2676
  description: "List recorded decisions, optionally filtered by project, status, or tags." +
2669
2677
  (defaultProject ? ` Scoped to project '${defaultProject}' by default.` : ""),
@@ -2709,7 +2717,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2709
2717
  };
2710
2718
  }
2711
2719
  },
2712
- },
2720
+ }),
2713
2721
  { name: "decision_list" },
2714
2722
  );
2715
2723
  }
@@ -2718,8 +2726,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2718
2726
  // 23. decision_supersede
2719
2727
  // --------------------------------------------------------------------------
2720
2728
  if (isToolEnabled("decision_supersede")) {
2721
- api.registerTool(
2722
- {
2729
+ api.registerTool((ctx) => ({
2730
+
2723
2731
  name: "decision_supersede",
2724
2732
  description:
2725
2733
  "Supersede an existing decision with a new one. The old decision is marked as superseded and linked to the replacement.",
@@ -2779,7 +2787,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2779
2787
  };
2780
2788
  }
2781
2789
  },
2782
- },
2790
+ }),
2783
2791
  { name: "decision_supersede" },
2784
2792
  );
2785
2793
  }
@@ -2788,8 +2796,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2788
2796
  // 24. decision_check
2789
2797
  // --------------------------------------------------------------------------
2790
2798
  if (isToolEnabled("decision_check")) {
2791
- api.registerTool(
2792
- {
2799
+ api.registerTool((ctx) => ({
2800
+
2793
2801
  name: "decision_check",
2794
2802
  description:
2795
2803
  "Check if there are existing decisions relevant to a topic. ALWAYS call this before making architectural choices to avoid contradicting past decisions." +
@@ -2850,7 +2858,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2850
2858
  };
2851
2859
  }
2852
2860
  },
2853
- },
2861
+ }),
2854
2862
  { name: "decision_check" },
2855
2863
  );
2856
2864
  }
@@ -2859,8 +2867,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2859
2867
  // 25. pattern_create
2860
2868
  // --------------------------------------------------------------------------
2861
2869
  if (isToolEnabled("pattern_create")) {
2862
- api.registerTool(
2863
- {
2870
+ api.registerTool((ctx) => ({
2871
+
2864
2872
  name: "pattern_create",
2865
2873
  description:
2866
2874
  "Create a reusable pattern (coding convention, architecture pattern, or best practice) that can be shared across projects. Include example_code for maximum usefulness." +
@@ -2935,7 +2943,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2935
2943
  };
2936
2944
  }
2937
2945
  },
2938
- },
2946
+ }),
2939
2947
  { name: "pattern_create" },
2940
2948
  );
2941
2949
  }
@@ -2944,8 +2952,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
2944
2952
  // 26. pattern_search
2945
2953
  // --------------------------------------------------------------------------
2946
2954
  if (isToolEnabled("pattern_search")) {
2947
- api.registerTool(
2948
- {
2955
+ api.registerTool((ctx) => ({
2956
+
2949
2957
  name: "pattern_search",
2950
2958
  description: "Search for established patterns by natural language query. Call this before writing code to find and follow existing conventions." +
2951
2959
  (defaultProject ? ` Scoped to project '${defaultProject}' by default.` : ""),
@@ -3005,7 +3013,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3005
3013
  };
3006
3014
  }
3007
3015
  },
3008
- },
3016
+ }),
3009
3017
  { name: "pattern_search" },
3010
3018
  );
3011
3019
  }
@@ -3014,8 +3022,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3014
3022
  // 27. pattern_adopt
3015
3023
  // --------------------------------------------------------------------------
3016
3024
  if (isToolEnabled("pattern_adopt")) {
3017
- api.registerTool(
3018
- {
3025
+ api.registerTool((ctx) => ({
3026
+
3019
3027
  name: "pattern_adopt",
3020
3028
  description: "Adopt an existing pattern for use in a project. Creates a link between the pattern and the project.",
3021
3029
  parameters: {
@@ -3046,7 +3054,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3046
3054
  };
3047
3055
  }
3048
3056
  },
3049
- },
3057
+ }),
3050
3058
  { name: "pattern_adopt" },
3051
3059
  );
3052
3060
  }
@@ -3055,8 +3063,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3055
3063
  // 28. pattern_suggest
3056
3064
  // --------------------------------------------------------------------------
3057
3065
  if (isToolEnabled("pattern_suggest")) {
3058
- api.registerTool(
3059
- {
3066
+ api.registerTool((ctx) => ({
3067
+
3060
3068
  name: "pattern_suggest",
3061
3069
  description:
3062
3070
  "Get pattern suggestions for a project based on its stack and existing patterns from related projects.",
@@ -3088,7 +3096,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3088
3096
  };
3089
3097
  }
3090
3098
  },
3091
- },
3099
+ }),
3092
3100
  { name: "pattern_suggest" },
3093
3101
  );
3094
3102
  }
@@ -3097,8 +3105,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3097
3105
  // 29. project_register
3098
3106
  // --------------------------------------------------------------------------
3099
3107
  if (isToolEnabled("project_register")) {
3100
- api.registerTool(
3101
- {
3108
+ api.registerTool((ctx) => ({
3109
+
3102
3110
  name: "project_register",
3103
3111
  description: "Register a new project in MemoryRelay. Projects organize memories, decisions, patterns, and sessions.",
3104
3112
  parameters: {
@@ -3156,7 +3164,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3156
3164
  };
3157
3165
  }
3158
3166
  },
3159
- },
3167
+ }),
3160
3168
  { name: "project_register" },
3161
3169
  );
3162
3170
  }
@@ -3165,8 +3173,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3165
3173
  // 30. project_list
3166
3174
  // --------------------------------------------------------------------------
3167
3175
  if (isToolEnabled("project_list")) {
3168
- api.registerTool(
3169
- {
3176
+ api.registerTool((ctx) => ({
3177
+
3170
3178
  name: "project_list",
3171
3179
  description: "List all registered projects.",
3172
3180
  parameters: {
@@ -3194,7 +3202,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3194
3202
  };
3195
3203
  }
3196
3204
  },
3197
- },
3205
+ }),
3198
3206
  { name: "project_list" },
3199
3207
  );
3200
3208
  }
@@ -3203,8 +3211,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3203
3211
  // 31. project_info
3204
3212
  // --------------------------------------------------------------------------
3205
3213
  if (isToolEnabled("project_info")) {
3206
- api.registerTool(
3207
- {
3214
+ api.registerTool((ctx) => ({
3215
+
3208
3216
  name: "project_info",
3209
3217
  description: "Get detailed information about a specific project.",
3210
3218
  parameters: {
@@ -3231,7 +3239,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3231
3239
  };
3232
3240
  }
3233
3241
  },
3234
- },
3242
+ }),
3235
3243
  { name: "project_info" },
3236
3244
  );
3237
3245
  }
@@ -3240,8 +3248,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3240
3248
  // 32. project_add_relationship
3241
3249
  // --------------------------------------------------------------------------
3242
3250
  if (isToolEnabled("project_add_relationship")) {
3243
- api.registerTool(
3244
- {
3251
+ api.registerTool((ctx) => ({
3252
+
3245
3253
  name: "project_add_relationship",
3246
3254
  description:
3247
3255
  "Add a relationship between two projects (e.g., depends_on, api_consumer, shares_schema, shares_infra, pattern_source, forked_from).",
@@ -3289,7 +3297,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3289
3297
  };
3290
3298
  }
3291
3299
  },
3292
- },
3300
+ }),
3293
3301
  { name: "project_add_relationship" },
3294
3302
  );
3295
3303
  }
@@ -3298,8 +3306,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3298
3306
  // 33. project_dependencies
3299
3307
  // --------------------------------------------------------------------------
3300
3308
  if (isToolEnabled("project_dependencies")) {
3301
- api.registerTool(
3302
- {
3309
+ api.registerTool((ctx) => ({
3310
+
3303
3311
  name: "project_dependencies",
3304
3312
  description: "List projects that a given project depends on.",
3305
3313
  parameters: {
@@ -3326,7 +3334,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3326
3334
  };
3327
3335
  }
3328
3336
  },
3329
- },
3337
+ }),
3330
3338
  { name: "project_dependencies" },
3331
3339
  );
3332
3340
  }
@@ -3335,8 +3343,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3335
3343
  // 34. project_dependents
3336
3344
  // --------------------------------------------------------------------------
3337
3345
  if (isToolEnabled("project_dependents")) {
3338
- api.registerTool(
3339
- {
3346
+ api.registerTool((ctx) => ({
3347
+
3340
3348
  name: "project_dependents",
3341
3349
  description: "List projects that depend on a given project.",
3342
3350
  parameters: {
@@ -3363,7 +3371,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3363
3371
  };
3364
3372
  }
3365
3373
  },
3366
- },
3374
+ }),
3367
3375
  { name: "project_dependents" },
3368
3376
  );
3369
3377
  }
@@ -3372,8 +3380,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3372
3380
  // 35. project_related
3373
3381
  // --------------------------------------------------------------------------
3374
3382
  if (isToolEnabled("project_related")) {
3375
- api.registerTool(
3376
- {
3383
+ api.registerTool((ctx) => ({
3384
+
3377
3385
  name: "project_related",
3378
3386
  description: "List all projects related to a given project (any relationship direction).",
3379
3387
  parameters: {
@@ -3400,7 +3408,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3400
3408
  };
3401
3409
  }
3402
3410
  },
3403
- },
3411
+ }),
3404
3412
  { name: "project_related" },
3405
3413
  );
3406
3414
  }
@@ -3409,8 +3417,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3409
3417
  // 36. project_impact
3410
3418
  // --------------------------------------------------------------------------
3411
3419
  if (isToolEnabled("project_impact")) {
3412
- api.registerTool(
3413
- {
3420
+ api.registerTool((ctx) => ({
3421
+
3414
3422
  name: "project_impact",
3415
3423
  description:
3416
3424
  "Analyze the impact of a proposed change on a project and its dependents. Helps understand blast radius before making changes.",
@@ -3442,7 +3450,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3442
3450
  };
3443
3451
  }
3444
3452
  },
3445
- },
3453
+ }),
3446
3454
  { name: "project_impact" },
3447
3455
  );
3448
3456
  }
@@ -3451,8 +3459,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3451
3459
  // 37. project_shared_patterns
3452
3460
  // --------------------------------------------------------------------------
3453
3461
  if (isToolEnabled("project_shared_patterns")) {
3454
- api.registerTool(
3455
- {
3462
+ api.registerTool((ctx) => ({
3463
+
3456
3464
  name: "project_shared_patterns",
3457
3465
  description: "Find patterns shared between two projects. Useful for maintaining consistency across related projects.",
3458
3466
  parameters: {
@@ -3483,7 +3491,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3483
3491
  };
3484
3492
  }
3485
3493
  },
3486
- },
3494
+ }),
3487
3495
  { name: "project_shared_patterns" },
3488
3496
  );
3489
3497
  }
@@ -3492,8 +3500,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3492
3500
  // 38. project_context
3493
3501
  // --------------------------------------------------------------------------
3494
3502
  if (isToolEnabled("project_context")) {
3495
- api.registerTool(
3496
- {
3503
+ api.registerTool((ctx) => ({
3504
+
3497
3505
  name: "project_context",
3498
3506
  description:
3499
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.",
@@ -3521,7 +3529,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3521
3529
  };
3522
3530
  }
3523
3531
  },
3524
- },
3532
+ }),
3525
3533
  { name: "project_context" },
3526
3534
  );
3527
3535
  }
@@ -3530,8 +3538,8 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3530
3538
  // 39. memory_health
3531
3539
  // --------------------------------------------------------------------------
3532
3540
  if (isToolEnabled("memory_health")) {
3533
- api.registerTool(
3534
- {
3541
+ api.registerTool((ctx) => ({
3542
+
3535
3543
  name: "memory_health",
3536
3544
  description: "Check the MemoryRelay API connectivity and health status.",
3537
3545
  parameters: {
@@ -3552,7 +3560,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3552
3560
  };
3553
3561
  }
3554
3562
  },
3555
- },
3563
+ }),
3556
3564
  { name: "memory_health" },
3557
3565
  );
3558
3566
  }
@@ -3856,7 +3864,7 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3856
3864
  }
3857
3865
 
3858
3866
  api.logger.info?.(
3859
- `memory-memoryrelay: plugin v0.12.5 loaded (39 tools, autoRecall: ${cfg?.autoRecall}, autoCapture: ${autoCaptureConfig.enabled ? autoCaptureConfig.tier : 'off'}, debug: ${debugEnabled})`,
3867
+ `memory-memoryrelay: plugin v0.12.6 loaded (39 tools, autoRecall: ${cfg?.autoRecall}, autoCapture: ${autoCaptureConfig.enabled ? autoCaptureConfig.tier : 'off'}, debug: ${debugEnabled})`,
3860
3868
  );
3861
3869
 
3862
3870
  // ========================================================================
@@ -3955,11 +3963,11 @@ export default async function plugin(api: OpenClawPluginApi): Promise<void> {
3955
3963
  const testMem = await client.store("Plugin health check test", { test: "true" });
3956
3964
  await client.delete(testMem.id);
3957
3965
  return { success: true };
3958
- }},
3966
+ }}),
3959
3967
  { name: "memory_recall", test: async () => {
3960
3968
  await client.search("test", 1, 0.5);
3961
3969
  return { success: true };
3962
- }},
3970
+ }}),
3963
3971
  { name: "memory_list", test: async () => {
3964
3972
  await client.list(1);
3965
3973
  return { success: true };
@@ -2,8 +2,8 @@
2
2
  "id": "plugin-memoryrelay-ai",
3
3
  "kind": "memory",
4
4
  "name": "MemoryRelay AI",
5
- "description": "MemoryRelay v0.12.3 - Long-term memory with sessions, decisions, patterns & projects (api.memoryrelay.net)",
6
- "version": "0.12.3",
5
+ "description": "MemoryRelay v0.12.6 - Long-term memory with sessions, decisions, patterns & projects (api.memoryrelay.net)",
6
+ "version": "0.12.7",
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.5",
3
+ "version": "0.12.7",
4
4
  "description": "OpenClaw memory plugin for MemoryRelay API - sessions, decisions, patterns, projects & semantic search",
5
5
  "type": "module",
6
6
  "main": "index.ts",