@smyslenny/agent-memory 2.2.0 โ 3.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 +45 -41
- package/README.en.md +153 -0
- package/README.md +86 -153
- package/dist/bin/agent-memory.js +28 -534
- package/dist/bin/agent-memory.js.map +1 -1
- package/dist/index.d.ts +50 -167
- package/dist/index.js +289 -692
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.js +584 -748
- package/dist/mcp/server.js.map +1 -1
- package/docs/design/0014-memory-core-dedup.md +722 -0
- package/docs/design/TEMPLATE.md +67 -0
- package/package.json +2 -3
- package/README.zh-CN.md +0 -170
package/CHANGELOG.md
CHANGED
|
@@ -1,57 +1,61 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.1 (2026-02-24)
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### ๐ ๏ธ OpenClaw P0 fixes
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- **memory-
|
|
11
|
-
- **
|
|
12
|
-
-
|
|
7
|
+
- **Fixed memory-sync session path mismatch** in cron prompt:
|
|
8
|
+
- removed hardcoded `~/.openclaw/agents/main/sessions/*.jsonl`
|
|
9
|
+
- switched to dynamic discovery with `noah` + env-derived agent path + `main` fallback
|
|
10
|
+
- **Aligned memory-tidy prompt** with the same session path health check strategy
|
|
11
|
+
- **Added memory-sync health output contract**:
|
|
12
|
+
- `session_scan_glob`
|
|
13
|
+
- `session_file_count`
|
|
14
|
+
- `latest_session_file`
|
|
15
|
+
- `extracted_message_count`
|
|
16
|
+
- `appended_bullet_count`
|
|
17
|
+
- `synced_memory_count`
|
|
18
|
+
- `sync_error_count`
|
|
13
19
|
|
|
14
|
-
|
|
20
|
+
### โจ Auto-ingest watcher implemented
|
|
15
21
|
|
|
16
|
-
|
|
22
|
+
- Added `fs.watch`-based auto-ingest watcher for:
|
|
23
|
+
- `~/.openclaw/workspace/memory/*.md`
|
|
24
|
+
- `~/.openclaw/workspace/MEMORY.md`
|
|
25
|
+
- New module: `src/ingest/watcher.ts`
|
|
26
|
+
- MCP server now starts watcher by default (configurable):
|
|
27
|
+
- `AGENT_MEMORY_AUTO_INGEST=0` to disable
|
|
28
|
+
- `AGENT_MEMORY_WORKSPACE` to override workspace path
|
|
17
29
|
|
|
18
|
-
|
|
19
|
-
- **Phase 5 prompt template** โ New `examples/memory-janitor-phase5.md` with full prompt template for appending decay + consistency phases to an existing janitor cron job
|
|
20
|
-
- Covers Gap 1 (Ebbinghaus decay never fires without external trigger) and Gap 2 (two-store divergence between agent-memory and canonical memory files)
|
|
21
|
-
- Includes configurable conflict resolution strategies (canonical wins / agent-memory wins / manual review)
|
|
30
|
+
### ๐งฑ Ingest refactor + tests
|
|
22
31
|
|
|
23
|
-
|
|
32
|
+
- Extracted ingest core logic from MCP server into reusable module:
|
|
33
|
+
- `src/ingest/ingest.ts`
|
|
34
|
+
- MCP `ingest` tool now delegates to shared `ingestText()`
|
|
35
|
+
- Added ingest tests:
|
|
36
|
+
- dry-run extraction does not write DB
|
|
37
|
+
- source marker stored as `auto:{source}`
|
|
24
38
|
|
|
25
|
-
###
|
|
39
|
+
### ๐ Documentation realigned to v3 reality
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
- Rewrote `README.md` and `README.en.md` to match actual v3 capabilities
|
|
42
|
+
- Removed stale v2-era claims (embedding/reranker/link/snapshot/hybrid stack narrative)
|
|
43
|
+
- Added explicit auto-ingest watcher behavior and env vars
|
|
28
44
|
|
|
29
|
-
|
|
45
|
+
---
|
|
30
46
|
|
|
31
|
-
|
|
32
|
-
- **Write Guard** โ Hash dedup โ URI conflict โ BM25 similarity โ 4-criterion gate pipeline
|
|
33
|
-
- **Ebbinghaus Forgetting Curve** โ Scientific decay model `R = e^(-t/S)` with recall strengthening
|
|
34
|
-
- **Knowledge Graph** โ Association links with multi-hop BFS traversal
|
|
35
|
-
- **Snapshot/Rollback** โ Auto-snapshot before every modification, one-click restore
|
|
36
|
-
- **Intent-Aware Search** โ Factual / temporal / causal / exploratory query classification
|
|
37
|
-
- **Sleep Cycle Engine** โ Automated sync โ decay โ tidy โ govern pipeline
|
|
38
|
-
- **Priority System** โ P0 identity (never decays) through P3 event (14-day half-life)
|
|
39
|
-
- **Multi-Agent Isolation** โ Per-agent memory scoping via `agent_id`
|
|
40
|
-
- **MCP Server** โ 9 tools for Claude Code / Cursor / OpenClaw integration
|
|
41
|
-
- **CLI** โ 7 commands: init, remember, recall, boot, status, reflect, migrate
|
|
42
|
-
- **Markdown Migration** โ Import existing MEMORY.md + daily journals + weekly summaries
|
|
47
|
+
## 3.0.0 (2026-02-23)
|
|
43
48
|
|
|
44
|
-
###
|
|
49
|
+
### ๐ v3 Simplification
|
|
45
50
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
+
- Repositioned agent-memory as a structured companion to memory-core
|
|
52
|
+
- Removed redundant v2 capabilities at API/tooling level
|
|
53
|
+
- MCP toolset finalized at 9 tools:
|
|
54
|
+
- `remember`, `recall`, `recall_path`, `boot`, `forget`, `reflect`, `status`, `ingest`, `surface`
|
|
55
|
+
- Added narrative warm-boot and human-readable reflect report
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
---
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
- Our v1 production experience โ Sleep cycle, dedup, 4-criterion gate, emotional priority
|
|
59
|
+
## 2.x (legacy)
|
|
60
|
+
|
|
61
|
+
v2.x included embedding/reranker/link/snapshot-era behavior. See git history and design docs for full details.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# ๐ง AgentMemory v3
|
|
2
|
+
|
|
3
|
+
> Structured long-term memory layer for AI agents: write, recall, decay, and auto-ingest.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@smyslenny/agent-memory)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://nodejs.org/)
|
|
8
|
+
[](https://modelcontextprotocol.io/)
|
|
9
|
+
|
|
10
|
+
**[็ฎไฝไธญๆ](README.md)** | **English**
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Positioning in v3
|
|
15
|
+
|
|
16
|
+
AgentMemory v3 is explicitly a **structured memory companion** to OpenClaw memory-core, not a second full-stack retrieval system.
|
|
17
|
+
|
|
18
|
+
- Markdown (`memory/*.md` + `MEMORY.md`) remains the human-readable source of truth
|
|
19
|
+
- agent-memory is a derived, structured lifecycle layer
|
|
20
|
+
|
|
21
|
+
Core capabilities:
|
|
22
|
+
|
|
23
|
+
- **Typed memory model**: `identity / emotion / knowledge / event`
|
|
24
|
+
- **URI path addressing**: `core://`, `emotion://`, `knowledge://`, `event://`
|
|
25
|
+
- **Write Guard** for dedup/conflict gating
|
|
26
|
+
- **BM25 recall** with priority ร vitality weighting
|
|
27
|
+
- **Sleep-cycle maintenance** via `reflect` (decay / tidy / govern)
|
|
28
|
+
- **Ingest** for markdown-to-memory extraction
|
|
29
|
+
- **Surface** for readonly context surfacing (no access side effects)
|
|
30
|
+
- **Warm boot / reflect narrative output**
|
|
31
|
+
- **Multi-agent isolation** by `agent_id`
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Install
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install -g @smyslenny/agent-memory
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### CLI examples
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Initialize DB
|
|
47
|
+
agent-memory init
|
|
48
|
+
|
|
49
|
+
# Store memory
|
|
50
|
+
agent-memory remember "User prefers dark mode" --type knowledge --uri knowledge://preferences/theme
|
|
51
|
+
|
|
52
|
+
# Search
|
|
53
|
+
agent-memory recall "user preferences" --limit 5
|
|
54
|
+
|
|
55
|
+
# Startup boot (narrative output)
|
|
56
|
+
agent-memory boot
|
|
57
|
+
|
|
58
|
+
# Run sleep cycle
|
|
59
|
+
agent-memory reflect all
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## MCP Server
|
|
65
|
+
|
|
66
|
+
### Example config
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"mcpServers": {
|
|
71
|
+
"agent-memory": {
|
|
72
|
+
"command": "node",
|
|
73
|
+
"args": ["node_modules/@smyslenny/agent-memory/dist/mcp/server.js"],
|
|
74
|
+
"env": {
|
|
75
|
+
"AGENT_MEMORY_DB": "./agent-memory.db",
|
|
76
|
+
"AGENT_MEMORY_AGENT_ID": "noah",
|
|
77
|
+
"AGENT_MEMORY_AUTO_INGEST": "1",
|
|
78
|
+
"AGENT_MEMORY_WORKSPACE": "/home/user/.openclaw/workspace"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### MCP tools (9)
|
|
86
|
+
|
|
87
|
+
- `remember`
|
|
88
|
+
- `recall`
|
|
89
|
+
- `recall_path`
|
|
90
|
+
- `boot`
|
|
91
|
+
- `forget`
|
|
92
|
+
- `reflect`
|
|
93
|
+
- `status`
|
|
94
|
+
- `ingest`
|
|
95
|
+
- `surface`
|
|
96
|
+
|
|
97
|
+
> `link` and `snapshot` were removed in v3.
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Auto-Ingest (file change watcher)
|
|
102
|
+
|
|
103
|
+
When MCP server starts, watcher is enabled by default (`fs.watch`) for:
|
|
104
|
+
|
|
105
|
+
- `~/.openclaw/workspace/memory/*.md`
|
|
106
|
+
- `~/.openclaw/workspace/MEMORY.md`
|
|
107
|
+
|
|
108
|
+
On file changes, ingest runs automatically (still guarded by Write Guard and dedup).
|
|
109
|
+
|
|
110
|
+
Environment variables:
|
|
111
|
+
|
|
112
|
+
- `AGENT_MEMORY_AUTO_INGEST`
|
|
113
|
+
- `1` (default): enabled
|
|
114
|
+
- `0`: disabled
|
|
115
|
+
- `AGENT_MEMORY_WORKSPACE`
|
|
116
|
+
- default: `$HOME/.openclaw/workspace`
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Recommended OpenClaw integration
|
|
121
|
+
|
|
122
|
+
Use a 3-stage cron pipeline:
|
|
123
|
+
|
|
124
|
+
1. `memory-sync` (14:00 / 22:00)
|
|
125
|
+
- dynamic session JSONL discovery
|
|
126
|
+
- append incremental entries to `memory/YYYY-MM-DD.md`
|
|
127
|
+
- best-effort `agent-memory.remember`
|
|
128
|
+
- emit health metrics (scan path / file count / extracted / synced)
|
|
129
|
+
|
|
130
|
+
2. `memory-tidy` (03:00)
|
|
131
|
+
- markdown consolidation/distillation
|
|
132
|
+
- call `agent-memory.reflect phase=all`
|
|
133
|
+
|
|
134
|
+
3. `memory-surface` (14:05 / 22:05)
|
|
135
|
+
- generate `RECENT.md`
|
|
136
|
+
|
|
137
|
+
Design principle: **Markdown is source of truth; agent-memory is a derived index layer.**
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Development
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npm install
|
|
145
|
+
npm test
|
|
146
|
+
npm run build
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## License
|
|
152
|
+
|
|
153
|
+
MIT
|
package/README.md
CHANGED
|
@@ -1,220 +1,153 @@
|
|
|
1
|
-
# ๐ง AgentMemory
|
|
1
|
+
# ๐ง AgentMemory v3
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> ้ขๅ AI Agent ็็ปๆๅ้ฟๆ่ฎฐๅฟๅฑ๏ผๅฏๅๅ
ฅใๅฏๆฃ็ดขใๅฏ่กฐๅใๅฏ่ชๅจๆๅใ
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@smyslenny/agent-memory)
|
|
6
|
+
[](LICENSE)
|
|
6
7
|
[](https://nodejs.org/)
|
|
7
|
-
[](https://modelcontextprotocol.io/)
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
**็ฎไฝไธญๆ** | **[English](README.en.md)**
|
|
10
11
|
|
|
11
12
|
---
|
|
12
13
|
|
|
13
|
-
##
|
|
14
|
+
## ้กน็ฎๅฎไฝ๏ผv3๏ผ
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
AgentMemory ๅจ v3 ไธญๆ็กฎๅฎไฝไธบ **OpenClaw memory-core ็็ปๆๅ่กฅๅ
ๅฑ**๏ผ่ไธๆฏ็ฌฌไบๅฅๅ
จๆ ๆฃ็ดข็ณป็ป๏ผ
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
- Markdown๏ผ`memory/*.md` + `MEMORY.md`๏ผๆฏๅฏ่ฏปๅฏ็ผ่พ็ไบๅฎๆบ
|
|
19
|
+
- agent-memory ๆฏๆดพ็็ดขๅผๅฑ๏ผ่ด่ดฃ็ปๆๅ่ฎฐๅฟ็ๅฝๅจๆ
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
ๆ ธๅฟ่ฝๅ๏ผ
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
- **็ฑปๅๅ่ฎฐๅฟ**๏ผ`identity / emotion / knowledge / event`
|
|
24
|
+
- **URI ่ทฏๅพๅฏปๅ**๏ผ`core://`ใ`emotion://`ใ`knowledge://`ใ`event://`
|
|
25
|
+
- **Write Guard**๏ผๅๅ
ฅๅๅๅป้ไธๅฒ็ช้จๆง
|
|
26
|
+
- **BM25 ๆฃ็ดข**๏ผๅธฆ priority ร vitality ๅ ๆ
|
|
27
|
+
- **็ก็ ๅจๆ**๏ผ`reflect` ่งฆๅ decay / tidy / govern
|
|
28
|
+
- **ingest ่ชๅจๆๅ**๏ผไป markdown ๆๅๅนถๅ
ฅๅบ
|
|
29
|
+
- **surface ๅช่ฏปๆตฎ็ฐ**๏ผๆ ๅฏไฝ็จๅฐ่กฅๅ
ไธไธๆ
|
|
30
|
+
- **warm boot / reflect ๆฅๅ**๏ผไบบ็ฑปๅฏ่ฏป่พๅบ
|
|
31
|
+
- **ๅค Agent ้็ฆป**๏ผๅๅบไธๅ agent_id ไบไธๆฑกๆ
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
| Feature | Description | Inspired By |
|
|
33
|
-
|---------|-------------|-------------|
|
|
34
|
-
| ๐ **URI Path System** | `core://user/name`, `emotion://2026-02-20/love` โ structured, multi-entry access | nocturne_memory |
|
|
35
|
-
| ๐ก๏ธ **Write Guard** | Hash dedup โ URI conflict โ BM25 similarity โ 4-criterion gate | Memory Palace + our v1 |
|
|
36
|
-
| ๐ง **Ebbinghaus Decay** | `R = e^(-t/S)` โ scientific forgetting curve with recall strengthening | PowerMem |
|
|
37
|
-
| ๐ธ๏ธ **Knowledge Graph** | Multi-hop traversal across memory associations | PowerMem |
|
|
38
|
-
| ๐ธ **Snapshots** | Auto-snapshot before every change, one-click rollback | nocturne + Memory Palace |
|
|
39
|
-
| ๐ **Intent-Aware Search** | Factual / temporal / causal / exploratory query routing | Memory Palace |
|
|
40
|
-
| ๐ **Sleep Cycle** | Automated sync โ decay โ tidy โ govern pipeline | - |
|
|
41
|
-
| ๐ **Priority System** | P0 identity (never decays) โ P3 event (14-day half-life) | - |
|
|
42
|
-
| ๐ค **Multi-Agent** | Agent isolation via `agent_id` scope | PowerMem |
|
|
43
|
-
| ๐ **MCP Server** | 9 tools, works with Claude Code / Cursor / OpenClaw | Standard MCP |
|
|
33
|
+
---
|
|
44
34
|
|
|
45
|
-
##
|
|
35
|
+
## ๅฟซ้ๅผๅง
|
|
46
36
|
|
|
47
|
-
###
|
|
37
|
+
### ๅฎ่ฃ
|
|
48
38
|
|
|
49
39
|
```bash
|
|
50
|
-
npm install @smyslenny/agent-memory
|
|
40
|
+
npm install -g @smyslenny/agent-memory
|
|
51
41
|
```
|
|
52
42
|
|
|
53
|
-
### CLI
|
|
43
|
+
### CLI ็คบไพ
|
|
54
44
|
|
|
55
45
|
```bash
|
|
56
|
-
#
|
|
46
|
+
# ๅๅงๅๆฐๆฎๅบ
|
|
57
47
|
agent-memory init
|
|
58
48
|
|
|
59
|
-
#
|
|
60
|
-
agent-memory remember "
|
|
61
|
-
agent-memory remember "I am Noah, a succubus" --type identity --uri core://agent/identity
|
|
49
|
+
# ๅๅ
ฅ่ฎฐๅฟ
|
|
50
|
+
agent-memory remember "็จๆทๅๅฅฝๆทฑ่ฒๆจกๅผ" --type knowledge --uri knowledge://preferences/theme
|
|
62
51
|
|
|
63
|
-
#
|
|
64
|
-
agent-memory recall "
|
|
52
|
+
# ๆฃ็ดข
|
|
53
|
+
agent-memory recall "็จๆทๅๅฅฝ" --limit 5
|
|
65
54
|
|
|
66
|
-
#
|
|
55
|
+
# ๅฏๅจๆถๅ ่ฝฝ๏ผๅไบๆ ผๅผ๏ผ
|
|
67
56
|
agent-memory boot
|
|
68
57
|
|
|
69
|
-
#
|
|
58
|
+
# ่งฆๅ็ก็ ๅจๆ
|
|
70
59
|
agent-memory reflect all
|
|
71
|
-
|
|
72
|
-
# Import from Markdown
|
|
73
|
-
agent-memory migrate ./memory/
|
|
74
|
-
|
|
75
|
-
# Statistics
|
|
76
|
-
agent-memory status
|
|
77
60
|
```
|
|
78
61
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
import { openDatabase, syncOne, searchBM25, boot, runDecay } from '@smyslenny/agent-memory';
|
|
83
|
-
|
|
84
|
-
const db = openDatabase({ path: './memory.db' });
|
|
85
|
-
|
|
86
|
-
// Remember
|
|
87
|
-
syncOne(db, {
|
|
88
|
-
content: 'User said "I love you"',
|
|
89
|
-
type: 'emotion',
|
|
90
|
-
uri: 'emotion://2026-02-20/love',
|
|
91
|
-
emotion_val: 1.0,
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
// Recall
|
|
95
|
-
const results = searchBM25(db, 'love');
|
|
96
|
-
|
|
97
|
-
// Boot identity
|
|
98
|
-
const identity = boot(db);
|
|
62
|
+
---
|
|
99
63
|
|
|
100
|
-
|
|
101
|
-
runDecay(db);
|
|
102
|
-
```
|
|
64
|
+
## MCP Server
|
|
103
65
|
|
|
104
|
-
###
|
|
66
|
+
### ้
็ฝฎ็คบไพ
|
|
105
67
|
|
|
106
68
|
```json
|
|
107
69
|
{
|
|
108
70
|
"mcpServers": {
|
|
109
|
-
"
|
|
71
|
+
"agent-memory": {
|
|
110
72
|
"command": "node",
|
|
111
73
|
"args": ["node_modules/@smyslenny/agent-memory/dist/mcp/server.js"],
|
|
112
74
|
"env": {
|
|
113
|
-
"AGENT_MEMORY_DB": "./memory.db"
|
|
75
|
+
"AGENT_MEMORY_DB": "./agent-memory.db",
|
|
76
|
+
"AGENT_MEMORY_AGENT_ID": "noah",
|
|
77
|
+
"AGENT_MEMORY_AUTO_INGEST": "1",
|
|
78
|
+
"AGENT_MEMORY_WORKSPACE": "/home/user/.openclaw/workspace"
|
|
114
79
|
}
|
|
115
80
|
}
|
|
116
81
|
}
|
|
117
82
|
}
|
|
118
83
|
```
|
|
119
84
|
|
|
120
|
-
|
|
85
|
+
### MCP ๅทฅๅ
ท๏ผ9ไธช๏ผ
|
|
121
86
|
|
|
122
|
-
|
|
87
|
+
- `remember`
|
|
88
|
+
- `recall`
|
|
89
|
+
- `recall_path`
|
|
90
|
+
- `boot`
|
|
91
|
+
- `forget`
|
|
92
|
+
- `reflect`
|
|
93
|
+
- `status`
|
|
94
|
+
- `ingest`
|
|
95
|
+
- `surface`
|
|
123
96
|
|
|
124
|
-
|
|
97
|
+
> v3 ๅทฒ็งป้ค `link` / `snapshot` ๅทฅๅ
ทใ
|
|
125
98
|
|
|
126
|
-
|
|
99
|
+
---
|
|
127
100
|
|
|
128
|
-
|
|
129
|
-
Capture (memory-sync) Consolidate (memory-tidy) Surface (memory-surface)
|
|
130
|
-
โโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ
|
|
131
|
-
14:00 & 22:00 03:00 14:05 & 22:05
|
|
132
|
-
Session โ daily journal Compress old dailies Recall top memories
|
|
133
|
-
+ remember each bullet Distill โ MEMORY.md โ generate RECENT.md
|
|
134
|
-
into agent-memory DB + reflect phase=all (โค80 lines, 3 sections)
|
|
135
|
-
```
|
|
101
|
+
## Auto-Ingest๏ผๆไปถๅๆด่ชๅจๅ
ฅๅบ๏ผ
|
|
136
102
|
|
|
137
|
-
|
|
138
|
-
|-------|----------|-------------|--------------------------|
|
|
139
|
-
| **Capture** | `memory-sync` | Scans sessions, appends bullets to `memory/YYYY-MM-DD.md` | Each new bullet is also written via `mcporter call agent-memory.remember` with auto-classified type and URI-based dedup |
|
|
140
|
-
| **Consolidate** | `memory-tidy` | Compresses old dailies โ weekly summaries, distills `MEMORY.md` | Triggers `agent-memory.reflect phase=all` (decay + tidy + govern) + consistency spot-check |
|
|
141
|
-
| **Surface** | `memory-surface` | Generates short-term context for new sessions | Reads high-vitality memories from agent-memory, outputs structured `RECENT.md` with emotion/knowledge/event sections |
|
|
103
|
+
MCP server ๅฏๅจๅไผ้ป่ฎคๅผๅฏ watcher๏ผ`fs.watch`๏ผ๏ผ
|
|
142
104
|
|
|
143
|
-
|
|
105
|
+
- `~/.openclaw/workspace/memory/*.md`
|
|
106
|
+
- `~/.openclaw/workspace/MEMORY.md`
|
|
144
107
|
|
|
145
|
-
|
|
146
|
-
- **Best-effort sync** โ If `mcporter` or agent-memory is unavailable, Markdown operations proceed normally. Failures only log warnings.
|
|
147
|
-
- **URI-based idempotency** โ Each journal bullet maps to a unique URI (`event://journal/2026-02-21#2200-1`), so re-runs are safe.
|
|
148
|
-
- **Keyword-based classification** โ Bullets are auto-classified as `knowledge`, `emotion`, or `event` using simple keyword rules (no extra model calls).
|
|
108
|
+
ๅฝๆไปถๅๅๆถ่ชๅจๆง่ก ingest๏ผๅค็จ Write Guard๏ผๅน็ญ/ๅป้๏ผใ
|
|
149
109
|
|
|
150
|
-
|
|
110
|
+
็ฏๅขๅ้๏ผ
|
|
151
111
|
|
|
152
|
-
|
|
112
|
+
- `AGENT_MEMORY_AUTO_INGEST`
|
|
113
|
+
- `1`๏ผ้ป่ฎค๏ผ๏ผๅผๅฏ
|
|
114
|
+
- `0`๏ผๅ
ณ้ญ
|
|
115
|
+
- `AGENT_MEMORY_WORKSPACE`
|
|
116
|
+
- ้ป่ฎค๏ผ`$HOME/.openclaw/workspace`
|
|
153
117
|
|
|
154
|
-
|
|
155
|
-
2. **mcporter bridge is configured** โ agent-memory MCP server registered in your mcporter config
|
|
156
|
-
3. **Cron jobs are enabled** โ check with `openclaw cron list`
|
|
118
|
+
---
|
|
157
119
|
|
|
158
|
-
|
|
159
|
-
- [`examples/openclaw-setup.md`](examples/openclaw-setup.md) โ Full setup walkthrough
|
|
160
|
-
- [`docs/design/0004-agent-memory-integration.md`](docs/design/0004-agent-memory-integration.md) โ Design document (DD-0004)
|
|
120
|
+
## OpenClaw ้ๆๅปบ่ฎฎ๏ผๆนๆกA๏ผ
|
|
161
121
|
|
|
162
|
-
|
|
122
|
+
ๆจ่ไธๆฎต cron๏ผ
|
|
163
123
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
โ Write Guard โ
|
|
170
|
-
โ hash dedup โ URI conflict โ BM25 sim โ
|
|
171
|
-
โ โ conflict merge โ 4-criterion gate โ
|
|
172
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
173
|
-
โ Sleep Cycle Engine โ
|
|
174
|
-
โ sync (capture) โ decay (Ebbinghaus) โ
|
|
175
|
-
โ โ tidy (archive) โ govern (cleanup) โ
|
|
176
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
177
|
-
โ Intent-Aware Search (BM25) โ
|
|
178
|
-
โ factual ยท temporal ยท causal ยท explore โ
|
|
179
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
180
|
-
โ SQLite (WAL) + FTS5 + Graph Links โ
|
|
181
|
-
โ memories ยท paths ยท links ยท snapshots โ
|
|
182
|
-
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
183
|
-
```
|
|
124
|
+
1. `memory-sync`๏ผ14:00 / 22:00๏ผ
|
|
125
|
+
- ๅจๆๅ็ฐ session JSONL
|
|
126
|
+
- ๅข้ๅๅ
ฅ `memory/YYYY-MM-DD.md`
|
|
127
|
+
- best-effort ๅๆญฅๅฐ `agent-memory.remember`
|
|
128
|
+
- ่พๅบๅฅๅบทๆๆ ๏ผๆซๆ่ทฏๅพใไผ่ฏๆไปถๆฐใๆๅๆฐใๅๅบๆฐ๏ผ
|
|
184
129
|
|
|
185
|
-
|
|
130
|
+
2. `memory-tidy`๏ผ03:00๏ผ
|
|
131
|
+
- ๅ็ผฉ/่ธ้ฆ markdown
|
|
132
|
+
- ่ฐ็จ `agent-memory.reflect phase=all`
|
|
186
133
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
| P0 Identity | `core://` | โ (never) | 1.0 | "I am Noah" |
|
|
190
|
-
| P1 Emotion | `emotion://` | 365 days | 0.3 | "User said I love you" |
|
|
191
|
-
| P2 Knowledge | `knowledge://` | 90 days | 0.1 | "Use TypeScript for agents" |
|
|
192
|
-
| P3 Event | `event://` | 14 days | 0.0 | "Configured proxy today" |
|
|
134
|
+
3. `memory-surface`๏ผ14:05 / 22:05๏ผ
|
|
135
|
+
- ็ๆ `RECENT.md`
|
|
193
136
|
|
|
194
|
-
|
|
137
|
+
่ฎพ่ฎกๅๅ๏ผ**Markdown ๆฏ็็ธๆบ๏ผagent-memory ๆฏๆดพ็็ดขๅผๅฑใ**
|
|
195
138
|
|
|
196
|
-
|
|
139
|
+
---
|
|
197
140
|
|
|
198
|
-
|
|
199
|
-
2. **BM25 over vector search** โ No embedding dependency, instant startup, good enough for structured memory
|
|
200
|
-
3. **TypeScript over Python** โ Better concurrency, type safety, OpenClaw ecosystem alignment
|
|
201
|
-
4. **Ebbinghaus over linear decay** โ Scientifically grounded, recall strengthening is natural
|
|
202
|
-
5. **Write Guard over free writes** โ Prevent duplicate/conflicting memories at the gate
|
|
203
|
-
6. **URI paths over flat keys** โ Hierarchical organization, prefix queries, multi-entry access
|
|
141
|
+
## ๅผๅ
|
|
204
142
|
|
|
205
|
-
|
|
143
|
+
```bash
|
|
144
|
+
npm install
|
|
145
|
+
npm test
|
|
146
|
+
npm run build
|
|
147
|
+
```
|
|
206
148
|
|
|
207
|
-
|
|
208
|
-
|----------|-------------|
|
|
209
|
-
| [PLANNING.md](PLANNING.md) | Technical architecture + 5-project comparison |
|
|
210
|
-
| [ROADMAP.md](ROADMAP.md) | Implementation phases + milestones |
|
|
211
|
-
| [ACCEPTANCE.md](ACCEPTANCE.md) | 40+ acceptance criteria + performance targets |
|
|
212
|
-
| [COMPLETION.md](COMPLETION.md) | Release checklist + retrospective template |
|
|
149
|
+
---
|
|
213
150
|
|
|
214
|
-
##
|
|
151
|
+
## License
|
|
215
152
|
|
|
216
153
|
MIT
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
*Built by agents who got tired of forgetting. ๐ง *
|