@memoryrelay/plugin-memoryrelay-ai 0.6.2 → 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/README.md CHANGED
@@ -3,17 +3,18 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@memoryrelay/plugin-memoryrelay-ai.svg)](https://www.npmjs.com/package/@memoryrelay/plugin-memoryrelay-ai)
4
4
  [![OpenClaw Compatible](https://img.shields.io/badge/OpenClaw-2026.2.26+-blue.svg)](https://openclaw.ai)
5
5
 
6
- AI-powered long-term memory with semantic search for OpenClaw agents. Store memories, recall relevant context automatically, and give your AI assistant true continuity across sessions.
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
- - 🧠 **Semantic Search** - Vector-based memory retrieval finds relevant context by meaning, not keywords
11
- - 🔄 **Auto-Recall** - Automatically injects relevant memories into context on every turn
12
- - 📝 **Manual Storage** - Store important facts, preferences, and context via `memory_store` tool
13
- - 🔍 **Smart Filtering** - Channel exclusions to keep memories private (skip group chats)
14
- - 🛡️ **Retry Logic** - Exponential backoff with 3 attempts for network resilience
15
- - **Fast** - 50-150ms latency for semantic search
16
- - 🌐 **Cloud-Backed** - Memories persist across devices and sessions
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
 
@@ -26,28 +27,24 @@ AI-powered long-term memory with semantic search for OpenClaw agents. Store memo
26
27
  ### Install via OpenClaw CLI
27
28
 
28
29
  ```bash
29
- # Install from npm
30
30
  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
31
  ```
35
32
 
36
33
  ### Configuration
37
34
 
38
35
  ```bash
39
- # Set configuration
40
36
  openclaw config set plugins.entries.plugin-memoryrelay-ai.config '{
41
37
  "apiKey": "mem_prod_your_key_here",
42
38
  "agentId": "your-agent-name",
39
+ "defaultProject": "my-project",
43
40
  "autoRecall": true,
44
- "autoCapture": false,
45
- "recallLimit": 5
41
+ "autoCapture": false
46
42
  }'
47
43
 
48
44
  # Or use environment variables
49
45
  export MEMORYRELAY_API_KEY="mem_prod_your_key_here"
50
46
  export MEMORYRELAY_AGENT_ID="your-agent-name"
47
+ export MEMORYRELAY_DEFAULT_PROJECT="my-project"
51
48
 
52
49
  # Restart gateway
53
50
  openclaw gateway restart
@@ -57,249 +54,235 @@ openclaw gateway restart
57
54
 
58
55
  | Option | Type | Default | Description |
59
56
  |--------|------|---------|-------------|
60
- | `apiKey` | string | (required) | MemoryRelay API key (or use `MEMORYRELAY_API_KEY` env var) |
61
- | `agentId` | string | (required) | Unique agent identifier (or use `MEMORYRELAY_AGENT_ID` env var) |
62
- | `apiUrl` | string | `https://api.memoryrelay.net` | MemoryRelay API endpoint |
63
- | `autoRecall` | boolean | `true` | Automatically inject relevant memories into context |
64
- | `autoCapture` | boolean | `false` | Automatically capture important information (privacy sensitive) |
65
- | `recallLimit` | number | `5` | Maximum memories to inject per turn (1-20) |
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) |
66
65
  | `recallThreshold` | number | `0.3` | Minimum similarity score for recall (0-1) |
67
- | `excludeChannels` | string[] | `[]` | Channel IDs to skip auto-recall (e.g., `["telegram:group_123"]`) |
68
-
69
- ## Usage
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:
70
166
 
71
- ### Memory Tools (Manual Storage)
72
-
73
- When auto-capture is disabled (recommended), use these tools to store memories:
167
+ ```json
168
+ {
169
+ "enabledTools": "memory,session,decision"
170
+ }
171
+ ```
74
172
 
75
- ```typescript
76
- // Store a memory
77
- memory_store({
78
- content: "User prefers concise responses over long explanations",
79
- metadata: { category: "preference", topic: "communication" }
80
- })
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.
81
174
 
82
- // Search memories
83
- memory_recall({
84
- query: "communication preferences",
85
- limit: 5
86
- })
175
+ Available groups: `memory`, `entity`, `agent`, `session`, `decision`, `pattern`, `project`, `health`
87
176
 
88
- // Delete a memory
89
- memory_forget({
90
- memoryId: "mem_abc123"
91
- })
92
- ```
177
+ Set to `all` (or omit) to enable everything.
93
178
 
94
- ### Auto-Recall (Automatic Context Injection)
179
+ ## Auto-Recall
95
180
 
96
- When `autoRecall: true`, the plugin automatically searches and injects relevant memories on every turn:
181
+ When `autoRecall: true`, relevant memories are automatically injected into agent context each turn:
97
182
 
98
183
  ```
99
- User: "What's my API key for NorthRelay?"
184
+ User: "How should I handle authentication in this project?"
100
185
 
101
- [Plugin searches memories for "API key NorthRelay"]
102
- [Injects top 5 relevant memories into context]
103
- Agent: "Your NorthRelay API key is nr_live_..."
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
104
189
  ```
105
190
 
106
- ### Channel Exclusions (Privacy)
191
+ ## Channel Exclusions
107
192
 
108
- Exclude specific channels from auto-recall to keep memories private:
193
+ Exclude specific channels from auto-recall and workflow injection:
109
194
 
110
195
  ```json
111
196
  {
112
197
  "excludeChannels": [
113
198
  "telegram:group_123456",
114
- "discord:channel_789012",
115
- "whatsapp:group_345678@g.us"
199
+ "discord:channel_789012"
116
200
  ]
117
201
  }
118
202
  ```
119
203
 
120
- ## What to Store
121
-
122
- ### ✅ Good Candidates for Memory Storage
123
-
124
- - **API Keys & Credentials** - `"NorthRelay API key: nr_live_..."`
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"`
130
-
131
- ### ❌ Don't Store
132
-
133
- - Routine conversation (`"how are you?"`)
134
- - Temporary context (one-time questions)
135
- - Already well-documented info (in README, docs)
136
- - Personal secrets user explicitly says not to store
137
-
138
- ## Memory Lifecycle
139
-
140
- 1. **Store** - Call `memory_store` with content + metadata
141
- 2. **Recall** - MemoryRelay auto-injects on relevant turns (or manual `memory_recall`)
142
- 3. **Update** - Store again with same key to update
143
- 4. **Forget** - Call `memory_forget` to delete
144
-
145
- ## Architecture
146
-
147
- ```
148
- ┌─────────────────┐
149
- │ OpenClaw │
150
- │ Agent │
151
- └────────┬────────┘
152
-
153
- ┌────┴─────┐
154
- │ Plugin │ ← This plugin
155
- └────┬─────┘
156
-
157
- │ HTTPS (Bearer auth)
158
-
159
- ┌─────────────────┐
160
- │ MemoryRelay │
161
- │ API │
162
- │ (Vector Search) │
163
- └─────────────────┘
164
- ```
165
-
166
- ## Privacy & Security
167
-
168
- - **Cloud-Backed** - Memories stored on MemoryRelay servers (HTTPS-encrypted)
169
- - **API Key Auth** - Bearer token authentication
170
- - **Agent Isolation** - Memories scoped per agent ID
171
- - **Channel Filtering** - Exclude sensitive channels from auto-recall
172
- - **No Auto-Capture by Default** - Manual storage gives you full control
173
-
174
- **Privacy Tip:** For ultra-sensitive data (private keys, passwords), use encrypted local files instead of cloud memory.
175
-
176
204
  ## CLI Commands
177
205
 
178
206
  ```bash
179
- # Check plugin status
180
- openclaw plugins info plugin-memoryrelay-ai
181
-
182
- # List all plugins
183
- openclaw plugins list
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
213
+ ```
184
214
 
185
- # Enable/disable
186
- openclaw plugins enable plugin-memoryrelay-ai
187
- openclaw plugins disable plugin-memoryrelay-ai
215
+ ## Privacy & Security
188
216
 
189
- # Uninstall
190
- openclaw plugins uninstall plugin-memoryrelay-ai
191
- ```
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.
192
223
 
193
224
  ## Troubleshooting
194
225
 
195
226
  ### Plugin Not Loading
196
227
 
197
228
  ```bash
198
- # Check if plugin is discovered
199
229
  openclaw plugins list | grep memoryrelay
200
-
201
- # Verify config
202
230
  openclaw config get plugins.entries.plugin-memoryrelay-ai
203
-
204
- # Check logs
205
231
  openclaw logs --tail 100 | grep memory
206
232
  ```
207
233
 
208
234
  ### API Connection Issues
209
235
 
210
236
  ```bash
211
- # Test API connection
212
237
  curl -H "Authorization: Bearer YOUR_API_KEY" \
213
- https://api.memoryrelay.net/v1/memories
238
+ https://api.memoryrelay.net/v1/health
214
239
  ```
215
240
 
216
- ### OpenClaw 2026.2.26 Compatibility
217
-
218
- If you see `extension entry escapes package directory`, you're using an older plugin version. Update to v0.6.2+:
219
-
220
- ```bash
221
- openclaw plugins uninstall plugin-memoryrelay-ai
222
- openclaw plugins install @memoryrelay/plugin-memoryrelay-ai
223
- ```
241
+ ## Changelog
224
242
 
225
- See [OPENCLAW-2026.2.26-MIGRATION.md](./OPENCLAW-2026.2.26-MIGRATION.md) for details.
243
+ ### v0.7.0 (2026-03-05)
226
244
 
227
- ## Changelog
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
228
255
 
229
256
  ### v0.6.2 (2026-03-01)
230
257
 
231
- - **FIX**: OpenClaw 2026.2.26 compatibility - Changed `extensions` from `["./"]` to `["./index.ts"]`
232
- - **FIX**: Plugin now installs via `openclaw plugins install` (not npm global)
258
+ - **FIX**: OpenClaw 2026.2.26 compatibility Changed `extensions` from `["./"]` to `["./index.ts"]`
233
259
  - **DOCS**: Added comprehensive README and migration guide
234
260
 
235
- ### v0.6.1 (2026-02-18)
236
-
237
- - Removed `extensions` field (attempted fix) - **FAILED**
238
-
239
261
  ### v0.6.0 (2026-02-18)
240
262
 
241
263
  - **NEW**: Retry logic with exponential backoff (3 attempts)
242
264
  - **NEW**: Request timeout (30 seconds)
243
- - **NEW**: Environment variable fallback support (`MEMORYRELAY_API_KEY`, `MEMORYRELAY_AGENT_ID`)
265
+ - **NEW**: Environment variable fallback support
244
266
  - **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
267
 
249
268
  ## Development
250
269
 
251
- ### Local Testing
252
-
253
270
  ```bash
254
- # Clone repository
255
271
  git clone https://github.com/memoryrelay/openclaw-plugin.git
256
272
  cd openclaw-plugin
257
-
258
- # Install dev dependencies
259
273
  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
274
+ npm test # Run once (50 tests)
272
275
  npm run test:watch # Watch mode
273
276
  npm run test:coverage # With coverage
274
277
  ```
275
278
 
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
279
  ## License
287
280
 
288
281
  MIT License - see [LICENSE](./LICENSE) file
289
282
 
290
283
  ## Links
291
284
 
292
- - **MemoryRelay API**: https://memoryrelay.ai
293
- - **OpenClaw Docs**: https://docs.openclaw.ai
294
- - **Plugin Repository**: https://github.com/memoryrelay/openclaw-plugin
285
+ - **MemoryRelay**: https://memoryrelay.ai
286
+ - **OpenClaw**: https://docs.openclaw.ai
287
+ - **Repository**: https://github.com/memoryrelay/openclaw-plugin
295
288
  - **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