memorylake-openclaw 0.0.2 → 0.0.3
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/.github/workflows/release.yml +23 -0
- package/docs/openclaw.mdx +98 -0
- package/index.ts +3 -13
- package/package.json +5 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Publish Package to npmjs
|
|
2
|
+
on:
|
|
3
|
+
# Trigger on tag push
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*.*.*'
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
id-token: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v5
|
|
15
|
+
# Setup .npmrc file to publish to npm
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: '24.x'
|
|
19
|
+
registry-url: 'https://registry.npmjs.org'
|
|
20
|
+
- run: npm i && npm ci
|
|
21
|
+
- run: npm publish
|
|
22
|
+
env:
|
|
23
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: OpenClaw
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Add long-term memory to [OpenClaw](https://github.com/openclaw/openclaw) agents with the `memorylake-openclaw` plugin. Your agent forgets everything between sessions — this plugin fixes that by automatically watching conversations, extracting what matters, and bringing it back when relevant.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
{/*<Frame>
|
|
10
|
+
<img src="/images/openclaw-architecture.png" alt="OpenClaw MemoryLake Architecture" />
|
|
11
|
+
</Frame>*/}
|
|
12
|
+
|
|
13
|
+
The plugin provides:
|
|
14
|
+
1. **Auto-Recall** — Before the agent responds, memories matching the current message are injected into context
|
|
15
|
+
2. **Auto-Capture** — After the agent responds, the exchange is sent to MemoryLake which decides what's worth keeping
|
|
16
|
+
3. **Agent Tools** — Five tools for explicit memory operations during conversations
|
|
17
|
+
|
|
18
|
+
Both auto-recall and auto-capture run silently with no manual configuration required.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
openclaw plugins install memorylake-openclaw
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Setup and Configuration
|
|
27
|
+
|
|
28
|
+
<Note>Get your API key and project ID from [app.memorylake.ai](https://app.memorylake.ai).</Note>
|
|
29
|
+
|
|
30
|
+
Add to your `openclaw.json`:
|
|
31
|
+
|
|
32
|
+
```json5
|
|
33
|
+
// plugins.entries
|
|
34
|
+
"memorylake-openclaw": {
|
|
35
|
+
"enabled": true,
|
|
36
|
+
"config": {
|
|
37
|
+
"apiKey": "${MEMORYLAKE_API_KEY}",
|
|
38
|
+
"projectId": "proj-...",
|
|
39
|
+
"userId": "your-user-id"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Agent Tools
|
|
45
|
+
|
|
46
|
+
The agent gets five tools it can call during conversations:
|
|
47
|
+
|
|
48
|
+
| Tool | Description |
|
|
49
|
+
|------|-------------|
|
|
50
|
+
| `memory_search` | Search memories by natural language |
|
|
51
|
+
| `memory_list` | List all stored memories for a user |
|
|
52
|
+
| `memory_store` | Explicitly save a fact |
|
|
53
|
+
| `memory_get` | Retrieve a memory by ID |
|
|
54
|
+
| `memory_forget` | Delete a memory by ID |
|
|
55
|
+
|
|
56
|
+
## CLI Commands
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Search memories
|
|
60
|
+
openclaw memorylake search "what languages does the user know"
|
|
61
|
+
|
|
62
|
+
# View stats
|
|
63
|
+
openclaw memorylake stats
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Configuration Options
|
|
67
|
+
|
|
68
|
+
| Key | Type | Default | Description |
|
|
69
|
+
|-----|------|---------|-------------|
|
|
70
|
+
| `apiKey` | `string` | — | **Required.** MemoryLake API key (supports `${MEMORYLAKE_API_KEY}`) |
|
|
71
|
+
| `projectId` | `string` | — | **Required.** MemoryLake project ID |
|
|
72
|
+
| `host` | `string` | `https://app.memorylake.ai` | MemoryLake server endpoint URL |
|
|
73
|
+
| `userId` | `string` | `"default"` | Scope memories per user |
|
|
74
|
+
| `autoRecall` | `boolean` | `true` | Inject memories before each turn |
|
|
75
|
+
| `autoCapture` | `boolean` | `true` | Store facts after each turn |
|
|
76
|
+
| `topK` | `number` | `5` | Max memories per recall |
|
|
77
|
+
| `searchThreshold` | `number` | `0.3` | Min similarity (0–1) |
|
|
78
|
+
| `rerank` | `boolean` | `true` | Rerank search results for better relevance |
|
|
79
|
+
|
|
80
|
+
## Key Features
|
|
81
|
+
|
|
82
|
+
1. **Zero Configuration** — Auto-recall and auto-capture work out of the box with no prompting required
|
|
83
|
+
2. **Async Processing** — Memory extraction runs asynchronously via MemoryLake's API
|
|
84
|
+
3. **Session Tracking** — Conversations are tagged with `chat_session_id` for traceability
|
|
85
|
+
4. **Rich Tool Suite** — Five agent tools for explicit memory operations when needed
|
|
86
|
+
|
|
87
|
+
## Conclusion
|
|
88
|
+
|
|
89
|
+
The `memorylake-openclaw` plugin gives OpenClaw agents persistent memory with minimal setup. Your agents can remember user preferences, facts, and context across sessions automatically.
|
|
90
|
+
|
|
91
|
+
{/*<CardGroup cols={2}>
|
|
92
|
+
<Card title="MemoryLake" icon="brain" href="https://app.memorylake.ai">
|
|
93
|
+
MemoryLake platform
|
|
94
|
+
</Card>
|
|
95
|
+
<Card title="OpenClaw" icon="robot" href="https://github.com/openclaw/openclaw">
|
|
96
|
+
OpenClaw agent framework
|
|
97
|
+
</Card>
|
|
98
|
+
</CardGroup>*/}
|
package/index.ts
CHANGED
|
@@ -213,16 +213,6 @@ function normalizeAddResult(raw: any): AddResult {
|
|
|
213
213
|
// Config Parser
|
|
214
214
|
// ============================================================================
|
|
215
215
|
|
|
216
|
-
function resolveEnvVars(value: string): string {
|
|
217
|
-
return value.replace(/\$\{([^}]+)\}/g, (_, envVar) => {
|
|
218
|
-
const envValue = process.env[envVar];
|
|
219
|
-
if (!envValue) {
|
|
220
|
-
throw new Error(`Environment variable ${envVar} is not set`);
|
|
221
|
-
}
|
|
222
|
-
return envValue;
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
|
|
226
216
|
// ============================================================================
|
|
227
217
|
// Config Schema
|
|
228
218
|
// ============================================================================
|
|
@@ -267,10 +257,10 @@ const memoryLakeConfigSchema = {
|
|
|
267
257
|
return {
|
|
268
258
|
host:
|
|
269
259
|
typeof cfg.host === "string" && cfg.host
|
|
270
|
-
?
|
|
260
|
+
? cfg.host
|
|
271
261
|
: "https://app.memorylake.ai",
|
|
272
|
-
apiKey:
|
|
273
|
-
projectId:
|
|
262
|
+
apiKey: cfg.apiKey as string,
|
|
263
|
+
projectId: cfg.projectId as string,
|
|
274
264
|
userId:
|
|
275
265
|
typeof cfg.userId === "string" && cfg.userId ? cfg.userId : "default",
|
|
276
266
|
autoCapture: cfg.autoCapture !== false,
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memorylake-openclaw",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MemoryLake memory backend for OpenClaw",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/memorylake-ai/memorylake-openclaw.git"
|
|
10
|
+
},
|
|
7
11
|
"keywords": [
|
|
8
12
|
"openclaw",
|
|
9
13
|
"plugin",
|