@memoryrelay/plugin-memoryrelay-ai 0.6.0 → 0.7.0
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/LICENSE +1 -1
- package/README.md +209 -555
- package/index.ts +2970 -293
- package/openclaw.plugin.json +45 -9
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -1,634 +1,288 @@
|
|
|
1
|
-
#
|
|
1
|
+
# MemoryRelay AI - OpenClaw Memory Plugin
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@memoryrelay/plugin-memoryrelay-ai)
|
|
4
|
-
[](https://www.npmjs.com/package/@memoryrelay/plugin-memoryrelay-ai)
|
|
4
|
+
[](https://openclaw.ai)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
AI-powered long-term memory for OpenClaw agents. Gives your AI assistant persistent memory, project context, architectural decision records, reusable patterns, and session tracking across conversations.
|
|
7
7
|
|
|
8
8
|
## Features
|
|
9
9
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
10
|
+
- **39 Tools** covering memories, entities, sessions, decisions, patterns, and projects
|
|
11
|
+
- **Semantic Search** - Vector-based retrieval finds relevant context by meaning
|
|
12
|
+
- **Auto-Recall** - Automatically injects relevant memories into agent context
|
|
13
|
+
- **Project-First Workflow** - Agents receive workflow instructions to start with project context
|
|
14
|
+
- **Decision Records** - Track and check architectural decisions before making new ones
|
|
15
|
+
- **Pattern Library** - Create, search, and adopt reusable conventions across projects
|
|
16
|
+
- **Session Tracking** - Track work sessions with summaries for continuity
|
|
17
|
+
- **Tool Group Filtering** - Enable only the tool groups you need
|
|
17
18
|
|
|
18
19
|
## Installation
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
openclaw plugins install @memoryrelay/plugin-memoryrelay-ai
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Or via npm:
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
npm install -g @memoryrelay/plugin-memoryrelay-ai
|
|
28
|
-
```
|
|
21
|
+
### Requirements
|
|
29
22
|
|
|
30
|
-
|
|
23
|
+
- OpenClaw >= 2026.2.26
|
|
24
|
+
- Node.js >= 18.0.0
|
|
25
|
+
- MemoryRelay API key ([get one at memoryrelay.ai](https://memoryrelay.ai))
|
|
31
26
|
|
|
32
|
-
###
|
|
27
|
+
### Install via OpenClaw CLI
|
|
33
28
|
|
|
34
29
|
```bash
|
|
35
30
|
openclaw plugins install @memoryrelay/plugin-memoryrelay-ai
|
|
36
31
|
```
|
|
37
32
|
|
|
38
|
-
###
|
|
33
|
+
### Configuration
|
|
39
34
|
|
|
40
|
-
**Option A: Config file** (recommended)
|
|
41
35
|
```bash
|
|
42
|
-
|
|
43
|
-
"apiKey": "
|
|
44
|
-
"agentId": "
|
|
36
|
+
openclaw config set plugins.entries.plugin-memoryrelay-ai.config '{
|
|
37
|
+
"apiKey": "mem_prod_your_key_here",
|
|
38
|
+
"agentId": "your-agent-name",
|
|
39
|
+
"defaultProject": "my-project",
|
|
45
40
|
"autoRecall": true,
|
|
46
41
|
"autoCapture": false
|
|
47
|
-
}'
|
|
48
|
-
mv /tmp/config.json ~/.openclaw/openclaw.json && \
|
|
49
|
-
chmod 600 ~/.openclaw/openclaw.json
|
|
50
|
-
```
|
|
42
|
+
}'
|
|
51
43
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export
|
|
55
|
-
export
|
|
56
|
-
```
|
|
44
|
+
# Or use environment variables
|
|
45
|
+
export MEMORYRELAY_API_KEY="mem_prod_your_key_here"
|
|
46
|
+
export MEMORYRELAY_AGENT_ID="your-agent-name"
|
|
47
|
+
export MEMORYRELAY_DEFAULT_PROJECT="my-project"
|
|
57
48
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```bash
|
|
49
|
+
# Restart gateway
|
|
61
50
|
openclaw gateway restart
|
|
62
51
|
```
|
|
63
52
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
53
|
+
## Configuration Options
|
|
54
|
+
|
|
55
|
+
| Option | Type | Default | Description |
|
|
56
|
+
|--------|------|---------|-------------|
|
|
57
|
+
| `apiKey` | string | — | MemoryRelay API key (or `MEMORYRELAY_API_KEY` env var) |
|
|
58
|
+
| `agentId` | string | — | Unique agent identifier (or `MEMORYRELAY_AGENT_ID` env var, or agent name) |
|
|
59
|
+
| `apiUrl` | string | `https://api.memoryrelay.net` | API endpoint (or `MEMORYRELAY_API_URL` env var) |
|
|
60
|
+
| `defaultProject` | string | — | Default project slug applied to sessions, decisions, and memories |
|
|
61
|
+
| `enabledTools` | string | `all` | Comma-separated tool groups: `memory`, `entity`, `agent`, `session`, `decision`, `pattern`, `project`, `health` |
|
|
62
|
+
| `autoRecall` | boolean | `true` | Inject relevant memories into context each turn |
|
|
63
|
+
| `autoCapture` | boolean | `false` | Auto-capture important information from conversations |
|
|
64
|
+
| `recallLimit` | number | `5` | Max memories to inject per turn (1-20) |
|
|
65
|
+
| `recallThreshold` | number | `0.3` | Minimum similarity score for recall (0-1) |
|
|
66
|
+
| `excludeChannels` | string[] | `[]` | Channel IDs to skip auto-recall |
|
|
67
|
+
|
|
68
|
+
## Agent Workflow
|
|
69
|
+
|
|
70
|
+
The plugin injects workflow instructions into every agent conversation via the `before_agent_start` hook, guiding the AI to follow a project-first approach:
|
|
71
|
+
|
|
72
|
+
1. **Load context** — `project_context(project)` loads hot-tier memories, active decisions, and adopted patterns
|
|
73
|
+
2. **Start session** — `session_start(title, project)` begins tracking work
|
|
74
|
+
3. **Check decisions** — `decision_check(query, project)` before architectural choices
|
|
75
|
+
4. **Find patterns** — `pattern_search(query)` to find established conventions
|
|
76
|
+
5. **Store findings** — `memory_store(content)` for important information
|
|
77
|
+
6. **Record decisions** — `decision_record(title, rationale)` for significant choices
|
|
78
|
+
7. **End session** — `session_end(session_id, summary)` with accomplishment summary
|
|
79
|
+
|
|
80
|
+
For new projects, the agent is guided to call `project_register()` first.
|
|
81
|
+
|
|
82
|
+
## Tool Reference
|
|
83
|
+
|
|
84
|
+
### Memory Tools (9 tools) — group: `memory`
|
|
85
|
+
|
|
86
|
+
| Tool | Description |
|
|
87
|
+
|------|-------------|
|
|
88
|
+
| `memory_store` | Store a memory with optional project scoping, deduplication, importance, and tier |
|
|
89
|
+
| `memory_recall` | Semantic search across memories with project/tier/importance filters |
|
|
90
|
+
| `memory_forget` | Delete a memory by ID or search query |
|
|
91
|
+
| `memory_list` | List recent memories with pagination |
|
|
92
|
+
| `memory_get` | Retrieve a specific memory by ID |
|
|
93
|
+
| `memory_update` | Update content of an existing memory |
|
|
94
|
+
| `memory_batch_store` | Store multiple memories in one call |
|
|
95
|
+
| `memory_context` | Build a token-budget-aware context window from relevant memories |
|
|
96
|
+
| `memory_promote` | Update a memory's importance score and tier |
|
|
97
|
+
|
|
98
|
+
### Entity Tools (4 tools) — group: `entity`
|
|
99
|
+
|
|
100
|
+
| Tool | Description |
|
|
101
|
+
|------|-------------|
|
|
102
|
+
| `entity_create` | Create a knowledge graph node (person, place, org, project, concept) |
|
|
103
|
+
| `entity_link` | Link an entity to a memory with a relationship label |
|
|
104
|
+
| `entity_list` | List entities with pagination |
|
|
105
|
+
| `entity_graph` | Explore an entity's neighborhood in the knowledge graph |
|
|
106
|
+
|
|
107
|
+
### Agent Tools (3 tools) — group: `agent`
|
|
108
|
+
|
|
109
|
+
| Tool | Description |
|
|
110
|
+
|------|-------------|
|
|
111
|
+
| `agent_list` | List available agents |
|
|
112
|
+
| `agent_create` | Create a new agent (memory namespace) |
|
|
113
|
+
| `agent_get` | Get agent details by ID |
|
|
114
|
+
|
|
115
|
+
### Session Tools (4 tools) — group: `session`
|
|
116
|
+
|
|
117
|
+
| Tool | Description |
|
|
118
|
+
|------|-------------|
|
|
119
|
+
| `session_start` | Start a work session with title and project |
|
|
120
|
+
| `session_end` | End a session with a summary |
|
|
121
|
+
| `session_recall` | Get session details and timeline |
|
|
122
|
+
| `session_list` | List sessions filtered by project or status |
|
|
123
|
+
|
|
124
|
+
### Decision Tools (4 tools) — group: `decision`
|
|
125
|
+
|
|
126
|
+
| Tool | Description |
|
|
127
|
+
|------|-------------|
|
|
128
|
+
| `decision_record` | Record an architectural decision with rationale and alternatives |
|
|
129
|
+
| `decision_list` | List decisions filtered by project, status, or tags |
|
|
130
|
+
| `decision_supersede` | Replace a decision with a new one (old is marked superseded) |
|
|
131
|
+
| `decision_check` | Semantic search for existing decisions before making new ones |
|
|
132
|
+
|
|
133
|
+
### Pattern Tools (4 tools) — group: `pattern`
|
|
134
|
+
|
|
135
|
+
| Tool | Description |
|
|
136
|
+
|------|-------------|
|
|
137
|
+
| `pattern_create` | Create a reusable convention with example code |
|
|
138
|
+
| `pattern_search` | Semantic search for established patterns |
|
|
139
|
+
| `pattern_adopt` | Adopt an existing pattern for a project |
|
|
140
|
+
| `pattern_suggest` | Get pattern suggestions based on project stack |
|
|
141
|
+
|
|
142
|
+
### Project Tools (10 tools) — group: `project`
|
|
143
|
+
|
|
144
|
+
| Tool | Description |
|
|
145
|
+
|------|-------------|
|
|
146
|
+
| `project_register` | Register a project with slug, name, stack, and repo URL |
|
|
147
|
+
| `project_list` | List all registered projects |
|
|
148
|
+
| `project_info` | Get project details |
|
|
149
|
+
| `project_add_relationship` | Add relationship between projects (depends_on, extends, etc.) |
|
|
150
|
+
| `project_dependencies` | List projects that a project depends on |
|
|
151
|
+
| `project_dependents` | List projects that depend on a project |
|
|
152
|
+
| `project_related` | List all related projects (any direction) |
|
|
153
|
+
| `project_impact` | Analyze blast radius of a proposed change |
|
|
154
|
+
| `project_shared_patterns` | Find patterns shared between two projects |
|
|
155
|
+
| `project_context` | Load full project context (memories, decisions, patterns, sessions) |
|
|
156
|
+
|
|
157
|
+
### Health Tools (1 tool) — group: `health`
|
|
158
|
+
|
|
159
|
+
| Tool | Description |
|
|
160
|
+
|------|-------------|
|
|
161
|
+
| `memory_health` | Check API connectivity and health status |
|
|
162
|
+
|
|
163
|
+
## Tool Group Filtering
|
|
164
|
+
|
|
165
|
+
Only enable the groups you need:
|
|
151
166
|
|
|
152
|
-
**Rate Limit**: 30 requests per minute
|
|
153
|
-
|
|
154
|
-
#### `memory_recall`
|
|
155
|
-
|
|
156
|
-
Search memories using semantic similarity.
|
|
157
|
-
|
|
158
|
-
**Parameters:**
|
|
159
|
-
- `query` (string, required) - Natural language search query
|
|
160
|
-
- `limit` (number, optional, default: 10) - Maximum results (1-50)
|
|
161
|
-
- `threshold` (number, optional, default: 0.5) - Minimum similarity score (0-1)
|
|
162
|
-
|
|
163
|
-
**Example:**
|
|
164
|
-
```typescript
|
|
165
|
-
memory_recall({
|
|
166
|
-
query: "user communication preferences",
|
|
167
|
-
limit: 5,
|
|
168
|
-
threshold: 0.7
|
|
169
|
-
})
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**Returns:** Array of search results with `memory` object and `score` (0-1):
|
|
173
167
|
```json
|
|
174
168
|
{
|
|
175
|
-
"
|
|
176
|
-
{
|
|
177
|
-
"memory": {
|
|
178
|
-
"id": "550e8400-...",
|
|
179
|
-
"content": "User prefers concise bullet-point responses",
|
|
180
|
-
"metadata": { "category": "preferences" },
|
|
181
|
-
"created_at": 1707649200
|
|
182
|
-
},
|
|
183
|
-
"score": 0.89
|
|
184
|
-
}
|
|
185
|
-
]
|
|
169
|
+
"enabledTools": "memory,session,decision"
|
|
186
170
|
}
|
|
187
171
|
```
|
|
188
172
|
|
|
189
|
-
|
|
173
|
+
This enables only the memory (9), session (4), and decision (4) tools — 17 tools instead of 39. Useful for reducing tool clutter when you don't need project graphs or pattern management.
|
|
190
174
|
|
|
191
|
-
|
|
175
|
+
Available groups: `memory`, `entity`, `agent`, `session`, `decision`, `pattern`, `project`, `health`
|
|
192
176
|
|
|
193
|
-
|
|
194
|
-
- `memoryId` (string, optional) - Memory UUID to delete
|
|
195
|
-
- `query` (string, optional) - Search query (shows candidates if multiple matches)
|
|
177
|
+
Set to `all` (or omit) to enable everything.
|
|
196
178
|
|
|
197
|
-
|
|
198
|
-
```typescript
|
|
199
|
-
// By ID
|
|
200
|
-
memory_forget({ memoryId: "550e8400-..." })
|
|
201
|
-
|
|
202
|
-
// By query (interactive if multiple matches)
|
|
203
|
-
memory_forget({ query: "outdated preference" })
|
|
204
|
-
```
|
|
179
|
+
## Auto-Recall
|
|
205
180
|
|
|
206
|
-
|
|
181
|
+
When `autoRecall: true`, relevant memories are automatically injected into agent context each turn:
|
|
207
182
|
|
|
208
|
-
### Status Monitoring
|
|
209
|
-
|
|
210
|
-
Check plugin status directly (don't rely on `openclaw status` - see [Known Limitations](#known-limitations)):
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
# Check plugin loaded
|
|
214
|
-
openclaw plugins info plugin-memoryrelay-ai
|
|
215
|
-
|
|
216
|
-
# Check connection via logs
|
|
217
|
-
journalctl -u openclaw-gateway -f | grep memory-memoryrelay
|
|
218
|
-
|
|
219
|
-
# Test tools directly
|
|
220
|
-
openclaw memoryrelay search "test query"
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### CLI Commands
|
|
224
|
-
|
|
225
|
-
```bash
|
|
226
|
-
# Check status
|
|
227
|
-
openclaw memoryrelay status
|
|
228
|
-
|
|
229
|
-
# List recent memories
|
|
230
|
-
openclaw memoryrelay list --limit 10
|
|
231
|
-
|
|
232
|
-
# Search memories
|
|
233
|
-
openclaw memoryrelay search "API configuration"
|
|
234
183
|
```
|
|
184
|
+
User: "How should I handle authentication in this project?"
|
|
235
185
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
```xml
|
|
241
|
-
<relevant-memories>
|
|
242
|
-
The following memories from MemoryRelay may be relevant:
|
|
243
|
-
- User prefers concise responses
|
|
244
|
-
- Project uses TypeScript with strict mode
|
|
245
|
-
- ...
|
|
246
|
-
</relevant-memories>
|
|
186
|
+
[Plugin searches memories for "authentication"]
|
|
187
|
+
[Injects workflow instructions + top 5 relevant memories into context]
|
|
188
|
+
Agent uses past decisions and patterns to inform its response
|
|
247
189
|
```
|
|
248
190
|
|
|
249
|
-
|
|
250
|
-
- `recallLimit`: Max memories (default: 5)
|
|
251
|
-
- `recallThreshold`: Min similarity score (default: 0.3)
|
|
252
|
-
|
|
253
|
-
### Auto-Capture
|
|
254
|
-
|
|
255
|
-
When `autoCapture: true`, the plugin detects and stores important information automatically.
|
|
256
|
-
|
|
257
|
-
**Patterns detected:**
|
|
258
|
-
- "remember that..."
|
|
259
|
-
- "my name/email/phone is..."
|
|
260
|
-
- "important: ..."
|
|
261
|
-
- API keys, SSH configs, preferences
|
|
262
|
-
|
|
263
|
-
**Note:** Disabled by default for privacy.
|
|
264
|
-
|
|
265
|
-
## Configuration
|
|
191
|
+
## Channel Exclusions
|
|
266
192
|
|
|
267
|
-
|
|
268
|
-
|-------|------|----------|---------|-------------|
|
|
269
|
-
| `apiKey` | string | ✅ | - | MemoryRelay API key |
|
|
270
|
-
| `agentId` | string | ✅ | - | Unique agent identifier |
|
|
271
|
-
| `apiUrl` | string | No | `api.memoryrelay.net` | API endpoint |
|
|
272
|
-
| `autoRecall` | boolean | No | `true` | Auto-inject memories |
|
|
273
|
-
| `autoCapture` | boolean | No | `false` | Auto-store information |
|
|
274
|
-
| `recallLimit` | number | No | `5` | Max memories to inject |
|
|
275
|
-
| `recallThreshold` | number | No | `0.3` | Similarity threshold (0-1) |
|
|
193
|
+
Exclude specific channels from auto-recall and workflow injection:
|
|
276
194
|
|
|
277
|
-
### Environment Variables
|
|
278
|
-
|
|
279
|
-
Alternatively, use environment variables:
|
|
280
|
-
|
|
281
|
-
```bash
|
|
282
|
-
export MEMORYRELAY_API_KEY="mem_prod_..."
|
|
283
|
-
export MEMORYRELAY_AGENT_ID="my-agent"
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
Then reference in config:
|
|
287
195
|
```json
|
|
288
196
|
{
|
|
289
|
-
"
|
|
290
|
-
|
|
197
|
+
"excludeChannels": [
|
|
198
|
+
"telegram:group_123456",
|
|
199
|
+
"discord:channel_789012"
|
|
200
|
+
]
|
|
291
201
|
}
|
|
292
202
|
```
|
|
293
203
|
|
|
294
|
-
##
|
|
295
|
-
|
|
296
|
-
MemoryRelay works **alongside** OpenClaw's built-in memory system (not as a replacement):
|
|
297
|
-
|
|
298
|
-
**OpenClaw Built-in Memory** (local):
|
|
299
|
-
- Workspace files (`MEMORY.md`, `memory/*.md`)
|
|
300
|
-
- Fast local access, version control friendly
|
|
301
|
-
- Tools: `memory_search`, `memory_get`
|
|
302
|
-
- Scope: Per-agent, stays on disk
|
|
303
|
-
|
|
304
|
-
**MemoryRelay Plugin** (cloud):
|
|
305
|
-
- Cloud-backed API storage
|
|
306
|
-
- Cross-agent sharing, persistent
|
|
307
|
-
- Tools: `memory_store`, `memory_recall`, `memory_forget`
|
|
308
|
-
- Scope: Shared across agents, 900+ memories
|
|
309
|
-
|
|
310
|
-
**Both systems run together** - use built-in for local context, MemoryRelay for long-term cross-agent knowledge.
|
|
311
|
-
|
|
312
|
-
```
|
|
313
|
-
┌─────────────────────┐ ┌─────────────────────┐
|
|
314
|
-
│ Built-in Memory │ │ MemoryRelay Plugin │
|
|
315
|
-
│ (Local Files) │ │ (Cloud API) │
|
|
316
|
-
├─────────────────────┤ ├─────────────────────┤
|
|
317
|
-
│ memory_search │ │ memory_store │
|
|
318
|
-
│ memory_get │ │ memory_recall │
|
|
319
|
-
│ │ │ memory_forget │
|
|
320
|
-
└──────────┬──────────┘ └──────────┬──────────┘
|
|
321
|
-
│ │
|
|
322
|
-
└─────────────┬───────────────┘
|
|
323
|
-
│
|
|
324
|
-
↓
|
|
325
|
-
┌─────────────────┐
|
|
326
|
-
│ OpenClaw Agent │
|
|
327
|
-
└─────────────────┘
|
|
328
|
-
```
|
|
329
|
-
|
|
330
|
-
## Known Limitations
|
|
331
|
-
|
|
332
|
-
### Status Display Issue
|
|
333
|
-
|
|
334
|
-
**Symptom**: `openclaw status` shows "Memory: unavailable" even when plugin is working.
|
|
335
|
-
|
|
336
|
-
**Root Cause**: OpenClaw's status command checks the built-in MemoryIndexManager, not plugin tools. This is an OpenClaw architecture limitation, not a bug in this plugin.
|
|
337
|
-
|
|
338
|
-
**Impact**: Cosmetic only - all plugin functionality works perfectly:
|
|
339
|
-
- ✅ memory_store, memory_recall, memory_forget tools work
|
|
340
|
-
- ✅ AutoRecall and AutoCapture work
|
|
341
|
-
- ✅ API connectivity works (921 memories stored)
|
|
342
|
-
- ❌ Status display shows wrong system
|
|
343
|
-
|
|
344
|
-
**Workaround**: Verify plugin functionality directly instead of relying on status:
|
|
204
|
+
## CLI Commands
|
|
345
205
|
|
|
346
206
|
```bash
|
|
347
|
-
#
|
|
348
|
-
openclaw
|
|
349
|
-
#
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
# Should show: "memory-memoryrelay: connected to https://api.memoryrelay.net"
|
|
354
|
-
|
|
355
|
-
# 3. Test memory_store tool
|
|
356
|
-
openclaw agents <your-agent> --one-shot "Store test: Plugin works"
|
|
357
|
-
|
|
358
|
-
# 4. Test memory_recall tool
|
|
359
|
-
openclaw memoryrelay search "plugin works"
|
|
360
|
-
|
|
361
|
-
# 5. Check API directly
|
|
362
|
-
curl -H "X-API-Key: YOUR_KEY" https://api.memoryrelay.net/v1/memories?agent_id=YOUR_AGENT&limit=1
|
|
207
|
+
openclaw memoryrelay status # Check connection and stats
|
|
208
|
+
openclaw memoryrelay stats # Show memory count
|
|
209
|
+
openclaw memoryrelay list # List recent memories
|
|
210
|
+
openclaw memoryrelay search "query" # Search memories
|
|
211
|
+
openclaw memoryrelay delete <id> # Delete a memory
|
|
212
|
+
openclaw memoryrelay export # Export all memories to JSON
|
|
363
213
|
```
|
|
364
214
|
|
|
365
|
-
|
|
366
|
-
1. `memory.backend` (top-level, status checks this)
|
|
367
|
-
2. `plugins.slots.memory` (plugin tools, status ignores this)
|
|
368
|
-
|
|
369
|
-
Our plugin provides tools (#2), but status checks the backend (#1). Fixing this requires OpenClaw core changes to check plugin status when a memory slot is configured.
|
|
215
|
+
## Privacy & Security
|
|
370
216
|
|
|
371
|
-
**
|
|
217
|
+
- **Cloud-Backed** — Memories stored on MemoryRelay servers (HTTPS-encrypted in transit)
|
|
218
|
+
- **API Key Auth** — Bearer token authentication
|
|
219
|
+
- **Agent Isolation** — Memories scoped per agent ID
|
|
220
|
+
- **Channel Filtering** — Exclude sensitive channels from auto-recall
|
|
221
|
+
- **No Auto-Capture by Default** — Manual storage gives you full control
|
|
222
|
+
- **Never store secrets** — Do not store API keys, passwords, or tokens as memories. Use encrypted local files or secret managers instead.
|
|
372
223
|
|
|
373
224
|
## Troubleshooting
|
|
374
225
|
|
|
375
226
|
### Plugin Not Loading
|
|
376
227
|
|
|
377
228
|
```bash
|
|
378
|
-
# Check plugin status
|
|
379
229
|
openclaw plugins list | grep memoryrelay
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
openclaw doctor
|
|
383
|
-
|
|
384
|
-
# Check logs
|
|
385
|
-
journalctl -u openclaw-gateway -f
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
### Connection Failed
|
|
389
|
-
|
|
390
|
-
```bash
|
|
391
|
-
# Test API directly
|
|
392
|
-
curl https://api.memoryrelay.net/v1/health
|
|
393
|
-
|
|
394
|
-
# Check API key
|
|
395
|
-
openclaw memoryrelay status
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
### No Memories Returned
|
|
399
|
-
|
|
400
|
-
- Check `recallThreshold` (lower = more results)
|
|
401
|
-
- Verify `agentId` matches your API agent
|
|
402
|
-
- Try broader search queries
|
|
403
|
-
|
|
404
|
-
## Security
|
|
405
|
-
|
|
406
|
-
- API keys stored in `openclaw.json` (not committed to git)
|
|
407
|
-
- Supports environment variable substitution
|
|
408
|
-
- Auto-capture disabled by default (privacy)
|
|
409
|
-
- No hardcoded credentials
|
|
410
|
-
|
|
411
|
-
**Best Practices:**
|
|
412
|
-
- Use environment variables in production
|
|
413
|
-
- Never commit `openclaw.json` with real keys
|
|
414
|
-
- Rotate API keys regularly
|
|
415
|
-
- Review auto-captured memories periodically
|
|
416
|
-
|
|
417
|
-
## Development
|
|
418
|
-
|
|
419
|
-
### File Structure
|
|
420
|
-
|
|
421
|
-
```
|
|
422
|
-
openclaw-plugin/
|
|
423
|
-
├── index.ts # Plugin implementation
|
|
424
|
-
├── openclaw.plugin.json # Plugin manifest
|
|
425
|
-
├── package.json # NPM metadata
|
|
426
|
-
├── LICENSE # MIT license
|
|
427
|
-
└── README.md # This file
|
|
230
|
+
openclaw config get plugins.entries.plugin-memoryrelay-ai
|
|
231
|
+
openclaw logs --tail 100 | grep memory
|
|
428
232
|
```
|
|
429
233
|
|
|
430
|
-
###
|
|
234
|
+
### API Connection Issues
|
|
431
235
|
|
|
432
236
|
```bash
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
# Test tools
|
|
437
|
-
# (via agent conversation or CLI)
|
|
438
|
-
|
|
439
|
-
# View logs
|
|
440
|
-
tail -f ~/.openclaw/logs/gateway.log
|
|
237
|
+
curl -H "Authorization: Bearer YOUR_API_KEY" \
|
|
238
|
+
https://api.memoryrelay.net/v1/health
|
|
441
239
|
```
|
|
442
240
|
|
|
443
|
-
## Related Projects
|
|
444
|
-
|
|
445
|
-
- **MemoryRelay API** — REST API backend (FastAPI + PostgreSQL)
|
|
446
|
-
- **MCP Server** — [`memoryrelay-mcp-server`](https://www.npmjs.com/package/memoryrelay-mcp-server) for Claude Desktop
|
|
447
|
-
- **Python SDK** — `memoryrelay` on PyPI (coming soon)
|
|
448
|
-
|
|
449
|
-
## Contributing
|
|
450
|
-
|
|
451
|
-
Contributions welcome! Please:
|
|
452
|
-
|
|
453
|
-
1. Fork the repository
|
|
454
|
-
2. Create a feature branch
|
|
455
|
-
3. Add tests (if applicable)
|
|
456
|
-
4. Update documentation
|
|
457
|
-
5. Submit a pull request
|
|
458
|
-
|
|
459
|
-
## Support
|
|
460
|
-
|
|
461
|
-
- **Issues**: [GitHub Issues](https://github.com/memoryrelay/openclaw-plugin/issues)
|
|
462
|
-
- **Docs**: [memoryrelay.io](https://memoryrelay.io)
|
|
463
|
-
- **Discord**: [OpenClaw Community](https://discord.gg/clawd)
|
|
464
|
-
|
|
465
|
-
## License
|
|
466
|
-
|
|
467
|
-
MIT © 2026 MemoryRelay
|
|
468
|
-
|
|
469
|
-
---
|
|
470
|
-
|
|
471
241
|
## Changelog
|
|
472
242
|
|
|
473
|
-
### v0.
|
|
474
|
-
|
|
475
|
-
**Clarifications:**
|
|
476
|
-
- ✅ Documented that plugin works ALONGSIDE built-in memory (not as replacement)
|
|
477
|
-
- ✅ Added "Known Limitations" section explaining status display issue
|
|
478
|
-
- ✅ Provided verification steps for users (don't rely on `openclaw status`)
|
|
479
|
-
- ✅ Clarified architecture: two memory systems working together
|
|
480
|
-
- ✅ Explained Voyage comparison (embedding provider vs storage provider)
|
|
481
|
-
|
|
482
|
-
**No Code Changes:**
|
|
483
|
-
- Plugin functionality unchanged (already working perfectly)
|
|
484
|
-
- Tools work: memory_store, memory_recall, memory_forget ✅
|
|
485
|
-
- AutoRecall/AutoCapture work ✅
|
|
486
|
-
- 921 memories stored in production ✅
|
|
487
|
-
|
|
488
|
-
**Key Finding:**
|
|
489
|
-
- Status shows "unavailable" because OpenClaw checks built-in MemoryIndexManager, not plugin tools
|
|
490
|
-
- This is an OpenClaw architecture limitation requiring upstream fix
|
|
491
|
-
- All plugin functionality verified working despite status display
|
|
492
|
-
|
|
493
|
-
### v0.4.0 (2026-02-13) - Status Reporting
|
|
494
|
-
|
|
495
|
-
**New Features:**
|
|
496
|
-
- ✅ Status reporting via `memory.status` gateway RPC method
|
|
497
|
-
- ✅ Plugin now reports "available" in `openclaw status` when API is reachable
|
|
498
|
-
- ✅ Memory count reporting (via optional `/v1/stats` API endpoint)
|
|
499
|
-
- ✅ Vector availability reporting for semantic search
|
|
500
|
-
- ✅ Detailed status information: connected state, endpoint, agent ID, memory count
|
|
501
|
-
|
|
502
|
-
**Fixes:**
|
|
503
|
-
- ✅ Plugin no longer shows as "unavailable" in `openclaw status` when functional
|
|
504
|
-
- ✅ Status accurately reflects API connection state
|
|
505
|
-
|
|
506
|
-
**Technical Improvements:**
|
|
507
|
-
- ✅ Extracted constants for maintainability (`DEFAULT_API_URL`, `VALID_HEALTH_STATUSES`)
|
|
508
|
-
- ✅ Case-insensitive health status validation
|
|
509
|
-
- ✅ Proper type safety with nullish coalescing operators
|
|
510
|
-
- ✅ Graceful handling of missing stats endpoint (backwards compatible)
|
|
511
|
-
|
|
512
|
-
**Backwards Compatibility:**
|
|
513
|
-
- Fully compatible with older OpenClaw versions (uses optional chaining)
|
|
514
|
-
- Gracefully handles missing `/v1/stats` endpoint
|
|
515
|
-
|
|
516
|
-
### v0.3.0 (2026-02-13) - Better Installation UX
|
|
517
|
-
|
|
518
|
-
**Improved Installation Experience:**
|
|
519
|
-
- ✅ API key can now come from `MEMORYRELAY_API_KEY` env var
|
|
520
|
-
- ✅ Agent ID can come from `MEMORYRELAY_AGENT_ID` env var or defaults to "default"
|
|
521
|
-
- ✅ Clear error message with setup instructions when config is missing
|
|
522
|
-
- ✅ Comprehensive installation guide in README
|
|
523
|
-
- ✅ No more silent failures - helpful error messages
|
|
524
|
-
|
|
525
|
-
**Breaking Change:**
|
|
526
|
-
- Debug logging removed (replaced with helpful error messages)
|
|
527
|
-
|
|
528
|
-
**Migration:**
|
|
529
|
-
Works out of the box with env vars, or add config after install:
|
|
530
|
-
```bash
|
|
531
|
-
cat ~/.openclaw/openclaw.json | jq '.plugins.entries."plugin-memoryrelay-ai".config = {"apiKey": "YOUR_KEY", "agentId": "YOUR_AGENT"}' > /tmp/config.json && mv /tmp/config.json ~/.openclaw/openclaw.json
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
### v0.2.4 (2026-02-13)
|
|
535
|
-
|
|
536
|
-
**Debug Logging:**
|
|
537
|
-
- Added detailed logging to diagnose config loading issues
|
|
538
|
-
- Logs pluginConfig type, keys, and specific missing fields
|
|
539
|
-
- Helps identify why apiKey/agentId aren't being read
|
|
540
|
-
- Better error messages for troubleshooting
|
|
541
|
-
|
|
542
|
-
### v0.2.3 (2026-02-13)
|
|
543
|
-
|
|
544
|
-
**Critical Fix:**
|
|
545
|
-
- Fixed API endpoint paths - removed duplicate `/memories` segment
|
|
546
|
-
- Changed `/v1/memories/memories` → `/v1/memories`
|
|
547
|
-
- Changed `/v1/memories/memories/{id}` → `/v1/memories/{id}`
|
|
548
|
-
- Fixed 405 Method Not Allowed errors
|
|
549
|
-
- All CRUD operations now work correctly
|
|
243
|
+
### v0.7.0 (2026-03-05)
|
|
550
244
|
|
|
551
|
-
|
|
245
|
+
- **NEW**: 39 tools (up from 3) covering full MemoryRelay API surface
|
|
246
|
+
- **NEW**: Session tracking — `session_start`, `session_end`, `session_recall`, `session_list`
|
|
247
|
+
- **NEW**: Decision records — `decision_record`, `decision_list`, `decision_supersede`, `decision_check`
|
|
248
|
+
- **NEW**: Pattern library — `pattern_create`, `pattern_search`, `pattern_adopt`, `pattern_suggest`
|
|
249
|
+
- **NEW**: Project management — `project_register`, `project_list`, `project_info`, relationships, impact analysis, shared patterns, full context loading
|
|
250
|
+
- **NEW**: Enhanced memory tools — project scoping, deduplication, importance scores, three-tier storage, batch store, context building, promotion
|
|
251
|
+
- **NEW**: Agent workflow instructions injected via `before_agent_start` hook
|
|
252
|
+
- **NEW**: Tool group filtering via `enabledTools` config
|
|
253
|
+
- **NEW**: `defaultProject` config for automatic project scoping
|
|
254
|
+
- **FIX**: Workflow instructions now injected regardless of autoRecall setting
|
|
552
255
|
|
|
553
|
-
|
|
554
|
-
- Fixed tool registration API - changed `inputSchema` to `parameters`
|
|
555
|
-
- Fixed handler signature - changed `handler` to `execute` with `_id` parameter
|
|
556
|
-
- Tools now register correctly with OpenClaw
|
|
557
|
-
- Memory storage/recall/forget now functional
|
|
558
|
-
- Plugin shows as "available" instead of "unavailable"
|
|
256
|
+
### v0.6.2 (2026-03-01)
|
|
559
257
|
|
|
560
|
-
|
|
258
|
+
- **FIX**: OpenClaw 2026.2.26 compatibility — Changed `extensions` from `["./"]` to `["./index.ts"]`
|
|
259
|
+
- **DOCS**: Added comprehensive README and migration guide
|
|
561
260
|
|
|
562
|
-
|
|
563
|
-
- Made `apiKey` and `agentId` optional in config schema
|
|
564
|
-
- Allows installation without pre-configuring credentials
|
|
565
|
-
- Plugin auto-detects agentId and supports MEMORYRELAY_API_KEY env var
|
|
566
|
-
- Fixes "must have required property" errors during installation
|
|
261
|
+
### v0.6.0 (2026-02-18)
|
|
567
262
|
|
|
568
|
-
|
|
263
|
+
- **NEW**: Retry logic with exponential backoff (3 attempts)
|
|
264
|
+
- **NEW**: Request timeout (30 seconds)
|
|
265
|
+
- **NEW**: Environment variable fallback support
|
|
266
|
+
- **NEW**: Channel filtering (`excludeChannels` config)
|
|
569
267
|
|
|
570
|
-
|
|
571
|
-
- Old: `@memoryrelay/openclaw-plugin`
|
|
572
|
-
- New: `@memoryrelay/plugin-memoryrelay-ai`
|
|
573
|
-
- Plugin ID remains: `plugin-memoryrelay-ai`
|
|
574
|
-
- **Why**: Package name must match plugin ID to avoid config warnings
|
|
575
|
-
- **Impact**: No code changes, just package name alignment
|
|
268
|
+
## Development
|
|
576
269
|
|
|
577
|
-
**Migration**:
|
|
578
270
|
```bash
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
### v0.1.2 (2026-02-13)
|
|
586
|
-
|
|
587
|
-
**Bug Fix:**
|
|
588
|
-
- Fixed installation directory mismatch by adding `openclaw.id` to package.json
|
|
589
|
-
- Plugin now correctly installs to `plugin-memoryrelay-ai` directory
|
|
590
|
-
- Resolves "plugin not found" error during `openclaw plugins install`
|
|
591
|
-
|
|
592
|
-
### v0.1.1 (2026-02-13)
|
|
593
|
-
|
|
594
|
-
**Breaking Changes:**
|
|
595
|
-
- Plugin ID changed: `memory-memoryrelay` → `plugin-memoryrelay-ai`
|
|
596
|
-
- Update your `openclaw.json` to use new ID in `plugins.slots.memory` and `plugins.entries`
|
|
597
|
-
|
|
598
|
-
**Documentation Improvements:**
|
|
599
|
-
- ✅ Added agent_id auto-injection documentation
|
|
600
|
-
- ✅ Added size limits (content 1-50K chars, metadata 10KB)
|
|
601
|
-
- ✅ Added rate limit info (30 req/min)
|
|
602
|
-
- ✅ Enhanced tool documentation with return formats
|
|
603
|
-
- ✅ Added response format examples for memory_recall
|
|
604
|
-
|
|
605
|
-
**Migration Guide:**
|
|
606
|
-
```json
|
|
607
|
-
{
|
|
608
|
-
"plugins": {
|
|
609
|
-
"slots": {
|
|
610
|
-
"memory": "plugin-memoryrelay-ai" // Changed
|
|
611
|
-
},
|
|
612
|
-
"entries": {
|
|
613
|
-
"plugin-memoryrelay-ai": { // Changed
|
|
614
|
-
"enabled": true,
|
|
615
|
-
"config": { ... }
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
}
|
|
271
|
+
git clone https://github.com/memoryrelay/openclaw-plugin.git
|
|
272
|
+
cd openclaw-plugin
|
|
273
|
+
npm install
|
|
274
|
+
npm test # Run once (50 tests)
|
|
275
|
+
npm run test:watch # Watch mode
|
|
276
|
+
npm run test:coverage # With coverage
|
|
620
277
|
```
|
|
621
278
|
|
|
622
|
-
|
|
279
|
+
## License
|
|
623
280
|
|
|
624
|
-
-
|
|
625
|
-
- Three tools: memory_store, memory_recall, memory_forget
|
|
626
|
-
- Auto-recall and auto-capture features
|
|
627
|
-
- CLI commands
|
|
628
|
-
- Production deployment on 3 agents
|
|
281
|
+
MIT License - see [LICENSE](./LICENSE) file
|
|
629
282
|
|
|
630
|
-
|
|
283
|
+
## Links
|
|
631
284
|
|
|
632
|
-
**
|
|
633
|
-
**
|
|
634
|
-
**
|
|
285
|
+
- **MemoryRelay**: https://memoryrelay.ai
|
|
286
|
+
- **OpenClaw**: https://docs.openclaw.ai
|
|
287
|
+
- **Repository**: https://github.com/memoryrelay/openclaw-plugin
|
|
288
|
+
- **Issues**: https://github.com/memoryrelay/openclaw-plugin/issues
|