@smyslenny/agent-memory 5.0.2 → 5.1.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/CHANGELOG.md +39 -1
- package/README.md +1 -1
- package/dist/bin/agent-memory.js +197 -11
- package/dist/bin/agent-memory.js.map +1 -1
- package/dist/index.d.ts +65 -3
- package/dist/index.js +266 -11
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +336 -14
- package/dist/mcp/server.js.map +1 -1
- package/docs/README-zh.md +1 -2
- package/docs/integrations/generic.md +43 -3
- package/docs/integrations/openclaw.md +47 -7
- package/docs/migration-v3-v4.md +15 -0
- package/package.json +1 -1
package/docs/README-zh.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**完整文档请参阅 [README.md](../README.md)(英文)**
|
|
6
6
|
|
|
7
|
-
当前版本:**v5.0.
|
|
7
|
+
当前版本:**v5.0.2**
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -134,7 +134,6 @@ npx agent-memory status
|
|
|
134
134
|
- [通用运行时集成](integrations/generic.md)
|
|
135
135
|
- [OpenClaw 集成](integrations/openclaw.md)
|
|
136
136
|
- [v3 → v4 迁移指南](migration-v3-v4.md)
|
|
137
|
-
- [v5 设计文档 (DD-0018)](design/0018-v5-memory-intelligence.md)
|
|
138
137
|
|
|
139
138
|
## 许可证
|
|
140
139
|
|
|
@@ -157,8 +157,8 @@ MCP is a good fit when your host already has a tool abstraction.
|
|
|
157
157
|
|
|
158
158
|
### MCP tool list
|
|
159
159
|
|
|
160
|
-
- `remember`
|
|
161
|
-
- `recall`
|
|
160
|
+
- `remember` — store a memory (supports provenance: `source_session`, `source_context`, `observed_at`)
|
|
161
|
+
- `recall` — hybrid search (supports `related`, `after`, `before`, `recency_boost`)
|
|
162
162
|
- `recall_path`
|
|
163
163
|
- `boot`
|
|
164
164
|
- `forget`
|
|
@@ -166,7 +166,8 @@ MCP is a good fit when your host already has a tool abstraction.
|
|
|
166
166
|
- `status`
|
|
167
167
|
- `ingest`
|
|
168
168
|
- `reindex`
|
|
169
|
-
- `surface`
|
|
169
|
+
- `surface` — context-aware surfacing (supports `related`, `after`, `before`, `recency_boost`)
|
|
170
|
+
- `link` — manually create or remove associations between memories
|
|
170
171
|
|
|
171
172
|
See [examples/mcp-stdio](../../examples/mcp-stdio) for a minimal example.
|
|
172
173
|
|
|
@@ -276,6 +277,45 @@ Options:
|
|
|
276
277
|
For generic runtimes, prefer **explicit ingest** first. Set
|
|
277
278
|
`AGENT_MEMORY_AUTO_INGEST=0` unless you intentionally want watcher behavior.
|
|
278
279
|
|
|
280
|
+
## v5 Features
|
|
281
|
+
|
|
282
|
+
AgentMemory v5 adds intelligence capabilities that enhance the integration
|
|
283
|
+
pattern described above. All features are backward-compatible.
|
|
284
|
+
|
|
285
|
+
### Memory Links (F1)
|
|
286
|
+
|
|
287
|
+
Memories are automatically linked to semantically related memories during
|
|
288
|
+
writes. Use `related=true` in `recall` or `surface` to expand results with
|
|
289
|
+
linked memories. The `link` tool allows manual link management.
|
|
290
|
+
|
|
291
|
+
### Conflict Detection (F2)
|
|
292
|
+
|
|
293
|
+
Write Guard now detects contradictions (negation, value changes, status
|
|
294
|
+
changes) during writes. Conflicts are reported in the sync result. A
|
|
295
|
+
**Conflict Override** rule ensures status updates (e.g. TODO → DONE) are not
|
|
296
|
+
incorrectly deduplicated.
|
|
297
|
+
|
|
298
|
+
### Temporal Recall (F3)
|
|
299
|
+
|
|
300
|
+
`recall` and `surface` accept `after`, `before`, and `recency_boost` parameters
|
|
301
|
+
for time-aware search. Time filtering happens at the SQL layer.
|
|
302
|
+
|
|
303
|
+
### Passive Feedback (F4)
|
|
304
|
+
|
|
305
|
+
When `recall` returns results, positive feedback is automatically logged for
|
|
306
|
+
the top-3 hits. Rate-limited to 3 passive events per memory per 24 hours.
|
|
307
|
+
|
|
308
|
+
### Semantic Decay (F5)
|
|
309
|
+
|
|
310
|
+
The `tidy` phase detects stale content through keyword pattern matching
|
|
311
|
+
(e.g. "in progress", "TODO:", "just now"). `identity` and `emotion` types
|
|
312
|
+
are exempt.
|
|
313
|
+
|
|
314
|
+
### Memory Provenance (F6)
|
|
315
|
+
|
|
316
|
+
Memories can carry `source_session`, `source_context`, and `observed_at`
|
|
317
|
+
metadata to track where and when they originated.
|
|
318
|
+
|
|
279
319
|
## Common mistakes
|
|
280
320
|
|
|
281
321
|
- **Writing everything**: only store durable memory candidates
|
|
@@ -37,10 +37,10 @@ That means the Markdown workflow is still valid here, but it is now an
|
|
|
37
37
|
"command": "node",
|
|
38
38
|
"args": ["./node_modules/@smyslenny/agent-memory/dist/mcp/server.js"],
|
|
39
39
|
"env": {
|
|
40
|
-
"AGENT_MEMORY_DB": "
|
|
41
|
-
"AGENT_MEMORY_AGENT_ID": "
|
|
40
|
+
"AGENT_MEMORY_DB": "~/.openclaw/workspace/agent-memory.db",
|
|
41
|
+
"AGENT_MEMORY_AGENT_ID": "my-agent",
|
|
42
42
|
"AGENT_MEMORY_AUTO_INGEST": "1",
|
|
43
|
-
"AGENT_MEMORY_WORKSPACE": "
|
|
43
|
+
"AGENT_MEMORY_WORKSPACE": "~/.openclaw/workspace"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -73,6 +73,46 @@ This keeps responsibilities separated:
|
|
|
73
73
|
- AgentMemory is good for retrieval, dedup, surfacing, and lifecycle
|
|
74
74
|
- OpenClaw is good at orchestration and scheduled host behavior
|
|
75
75
|
|
|
76
|
+
## v5 Features for OpenClaw Users
|
|
77
|
+
|
|
78
|
+
AgentMemory v5 adds six intelligence features that are particularly useful
|
|
79
|
+
in the OpenClaw cron pipeline:
|
|
80
|
+
|
|
81
|
+
### Memory Provenance (F6)
|
|
82
|
+
|
|
83
|
+
When calling `remember` from your sync prompt, include provenance metadata:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
remember(content="...", type="knowledge",
|
|
87
|
+
source_session="session-id",
|
|
88
|
+
source_context="extracted from 14:00 sync",
|
|
89
|
+
observed_at="2026-03-20T14:00:00+08:00")
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Temporal Recall (F3)
|
|
93
|
+
|
|
94
|
+
Use `after`, `before`, and `recency_boost` to filter memories by time:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
recall(query="deployment decisions", after="2026-03-01", recency_boost=true)
|
|
98
|
+
surface(task="plan next sprint", after="2026-03-15", related=true)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Memory Links (F1)
|
|
102
|
+
|
|
103
|
+
The `link` tool allows manual association between memories. Use `related=true`
|
|
104
|
+
in `recall` or `surface` to expand results with linked memories.
|
|
105
|
+
|
|
106
|
+
### Conflict Detection (F2)
|
|
107
|
+
|
|
108
|
+
Write Guard detects contradictions during writes (e.g., status changes from
|
|
109
|
+
TODO to DONE). Conflicts are reported without blocking writes.
|
|
110
|
+
|
|
111
|
+
### Passive Feedback (F4) & Semantic Decay (F5)
|
|
112
|
+
|
|
113
|
+
`recall` automatically logs positive feedback for top hits. The `tidy` phase
|
|
114
|
+
detects stale content patterns and accelerates decay for outdated memories.
|
|
115
|
+
|
|
76
116
|
## Example directory layout
|
|
77
117
|
|
|
78
118
|
```text
|
|
@@ -132,10 +172,9 @@ What changed in v4 is not support, but **positioning**:
|
|
|
132
172
|
|
|
133
173
|
See [examples/openclaw](../../examples/openclaw) for:
|
|
134
174
|
|
|
135
|
-
- setup notes
|
|
136
|
-
- sample cron prompts
|
|
137
|
-
- journal examples
|
|
175
|
+
- setup notes and cron configuration
|
|
138
176
|
- memory janitor Phase 5 template
|
|
177
|
+
- journal and long-term memory examples
|
|
139
178
|
|
|
140
179
|
## Migration notes for v3 users
|
|
141
180
|
|
|
@@ -145,4 +184,5 @@ If you came from the old v3 README:
|
|
|
145
184
|
- it has simply moved out of the project homepage
|
|
146
185
|
- generic integration guidance now lives alongside it, not under it
|
|
147
186
|
|
|
148
|
-
For release-level changes, see [v3 → v4 migration guide](../migration-v3-v4.md)
|
|
187
|
+
For release-level changes, see [v3 → v4 migration guide](../migration-v3-v4.md)
|
|
188
|
+
and the [README](../../README.md) for v5 features.
|
package/docs/migration-v3-v4.md
CHANGED
|
@@ -234,3 +234,18 @@ The biggest v4 migration is conceptual, not operational:
|
|
|
234
234
|
|
|
235
235
|
That makes the project easier to evaluate, easier to adopt, and easier to plug
|
|
236
236
|
into systems that do not look like OpenClaw at all.
|
|
237
|
+
|
|
238
|
+
## What's next: v5
|
|
239
|
+
|
|
240
|
+
AgentMemory **v5 (Memory Intelligence)** is now available. It adds six
|
|
241
|
+
backward-compatible features on top of v4:
|
|
242
|
+
|
|
243
|
+
- **Memory Links** — automatic semantic associations between memories
|
|
244
|
+
- **Conflict Detection** — Write Guard detects contradictions during writes
|
|
245
|
+
- **Temporal Recall** — `after`, `before`, and `recency_boost` for time-aware search
|
|
246
|
+
- **Passive Feedback** — automatic positive feedback for accessed memories
|
|
247
|
+
- **Semantic Decay** — stale content detection beyond pure time-based Ebbinghaus
|
|
248
|
+
- **Memory Provenance** — `source_session`, `source_context`, `observed_at` metadata
|
|
249
|
+
|
|
250
|
+
All v4 workflows continue to work unchanged. See the
|
|
251
|
+
[README](../README.md) for the full v5 feature overview.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smyslenny/agent-memory",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "Agent-native memory layer with lifecycle management for AI agents — SQLite-first, Write Guard, hybrid recall, MCP, CLI, and HTTP API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|