@memoryrelay/plugin-memoryrelay-ai 0.6.2 → 0.8.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/README.md +427 -171
- package/bin/memoryrelay-health.js +46 -0
- package/bin/memoryrelay-logs.js +48 -0
- package/bin/memoryrelay-metrics.js +57 -0
- package/bin/memoryrelay-test.js +46 -0
- package/index.ts +3033 -221
- package/openclaw.plugin.json +22 -3
- package/package.json +10 -2
- package/src/debug-logger.test.ts +233 -0
- package/src/debug-logger.ts +187 -0
- package/src/status-reporter.test.ts +230 -0
- package/src/status-reporter.ts +284 -0
package/README.md
CHANGED
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@memoryrelay/plugin-memoryrelay-ai)
|
|
4
4
|
[](https://openclaw.ai)
|
|
5
5
|
|
|
6
|
-
AI-powered long-term memory
|
|
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
|
+
- **Debug & Monitoring** - Comprehensive logging, health checks, and performance metrics (v0.8.0+)
|
|
12
|
+
- **CLI Commands** - 4 commands for debugging and diagnostics (v0.8.0+)
|
|
13
|
+
- **Semantic Search** - Vector-based retrieval finds relevant context by meaning
|
|
14
|
+
- **Auto-Recall** - Automatically injects relevant memories into agent context
|
|
15
|
+
- **Project-First Workflow** - Agents receive workflow instructions to start with project context
|
|
16
|
+
- **Decision Records** - Track and check architectural decisions before making new ones
|
|
17
|
+
- **Pattern Library** - Create, search, and adopt reusable conventions across projects
|
|
18
|
+
- **Session Tracking** - Track work sessions with summaries for continuity
|
|
19
|
+
- **Tool Group Filtering** - Enable only the tool groups you need
|
|
17
20
|
|
|
18
21
|
## Installation
|
|
19
22
|
|
|
@@ -26,28 +29,24 @@ AI-powered long-term memory with semantic search for OpenClaw agents. Store memo
|
|
|
26
29
|
### Install via OpenClaw CLI
|
|
27
30
|
|
|
28
31
|
```bash
|
|
29
|
-
# Install from npm
|
|
30
32
|
openclaw plugins install @memoryrelay/plugin-memoryrelay-ai
|
|
31
|
-
|
|
32
|
-
# Or install from local directory (development)
|
|
33
|
-
openclaw plugins install --link /path/to/plugin-improvements
|
|
34
33
|
```
|
|
35
34
|
|
|
36
35
|
### Configuration
|
|
37
36
|
|
|
38
37
|
```bash
|
|
39
|
-
# Set configuration
|
|
40
38
|
openclaw config set plugins.entries.plugin-memoryrelay-ai.config '{
|
|
41
39
|
"apiKey": "mem_prod_your_key_here",
|
|
42
40
|
"agentId": "your-agent-name",
|
|
41
|
+
"defaultProject": "my-project",
|
|
43
42
|
"autoRecall": true,
|
|
44
|
-
"autoCapture": false
|
|
45
|
-
"recallLimit": 5
|
|
43
|
+
"autoCapture": false
|
|
46
44
|
}'
|
|
47
45
|
|
|
48
46
|
# Or use environment variables
|
|
49
47
|
export MEMORYRELAY_API_KEY="mem_prod_your_key_here"
|
|
50
48
|
export MEMORYRELAY_AGENT_ID="your-agent-name"
|
|
49
|
+
export MEMORYRELAY_DEFAULT_PROJECT="my-project"
|
|
51
50
|
|
|
52
51
|
# Restart gateway
|
|
53
52
|
openclaw gateway restart
|
|
@@ -57,249 +56,506 @@ openclaw gateway restart
|
|
|
57
56
|
|
|
58
57
|
| Option | Type | Default | Description |
|
|
59
58
|
|--------|------|---------|-------------|
|
|
60
|
-
| `apiKey` | string |
|
|
61
|
-
| `agentId` | string |
|
|
62
|
-
| `apiUrl` | string | `https://api.memoryrelay.net` |
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
65
|
-
| `
|
|
59
|
+
| `apiKey` | string | — | MemoryRelay API key (or `MEMORYRELAY_API_KEY` env var) |
|
|
60
|
+
| `agentId` | string | — | Unique agent identifier (or `MEMORYRELAY_AGENT_ID` env var, or agent name) |
|
|
61
|
+
| `apiUrl` | string | `https://api.memoryrelay.net` | API endpoint (or `MEMORYRELAY_API_URL` env var) |
|
|
62
|
+
| `defaultProject` | string | — | Default project slug applied to sessions, decisions, and memories |
|
|
63
|
+
| `enabledTools` | string | `all` | Comma-separated tool groups: `memory`, `entity`, `agent`, `session`, `decision`, `pattern`, `project`, `health` |
|
|
64
|
+
| `autoRecall` | boolean | `true` | Inject relevant memories into context each turn |
|
|
65
|
+
| `autoCapture` | boolean | `false` | Auto-capture important information from conversations |
|
|
66
|
+
| `recallLimit` | number | `5` | Max memories to inject per turn (1-20) |
|
|
66
67
|
| `recallThreshold` | number | `0.3` | Minimum similarity score for recall (0-1) |
|
|
67
|
-
| `excludeChannels` | string[] | `[]` | Channel IDs to skip auto-recall
|
|
68
|
+
| `excludeChannels` | string[] | `[]` | Channel IDs to skip auto-recall |
|
|
69
|
+
| `debug` | boolean | `false` | Enable debug logging of API calls (v0.8.0+) |
|
|
70
|
+
| `verbose` | boolean | `false` | Include request/response bodies in debug logs (v0.8.0+) |
|
|
71
|
+
| `logFile` | string | — | Optional file path for persistent debug logs (v0.8.0+) |
|
|
72
|
+
| `maxLogEntries` | number | `100` | Circular buffer size for in-memory logs (v0.8.0+) |
|
|
73
|
+
|
|
74
|
+
## Debug & Monitoring (v0.8.0+)
|
|
75
|
+
|
|
76
|
+
### Enable Debug Mode
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"plugins": {
|
|
81
|
+
"entries": {
|
|
82
|
+
"plugin-memoryrelay-ai": {
|
|
83
|
+
"enabled": true,
|
|
84
|
+
"config": {
|
|
85
|
+
"apiKey": "mem_prod_xxxxx",
|
|
86
|
+
"agentId": "your-agent",
|
|
87
|
+
"debug": true,
|
|
88
|
+
"verbose": false,
|
|
89
|
+
"maxLogEntries": 1000
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### CLI Commands
|
|
98
|
+
|
|
99
|
+
The plugin provides four CLI commands for debugging and monitoring:
|
|
100
|
+
|
|
101
|
+
#### View Debug Logs
|
|
102
|
+
```bash
|
|
103
|
+
# Last 20 logs
|
|
104
|
+
memoryrelay-logs
|
|
105
|
+
|
|
106
|
+
# Last 50 logs
|
|
107
|
+
memoryrelay-logs --limit=50
|
|
108
|
+
|
|
109
|
+
# Filter by tool
|
|
110
|
+
memoryrelay-logs --tool=memory_store --limit=20
|
|
111
|
+
|
|
112
|
+
# Show errors only
|
|
113
|
+
memoryrelay-logs --errors-only
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### Health Check
|
|
117
|
+
```bash
|
|
118
|
+
# Run comprehensive health check
|
|
119
|
+
memoryrelay-health
|
|
68
120
|
|
|
69
|
-
|
|
121
|
+
# Tests API connectivity, authentication, and core tools
|
|
122
|
+
```
|
|
70
123
|
|
|
71
|
-
|
|
124
|
+
#### Test Individual Tools
|
|
125
|
+
```bash
|
|
126
|
+
# Test specific tool
|
|
127
|
+
memoryrelay-test --tool=memory_store
|
|
128
|
+
memoryrelay-test --tool=memory_recall
|
|
129
|
+
memoryrelay-test --tool=project_list
|
|
130
|
+
```
|
|
72
131
|
|
|
73
|
-
|
|
132
|
+
#### View Performance Metrics
|
|
133
|
+
```bash
|
|
134
|
+
# Show performance statistics
|
|
135
|
+
memoryrelay-metrics
|
|
136
|
+
|
|
137
|
+
# Displays per-tool metrics:
|
|
138
|
+
# - Call count
|
|
139
|
+
# - Success rate
|
|
140
|
+
# - Average duration
|
|
141
|
+
# - p95/p99 latencies
|
|
142
|
+
```
|
|
74
143
|
|
|
75
|
-
|
|
76
|
-
// Store a memory
|
|
77
|
-
memory_store({
|
|
78
|
-
content: "User prefers concise responses over long explanations",
|
|
79
|
-
metadata: { category: "preference", topic: "communication" }
|
|
80
|
-
})
|
|
144
|
+
### Gateway Method Calls
|
|
81
145
|
|
|
82
|
-
|
|
83
|
-
memory_recall({
|
|
84
|
-
query: "communication preferences",
|
|
85
|
-
limit: 5
|
|
86
|
-
})
|
|
146
|
+
You can also call these commands via the OpenClaw gateway:
|
|
87
147
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
148
|
+
```bash
|
|
149
|
+
openclaw gateway call memoryrelay.logs '{"limit": 20}'
|
|
150
|
+
openclaw gateway call memoryrelay.health
|
|
151
|
+
openclaw gateway call memoryrelay.test '{"tool": "memory_store"}'
|
|
152
|
+
openclaw gateway call memoryrelay.metrics
|
|
92
153
|
```
|
|
93
154
|
|
|
94
|
-
###
|
|
155
|
+
### Enhanced Status Reporting
|
|
156
|
+
|
|
157
|
+
The `memory.status` gateway method now provides comprehensive reports including:
|
|
95
158
|
|
|
96
|
-
|
|
159
|
+
- Connection status with response time
|
|
160
|
+
- Tool breakdown by category (39 tools across 8 groups)
|
|
161
|
+
- Recent API call history
|
|
162
|
+
- Known issues with affected tools
|
|
163
|
+
- Debug/verbose mode status
|
|
97
164
|
|
|
165
|
+
```bash
|
|
166
|
+
openclaw gateway call memory.status
|
|
98
167
|
```
|
|
99
|
-
User: "What's my API key for NorthRelay?"
|
|
100
168
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
169
|
+
### Debug Log Format
|
|
170
|
+
|
|
171
|
+
When debug mode is enabled, each API call is logged with:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
TIMESTAMP TOOL DURATION STATUS ERROR
|
|
175
|
+
━━━━━━━━━━━━━━━━━ ━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━ ━━━━━━ ━━━━━━━━━━━━━━━━━━━
|
|
176
|
+
7:35:15 PM memory_store 142ms ✓
|
|
177
|
+
7:35:10 PM memory_recall 78ms ✓
|
|
178
|
+
7:35:05 PM memory_batch_store 245ms ✗ 500 Internal Server Error
|
|
104
179
|
```
|
|
105
180
|
|
|
106
|
-
|
|
181
|
+
Verbose mode additionally captures request/response bodies for deep troubleshooting.
|
|
182
|
+
|
|
183
|
+
### Performance Impact
|
|
184
|
+
|
|
185
|
+
- **Debug disabled**: ~0ms overhead (no-op checks)
|
|
186
|
+
- **Debug enabled**: ~1-2ms per call (logging only)
|
|
187
|
+
- **Verbose enabled**: ~2-5ms per call (includes JSON serialization)
|
|
188
|
+
- **Memory usage**: ~10KB (default 100 entries) to ~100KB (1000 entries)
|
|
189
|
+
|
|
190
|
+
## Agent Workflow
|
|
107
191
|
|
|
108
|
-
|
|
192
|
+
The plugin injects workflow instructions into every agent conversation via the `before_agent_start` hook, guiding the AI to follow a project-first approach:
|
|
193
|
+
|
|
194
|
+
1. **Load context** — `project_context(project)` loads hot-tier memories, active decisions, and adopted patterns
|
|
195
|
+
2. **Start session** — `session_start(title, project)` begins tracking work
|
|
196
|
+
3. **Check decisions** — `decision_check(query, project)` before architectural choices
|
|
197
|
+
4. **Find patterns** — `pattern_search(query)` to find established conventions
|
|
198
|
+
5. **Store findings** — `memory_store(content)` for important information
|
|
199
|
+
6. **Record decisions** — `decision_record(title, rationale)` for significant choices
|
|
200
|
+
7. **End session** — `session_end(session_id, summary)` with accomplishment summary
|
|
201
|
+
|
|
202
|
+
For new projects, the agent is guided to call `project_register()` first.
|
|
203
|
+
|
|
204
|
+
## Tool Reference
|
|
205
|
+
|
|
206
|
+
### Memory Tools (9 tools) — group: `memory`
|
|
207
|
+
|
|
208
|
+
| Tool | Description |
|
|
209
|
+
|------|-------------|
|
|
210
|
+
| `memory_store` | Store a memory with optional project scoping, deduplication, importance, and tier |
|
|
211
|
+
| `memory_recall` | Semantic search across memories with project/tier/importance filters |
|
|
212
|
+
| `memory_forget` | Delete a memory by ID or search query |
|
|
213
|
+
| `memory_list` | List recent memories with pagination |
|
|
214
|
+
| `memory_get` | Retrieve a specific memory by ID |
|
|
215
|
+
| `memory_update` | Update content of an existing memory |
|
|
216
|
+
| `memory_batch_store` | Store multiple memories in one call |
|
|
217
|
+
| `memory_context` | Build a token-budget-aware context window from relevant memories |
|
|
218
|
+
| `memory_promote` | Update a memory's importance score and tier |
|
|
219
|
+
|
|
220
|
+
### Entity Tools (4 tools) — group: `entity`
|
|
221
|
+
|
|
222
|
+
| Tool | Description |
|
|
223
|
+
|------|-------------|
|
|
224
|
+
| `entity_create` | Create a knowledge graph node (person, place, org, project, concept) |
|
|
225
|
+
| `entity_link` | Link an entity to a memory with a relationship label |
|
|
226
|
+
| `entity_list` | List entities with pagination |
|
|
227
|
+
| `entity_graph` | Explore an entity's neighborhood in the knowledge graph |
|
|
228
|
+
|
|
229
|
+
### Agent Tools (3 tools) — group: `agent`
|
|
230
|
+
|
|
231
|
+
| Tool | Description |
|
|
232
|
+
|------|-------------|
|
|
233
|
+
| `agent_list` | List available agents |
|
|
234
|
+
| `agent_create` | Create a new agent (memory namespace) |
|
|
235
|
+
| `agent_get` | Get agent details by ID |
|
|
236
|
+
|
|
237
|
+
### Session Tools (4 tools) — group: `session`
|
|
238
|
+
|
|
239
|
+
| Tool | Description |
|
|
240
|
+
|------|-------------|
|
|
241
|
+
| `session_start` | Start a work session with title and project |
|
|
242
|
+
| `session_end` | End a session with a summary |
|
|
243
|
+
| `session_recall` | Get session details and timeline |
|
|
244
|
+
| `session_list` | List sessions filtered by project or status |
|
|
245
|
+
|
|
246
|
+
### Decision Tools (4 tools) — group: `decision`
|
|
247
|
+
|
|
248
|
+
| Tool | Description |
|
|
249
|
+
|------|-------------|
|
|
250
|
+
| `decision_record` | Record an architectural decision with rationale and alternatives |
|
|
251
|
+
| `decision_list` | List decisions filtered by project, status, or tags |
|
|
252
|
+
| `decision_supersede` | Replace a decision with a new one (old is marked superseded) |
|
|
253
|
+
| `decision_check` | Semantic search for existing decisions before making new ones |
|
|
254
|
+
|
|
255
|
+
### Pattern Tools (4 tools) — group: `pattern`
|
|
256
|
+
|
|
257
|
+
| Tool | Description |
|
|
258
|
+
|------|-------------|
|
|
259
|
+
| `pattern_create` | Create a reusable convention with example code |
|
|
260
|
+
| `pattern_search` | Semantic search for established patterns |
|
|
261
|
+
| `pattern_adopt` | Adopt an existing pattern for a project |
|
|
262
|
+
| `pattern_suggest` | Get pattern suggestions based on project stack |
|
|
263
|
+
|
|
264
|
+
### Project Tools (10 tools) — group: `project`
|
|
265
|
+
|
|
266
|
+
| Tool | Description |
|
|
267
|
+
|------|-------------|
|
|
268
|
+
| `project_register` | Register a project with slug, name, stack, and repo URL |
|
|
269
|
+
| `project_list` | List all registered projects |
|
|
270
|
+
| `project_info` | Get project details |
|
|
271
|
+
| `project_add_relationship` | Add relationship between projects (depends_on, extends, etc.) |
|
|
272
|
+
| `project_dependencies` | List projects that a project depends on |
|
|
273
|
+
| `project_dependents` | List projects that depend on a project |
|
|
274
|
+
| `project_related` | List all related projects (any direction) |
|
|
275
|
+
| `project_impact` | Analyze blast radius of a proposed change |
|
|
276
|
+
| `project_shared_patterns` | Find patterns shared between two projects |
|
|
277
|
+
| `project_context` | Load full project context (memories, decisions, patterns, sessions) |
|
|
278
|
+
|
|
279
|
+
### Health Tools (1 tool) — group: `health`
|
|
280
|
+
|
|
281
|
+
| Tool | Description |
|
|
282
|
+
|------|-------------|
|
|
283
|
+
| `memory_health` | Check API connectivity and health status |
|
|
284
|
+
|
|
285
|
+
## Tool Group Filtering
|
|
286
|
+
|
|
287
|
+
Only enable the groups you need:
|
|
109
288
|
|
|
110
289
|
```json
|
|
111
290
|
{
|
|
112
|
-
"
|
|
113
|
-
"telegram:group_123456",
|
|
114
|
-
"discord:channel_789012",
|
|
115
|
-
"whatsapp:group_345678@g.us"
|
|
116
|
-
]
|
|
291
|
+
"enabledTools": "memory,session,decision"
|
|
117
292
|
}
|
|
118
293
|
```
|
|
119
294
|
|
|
120
|
-
|
|
295
|
+
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.
|
|
121
296
|
|
|
122
|
-
|
|
297
|
+
Available groups: `memory`, `entity`, `agent`, `session`, `decision`, `pattern`, `project`, `health`
|
|
123
298
|
|
|
124
|
-
|
|
125
|
-
- **Infrastructure** - `"Production server: 51.161.10.58, SSH port 2222"`
|
|
126
|
-
- **Commands** - `"Deploy command: cd /opt/app && docker compose up -d"`
|
|
127
|
-
- **Preferences** - `"User prefers Python over JavaScript for data analysis"`
|
|
128
|
-
- **Project Context** - `"NorthRelay uses Next.js 16, Prisma 6, PostgreSQL 15"`
|
|
129
|
-
- **Lessons Learned** - `"Always run git pull before deploying to avoid conflicts"`
|
|
299
|
+
Set to `all` (or omit) to enable everything.
|
|
130
300
|
|
|
131
|
-
|
|
301
|
+
## Auto-Recall
|
|
132
302
|
|
|
133
|
-
|
|
134
|
-
- Temporary context (one-time questions)
|
|
135
|
-
- Already well-documented info (in README, docs)
|
|
136
|
-
- Personal secrets user explicitly says not to store
|
|
303
|
+
When `autoRecall: true`, relevant memories are automatically injected into agent context each turn:
|
|
137
304
|
|
|
138
|
-
|
|
305
|
+
```
|
|
306
|
+
User: "How should I handle authentication in this project?"
|
|
139
307
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
308
|
+
[Plugin searches memories for "authentication"]
|
|
309
|
+
[Injects workflow instructions + top 5 relevant memories into context]
|
|
310
|
+
Agent uses past decisions and patterns to inform its response
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Channel Exclusions
|
|
144
314
|
|
|
145
|
-
|
|
315
|
+
Exclude specific channels from auto-recall and workflow injection:
|
|
146
316
|
|
|
317
|
+
```json
|
|
318
|
+
{
|
|
319
|
+
"excludeChannels": [
|
|
320
|
+
"telegram:group_123456",
|
|
321
|
+
"discord:channel_789012"
|
|
322
|
+
]
|
|
323
|
+
}
|
|
147
324
|
```
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
↓
|
|
159
|
-
┌─────────────────┐
|
|
160
|
-
│ MemoryRelay │
|
|
161
|
-
│ API │
|
|
162
|
-
│ (Vector Search) │
|
|
163
|
-
└─────────────────┘
|
|
325
|
+
|
|
326
|
+
## CLI Commands
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
openclaw memoryrelay status # Check connection and stats
|
|
330
|
+
openclaw memoryrelay stats # Show memory count
|
|
331
|
+
openclaw memoryrelay list # List recent memories
|
|
332
|
+
openclaw memoryrelay search "query" # Search memories
|
|
333
|
+
openclaw memoryrelay delete <id> # Delete a memory
|
|
334
|
+
openclaw memoryrelay export # Export all memories to JSON
|
|
164
335
|
```
|
|
165
336
|
|
|
166
337
|
## Privacy & Security
|
|
167
338
|
|
|
168
|
-
- **Cloud-Backed**
|
|
169
|
-
- **API Key Auth**
|
|
170
|
-
- **Agent Isolation**
|
|
171
|
-
- **Channel Filtering**
|
|
172
|
-
- **No Auto-Capture by Default**
|
|
339
|
+
- **Cloud-Backed** — Memories stored on MemoryRelay servers (HTTPS-encrypted in transit)
|
|
340
|
+
- **API Key Auth** — Bearer token authentication
|
|
341
|
+
- **Agent Isolation** — Memories scoped per agent ID
|
|
342
|
+
- **Channel Filtering** — Exclude sensitive channels from auto-recall
|
|
343
|
+
- **No Auto-Capture by Default** — Manual storage gives you full control
|
|
344
|
+
- **Never store secrets** — Do not store API keys, passwords, or tokens as memories. Use encrypted local files or secret managers instead.
|
|
173
345
|
|
|
174
|
-
|
|
346
|
+
## Troubleshooting
|
|
175
347
|
|
|
176
|
-
|
|
348
|
+
### Plugin Not Loading
|
|
177
349
|
|
|
350
|
+
**Symptoms**: Plugin doesn't appear in `openclaw plugins list` or shows as "unavailable"
|
|
351
|
+
|
|
352
|
+
**Solutions**:
|
|
178
353
|
```bash
|
|
179
|
-
# Check
|
|
180
|
-
|
|
354
|
+
# Check if installed
|
|
355
|
+
npm list -g @memoryrelay/plugin-memoryrelay-ai
|
|
356
|
+
|
|
357
|
+
# Reinstall if needed
|
|
358
|
+
openclaw plugins install @memoryrelay/plugin-memoryrelay-ai --force
|
|
181
359
|
|
|
182
|
-
#
|
|
183
|
-
openclaw plugins
|
|
360
|
+
# Check config syntax
|
|
361
|
+
cat ~/.openclaw/openclaw.json | jq '.plugins.entries."plugin-memoryrelay-ai"'
|
|
184
362
|
|
|
185
|
-
#
|
|
186
|
-
openclaw
|
|
187
|
-
openclaw plugins disable plugin-memoryrelay-ai
|
|
363
|
+
# Restart gateway
|
|
364
|
+
openclaw gateway restart
|
|
188
365
|
|
|
189
|
-
#
|
|
190
|
-
openclaw
|
|
366
|
+
# Check logs for errors
|
|
367
|
+
openclaw gateway logs | grep memoryrelay
|
|
191
368
|
```
|
|
192
369
|
|
|
193
|
-
|
|
370
|
+
### API Connection Issues
|
|
194
371
|
|
|
195
|
-
|
|
372
|
+
**Symptoms**: "Failed to connect" errors, timeouts, or "unhealthy" status
|
|
196
373
|
|
|
374
|
+
**Solutions**:
|
|
197
375
|
```bash
|
|
198
|
-
#
|
|
199
|
-
|
|
376
|
+
# Test API directly
|
|
377
|
+
curl -H "X-API-Key: YOUR_KEY" https://api.memoryrelay.net/v1/health
|
|
200
378
|
|
|
201
|
-
#
|
|
202
|
-
openclaw
|
|
379
|
+
# Check gateway logs
|
|
380
|
+
openclaw gateway logs -f | grep memory-memoryrelay
|
|
203
381
|
|
|
204
|
-
#
|
|
205
|
-
openclaw
|
|
382
|
+
# Verify API key format (should be mem_prod_xxxxx with 32 chars after prefix)
|
|
383
|
+
openclaw config get plugins.entries.plugin-memoryrelay-ai.config.apiKey
|
|
384
|
+
|
|
385
|
+
# Run health check
|
|
386
|
+
memoryrelay-health
|
|
206
387
|
```
|
|
207
388
|
|
|
208
|
-
###
|
|
389
|
+
### Auto-Recall Not Working
|
|
390
|
+
|
|
391
|
+
**Symptoms**: Memories not appearing in agent context
|
|
392
|
+
|
|
393
|
+
**Checks**:
|
|
394
|
+
1. Verify `autoRecall: true` in config
|
|
395
|
+
2. Check memories exist: `openclaw gateway call memory_list '{"limit": 10}'`
|
|
396
|
+
3. Lower `recallThreshold` (try 0.1) for more results
|
|
397
|
+
4. Review logs: `openclaw gateway logs | grep "injecting.*memories"`
|
|
398
|
+
5. Check channel not in `excludeChannels`
|
|
399
|
+
|
|
400
|
+
### Debug Mode Not Working
|
|
401
|
+
|
|
402
|
+
**Symptoms**: `memoryrelay-logs` shows "No logs" or debug commands fail
|
|
403
|
+
|
|
404
|
+
**Solutions**:
|
|
405
|
+
1. Verify `debug: true` in config
|
|
406
|
+
2. Restart gateway after config change: `openclaw gateway restart`
|
|
407
|
+
3. Use the plugin to generate logs
|
|
408
|
+
4. Check `maxLogEntries` isn't set too low (default: 100)
|
|
409
|
+
|
|
410
|
+
### Tool Not Found Errors
|
|
209
411
|
|
|
412
|
+
**Symptoms**: "Tool xxx not found" or "Tool not enabled"
|
|
413
|
+
|
|
414
|
+
**Solutions**:
|
|
415
|
+
1. Check `enabledTools` config (should be `"all"` or include the tool's group)
|
|
416
|
+
2. Verify tool name spelling matches exactly (e.g., `memory_store` not `memoryStore`)
|
|
417
|
+
3. Check plugin version: `npm list -g @memoryrelay/plugin-memoryrelay-ai`
|
|
418
|
+
4. Update to latest: `openclaw plugins install @memoryrelay/plugin-memoryrelay-ai@latest`
|
|
419
|
+
|
|
420
|
+
### Performance Issues
|
|
421
|
+
|
|
422
|
+
**Symptoms**: Slow API calls, timeouts, high latency
|
|
423
|
+
|
|
424
|
+
**Diagnosis**:
|
|
210
425
|
```bash
|
|
211
|
-
#
|
|
212
|
-
|
|
213
|
-
|
|
426
|
+
# Enable debug mode
|
|
427
|
+
openclaw config set plugins.entries.plugin-memoryrelay-ai.config.debug true
|
|
428
|
+
openclaw gateway restart
|
|
429
|
+
|
|
430
|
+
# View metrics
|
|
431
|
+
memoryrelay-metrics
|
|
432
|
+
|
|
433
|
+
# Check for slow tools (high avgDuration or p99)
|
|
434
|
+
# Check for failures (low successRate)
|
|
214
435
|
```
|
|
215
436
|
|
|
216
|
-
|
|
437
|
+
**Solutions**:
|
|
438
|
+
1. Check network latency to api.memoryrelay.net
|
|
439
|
+
2. Reduce `recallLimit` (fewer memories = faster)
|
|
440
|
+
3. Lower `recallThreshold` (fewer vector comparisons)
|
|
441
|
+
4. Check MemoryRelay API status at status.memoryrelay.ai
|
|
217
442
|
|
|
218
|
-
|
|
443
|
+
### Memory Storage Failures
|
|
219
444
|
|
|
445
|
+
**Symptoms**: `memory_store` returns 422 validation errors or 500 errors
|
|
446
|
+
|
|
447
|
+
**Common Causes**:
|
|
448
|
+
1. Content too long (max 50,000 characters)
|
|
449
|
+
2. Metadata too large (max 10KB when serialized)
|
|
450
|
+
3. Invalid project slug (use `project_list` to verify)
|
|
451
|
+
4. API rate limits exceeded (30 req/min for memory_store)
|
|
452
|
+
|
|
453
|
+
**Solutions**:
|
|
220
454
|
```bash
|
|
221
|
-
|
|
222
|
-
openclaw
|
|
455
|
+
# Test with minimal memory
|
|
456
|
+
openclaw gateway call memory_store '{"content": "Test memory"}'
|
|
457
|
+
|
|
458
|
+
# Check recent errors
|
|
459
|
+
memoryrelay-logs --errors-only --limit=10
|
|
460
|
+
|
|
461
|
+
# Verify API key has write permissions
|
|
462
|
+
curl -X POST https://api.memoryrelay.net/v1/memories \
|
|
463
|
+
-H "X-API-Key: YOUR_KEY" \
|
|
464
|
+
-H "Content-Type: application/json" \
|
|
465
|
+
-d '{"content": "Test"}'
|
|
223
466
|
```
|
|
224
467
|
|
|
225
|
-
|
|
468
|
+
### Session Tracking Issues
|
|
469
|
+
|
|
470
|
+
**Symptoms**: `session_start` fails or `session_end` can't find session
|
|
471
|
+
|
|
472
|
+
**Solutions**:
|
|
473
|
+
1. Save session ID from `session_start` response
|
|
474
|
+
2. Verify project exists: `openclaw gateway call project_list`
|
|
475
|
+
3. Check for API validation errors in logs
|
|
476
|
+
4. Use `session_list` to find active sessions
|
|
477
|
+
|
|
478
|
+
### Known Limitations
|
|
479
|
+
|
|
480
|
+
**API Issues** (reported to MemoryRelay team):
|
|
481
|
+
- `memory_batch_store`: May return 500 errors (use individual `memory_store` as workaround)
|
|
482
|
+
- `memory_context`: Returns 405 Method Not Allowed (use `memory_recall` instead)
|
|
483
|
+
- `entity_create`: May fail with 422 validation errors
|
|
484
|
+
- `decision_record`: May fail with 422 validation errors
|
|
485
|
+
- `session_start`: May fail with 422 validation errors
|
|
486
|
+
|
|
487
|
+
**Workarounds**:
|
|
488
|
+
- Use alternative tools where available
|
|
489
|
+
- Check GitHub Issues for latest status
|
|
490
|
+
- Enable debug mode to capture full error details
|
|
226
491
|
|
|
227
492
|
## Changelog
|
|
228
493
|
|
|
494
|
+
### v0.8.0 (2026-03-05)
|
|
495
|
+
|
|
496
|
+
**🚀 Debug & Monitoring Release**
|
|
497
|
+
|
|
498
|
+
- **NEW**: Debug logging system with circular buffer (configurable maxLogEntries)
|
|
499
|
+
- **NEW**: DebugLogger class tracks all API calls with timing, status, errors
|
|
500
|
+
- **NEW**: StatusReporter class provides enhanced status reports
|
|
501
|
+
- **NEW**: 4 CLI commands: `memoryrelay-logs`, `memoryrelay-health`, `memoryrelay-test`, `memoryrelay-metrics`
|
|
502
|
+
- **NEW**: 4 gateway methods: `memoryrelay.logs`, `memoryrelay.health`, `memoryrelay.test`, `memoryrelay.metrics`
|
|
503
|
+
- **NEW**: Performance metrics with p95/p99 latency tracking
|
|
504
|
+
- **NEW**: Enhanced `memory.status` handler with comprehensive reports
|
|
505
|
+
- **NEW**: Debug config options: `debug`, `verbose`, `logFile`, `maxLogEntries`
|
|
506
|
+
- **NEW**: Tool failure tracking and recovery monitoring
|
|
507
|
+
- **NEW**: Request/response capture in verbose mode
|
|
508
|
+
- **NEW**: Persistent file logging option
|
|
509
|
+
- **TESTS**: 92 tests total (73 existing + 19 new for DebugLogger and StatusReporter)
|
|
510
|
+
- **DOCS**: CLI_COMMANDS.md with complete usage guide
|
|
511
|
+
- **DOCS**: Enhanced README with Debug & Monitoring section
|
|
512
|
+
- **DOCS**: Comprehensive troubleshooting guide
|
|
513
|
+
|
|
514
|
+
**Performance**: Minimal overhead when disabled (~0ms), 1-2ms when enabled, 2-5ms in verbose mode
|
|
515
|
+
|
|
516
|
+
### v0.7.0 (2026-03-05)
|
|
517
|
+
|
|
518
|
+
- **NEW**: 39 tools (up from 3) covering full MemoryRelay API surface
|
|
519
|
+
- **NEW**: Session tracking — `session_start`, `session_end`, `session_recall`, `session_list`
|
|
520
|
+
- **NEW**: Decision records — `decision_record`, `decision_list`, `decision_supersede`, `decision_check`
|
|
521
|
+
- **NEW**: Pattern library — `pattern_create`, `pattern_search`, `pattern_adopt`, `pattern_suggest`
|
|
522
|
+
- **NEW**: Project management — `project_register`, `project_list`, `project_info`, relationships, impact analysis, shared patterns, full context loading
|
|
523
|
+
- **NEW**: Enhanced memory tools — project scoping, deduplication, importance scores, three-tier storage, batch store, context building, promotion
|
|
524
|
+
- **NEW**: Agent workflow instructions injected via `before_agent_start` hook
|
|
525
|
+
- **NEW**: Tool group filtering via `enabledTools` config
|
|
526
|
+
- **NEW**: `defaultProject` config for automatic project scoping
|
|
527
|
+
- **FIX**: Workflow instructions now injected regardless of autoRecall setting
|
|
528
|
+
|
|
229
529
|
### v0.6.2 (2026-03-01)
|
|
230
530
|
|
|
231
|
-
- **FIX**: OpenClaw 2026.2.26 compatibility
|
|
232
|
-
- **FIX**: Plugin now installs via `openclaw plugins install` (not npm global)
|
|
531
|
+
- **FIX**: OpenClaw 2026.2.26 compatibility — Changed `extensions` from `["./"]` to `["./index.ts"]`
|
|
233
532
|
- **DOCS**: Added comprehensive README and migration guide
|
|
234
533
|
|
|
235
|
-
### v0.6.1 (2026-02-18)
|
|
236
|
-
|
|
237
|
-
- Removed `extensions` field (attempted fix) - **FAILED**
|
|
238
|
-
|
|
239
534
|
### v0.6.0 (2026-02-18)
|
|
240
535
|
|
|
241
536
|
- **NEW**: Retry logic with exponential backoff (3 attempts)
|
|
242
537
|
- **NEW**: Request timeout (30 seconds)
|
|
243
|
-
- **NEW**: Environment variable fallback support
|
|
538
|
+
- **NEW**: Environment variable fallback support
|
|
244
539
|
- **NEW**: Channel filtering (`excludeChannels` config)
|
|
245
|
-
- **NEW**: Additional error handling and logging
|
|
246
|
-
|
|
247
|
-
See [CHANGELOG-v0.6.0.md](./CHANGELOG-v0.6.0.md) for details.
|
|
248
540
|
|
|
249
541
|
## Development
|
|
250
542
|
|
|
251
|
-
### Local Testing
|
|
252
|
-
|
|
253
543
|
```bash
|
|
254
|
-
# Clone repository
|
|
255
544
|
git clone https://github.com/memoryrelay/openclaw-plugin.git
|
|
256
545
|
cd openclaw-plugin
|
|
257
|
-
|
|
258
|
-
# Install dev dependencies
|
|
259
546
|
npm install
|
|
260
|
-
|
|
261
|
-
# Run tests
|
|
262
|
-
npm test
|
|
263
|
-
|
|
264
|
-
# Link for local testing
|
|
265
|
-
openclaw plugins install --link .
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
### Running Tests
|
|
269
|
-
|
|
270
|
-
```bash
|
|
271
|
-
npm test # Run once
|
|
547
|
+
npm test # Run once (50 tests)
|
|
272
548
|
npm run test:watch # Watch mode
|
|
273
549
|
npm run test:coverage # With coverage
|
|
274
550
|
```
|
|
275
551
|
|
|
276
|
-
## Contributing
|
|
277
|
-
|
|
278
|
-
Contributions welcome! Please:
|
|
279
|
-
|
|
280
|
-
1. Fork the repository
|
|
281
|
-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
282
|
-
3. Commit changes (`git commit -m 'Add amazing feature'`)
|
|
283
|
-
4. Push to branch (`git push origin feature/amazing-feature`)
|
|
284
|
-
5. Open a Pull Request
|
|
285
|
-
|
|
286
552
|
## License
|
|
287
553
|
|
|
288
554
|
MIT License - see [LICENSE](./LICENSE) file
|
|
289
555
|
|
|
290
556
|
## Links
|
|
291
557
|
|
|
292
|
-
- **MemoryRelay
|
|
293
|
-
- **OpenClaw
|
|
294
|
-
- **
|
|
558
|
+
- **MemoryRelay**: https://memoryrelay.ai
|
|
559
|
+
- **OpenClaw**: https://docs.openclaw.ai
|
|
560
|
+
- **Repository**: https://github.com/memoryrelay/openclaw-plugin
|
|
295
561
|
- **Issues**: https://github.com/memoryrelay/openclaw-plugin/issues
|
|
296
|
-
|
|
297
|
-
## Support
|
|
298
|
-
|
|
299
|
-
- **Documentation**: https://docs.memoryrelay.ai
|
|
300
|
-
- **Discord**: https://discord.com/invite/clawd (OpenClaw community)
|
|
301
|
-
- **Email**: support@memoryrelay.ai
|
|
302
|
-
|
|
303
|
-
---
|
|
304
|
-
|
|
305
|
-
Built with ❤️ for the OpenClaw community
|