@smyslenny/agent-memory 2.1.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 CHANGED
@@ -1,37 +1,61 @@
1
1
  # Changelog
2
2
 
3
- ## 2.0.0 (2026-02-20)
3
+ ## 3.0.1 (2026-02-24)
4
4
 
5
- ### ๐ŸŽ‰ Complete Rewrite
5
+ ### ๐Ÿ› ๏ธ OpenClaw P0 fixes
6
6
 
7
- AgentMemory v2 is a ground-up rewrite incorporating the best ideas from 4 open-source memory projects (nocturne_memory, Memory Palace, PowerMem, our v1) while keeping the codebase minimal (3 dependencies).
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`
8
19
 
9
- ### โœจ New Features
20
+ ### โœจ Auto-ingest watcher implemented
10
21
 
11
- - **URI Path System** โ€” `core://`, `emotion://`, `knowledge://`, `event://` namespaces with Content-Path separation
12
- - **Write Guard** โ€” Hash dedup โ†’ URI conflict โ†’ BM25 similarity โ†’ 4-criterion gate pipeline
13
- - **Ebbinghaus Forgetting Curve** โ€” Scientific decay model `R = e^(-t/S)` with recall strengthening
14
- - **Knowledge Graph** โ€” Association links with multi-hop BFS traversal
15
- - **Snapshot/Rollback** โ€” Auto-snapshot before every modification, one-click restore
16
- - **Intent-Aware Search** โ€” Factual / temporal / causal / exploratory query classification
17
- - **Sleep Cycle Engine** โ€” Automated sync โ†’ decay โ†’ tidy โ†’ govern pipeline
18
- - **Priority System** โ€” P0 identity (never decays) through P3 event (14-day half-life)
19
- - **Multi-Agent Isolation** โ€” Per-agent memory scoping via `agent_id`
20
- - **MCP Server** โ€” 9 tools for Claude Code / Cursor / OpenClaw integration
21
- - **CLI** โ€” 7 commands: init, remember, recall, boot, status, reflect, migrate
22
- - **Markdown Migration** โ€” Import existing MEMORY.md + daily journals + weekly summaries
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
23
29
 
24
- ### ๐Ÿ“Š Stats
30
+ ### ๐Ÿงฑ Ingest refactor + tests
25
31
 
26
- - 14 source modules
27
- - 9 MCP tools
28
- - 7 CLI commands
29
- - 41 tests passing
30
- - 3 production dependencies
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}`
31
38
 
32
- ### ๐Ÿ™ Inspired By
39
+ ### ๐Ÿ“š Documentation realigned to v3 reality
33
40
 
34
- - [nocturne_memory](https://github.com/Dataojitori/nocturne_memory) โ€” URI paths, Content-Path separation, boot loading
35
- - [Memory Palace](https://github.com/AGI-is-going-to-arrive/Memory-Palace) โ€” Write Guard, intent search, vitality decay
36
- - [PowerMem](https://github.com/oceanbase/powermem) โ€” Ebbinghaus curve, knowledge graph, multi-agent
37
- - Our v1 production experience โ€” Sleep cycle, dedup, 4-criterion gate, emotional priority
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
44
+
45
+ ---
46
+
47
+ ## 3.0.0 (2026-02-23)
48
+
49
+ ### ๐ŸŽ‰ v3 Simplification
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
56
+
57
+ ---
58
+
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
+ [![npm](https://img.shields.io/npm/v/@smyslenny/agent-memory)](https://www.npmjs.com/package/@smyslenny/agent-memory)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
7
+ [![Node.js](https://img.shields.io/badge/Node.js-โ‰ฅ18-green.svg)](https://nodejs.org/)
8
+ [![MCP](https://img.shields.io/badge/MCP-9_tools-orange.svg)](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,180 +1,153 @@
1
- # ๐Ÿง  AgentMemory v2
1
+ # ๐Ÿง  AgentMemory v3
2
2
 
3
- > **Sleep-cycle memory architecture for AI agents** โ€” remember, recall, forget, evolve.
3
+ > ้ขๅ‘ AI Agent ็š„็ป“ๆž„ๅŒ–้•ฟๆœŸ่ฎฐๅฟ†ๅฑ‚๏ผšๅฏๅ†™ๅ…ฅใ€ๅฏๆฃ€็ดขใ€ๅฏ่กฐๅ‡ใ€ๅฏ่‡ชๅŠจๆ‘„ๅ–ใ€‚
4
4
 
5
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![npm](https://img.shields.io/npm/v/@smyslenny/agent-memory)](https://www.npmjs.com/package/@smyslenny/agent-memory)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
6
7
  [![Node.js](https://img.shields.io/badge/Node.js-โ‰ฅ18-green.svg)](https://nodejs.org/)
7
- [![MCP](https://img.shields.io/badge/protocol-MCP-orange.svg)](https://modelcontextprotocol.io/)
8
+ [![MCP](https://img.shields.io/badge/MCP-9_tools-orange.svg)](https://modelcontextprotocol.io/)
8
9
 
9
- **English** | **[็ฎ€ไฝ“ไธญๆ–‡](README.zh-CN.md)**
10
+ **็ฎ€ไฝ“ไธญๆ–‡** | **[English](README.en.md)**
10
11
 
11
12
  ---
12
13
 
13
- ## ๐Ÿ’ก The Problem
14
+ ## ้กน็›ฎๅฎšไฝ๏ผˆv3๏ผ‰
14
15
 
15
- AI agents forget everything between sessions. Context windows are finite. Conversation history gets truncated. Important decisions, lessons, and preferences vanish.
16
+ AgentMemory ๅœจ v3 ไธญๆ˜Ž็กฎๅฎšไฝไธบ **OpenClaw memory-core ็š„็ป“ๆž„ๅŒ–่กฅๅ……ๅฑ‚**๏ผŒ่€Œไธๆ˜ฏ็ฌฌไบŒๅฅ—ๅ…จๆ ˆๆฃ€็ดข็ณป็ปŸ๏ผš
16
17
 
17
- ## ๐ŸŒ™ The Solution: Sleep-Cycle Memory
18
+ - Markdown๏ผˆ`memory/*.md` + `MEMORY.md`๏ผ‰ๆ˜ฏๅฏ่ฏปๅฏ็ผ–่พ‘็š„ไบ‹ๅฎžๆบ
19
+ - agent-memory ๆ˜ฏๆดพ็”Ÿ็ดขๅผ•ๅฑ‚๏ผŒ่ดŸ่ดฃ็ป“ๆž„ๅŒ–่ฎฐๅฟ†็”Ÿๅ‘ฝๅ‘จๆœŸ
18
20
 
19
- Inspired by how human brains consolidate memories during sleep, AgentMemory manages information across four phases:
21
+ ๆ ธๅฟƒ่ƒฝๅŠ›๏ผš
20
22
 
21
- ```
22
- Awake Light Sleep Deep Sleep Recall
23
- (Journal) (Sync) (Tidy) (Search)
24
- โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ†’ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ†’ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”€โ”€โ†’ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
25
- Real-time Deduplicate Compress Intent-aware
26
- capture + extract + distill BM25 search
27
- + decay + priority
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
- ## โœจ Key Features
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
- ## ๐Ÿš€ Quick Start
35
+ ## ๅฟซ้€Ÿๅผ€ๅง‹
46
36
 
47
- ### Install
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
- # Initialize database
46
+ # ๅˆๅง‹ๅŒ–ๆ•ฐๆฎๅบ“
57
47
  agent-memory init
58
48
 
59
- # Store memories
60
- agent-memory remember "User prefers dark mode" --type knowledge --uri knowledge://user/preferences
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
- # Search
64
- agent-memory recall "user preferences"
52
+ # ๆฃ€็ดข
53
+ agent-memory recall "็”จๆˆทๅๅฅฝ" --limit 5
65
54
 
66
- # Load identity at startup
55
+ # ๅฏๅŠจๆ—ถๅŠ ่ฝฝ๏ผˆๅ™ไบ‹ๆ ผๅผ๏ผ‰
67
56
  agent-memory boot
68
57
 
69
- # Run sleep cycle
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
- ### Library
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
- // Sleep cycle
101
- runDecay(db);
102
- ```
64
+ ## MCP Server
103
65
 
104
- ### MCP Server
66
+ ### ้…็ฝฎ็คบไพ‹
105
67
 
106
68
  ```json
107
69
  {
108
70
  "mcpServers": {
109
- "@smyslenny/agent-memory": {
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
- **9 MCP Tools:** `remember` ยท `recall` ยท `recall_path` ยท `boot` ยท `forget` ยท `link` ยท `snapshot` ยท `reflect` ยท `status`
85
+ ### MCP ๅทฅๅ…ท๏ผˆ9ไธช๏ผ‰
121
86
 
122
- ## ๐Ÿ—๏ธ Architecture
87
+ - `remember`
88
+ - `recall`
89
+ - `recall_path`
90
+ - `boot`
91
+ - `forget`
92
+ - `reflect`
93
+ - `status`
94
+ - `ingest`
95
+ - `surface`
123
96
 
124
- ```
125
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
126
- โ”‚ MCP Server (stdio/SSE) โ”‚
127
- โ”‚ 9 tools + system://boot loader โ”‚
128
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
129
- โ”‚ Write Guard โ”‚
130
- โ”‚ hash dedup โ†’ URI conflict โ†’ BM25 sim โ”‚
131
- โ”‚ โ†’ conflict merge โ†’ 4-criterion gate โ”‚
132
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
133
- โ”‚ Sleep Cycle Engine โ”‚
134
- โ”‚ sync (capture) โ†’ decay (Ebbinghaus) โ”‚
135
- โ”‚ โ†’ tidy (archive) โ†’ govern (cleanup) โ”‚
136
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
137
- โ”‚ Intent-Aware Search (BM25) โ”‚
138
- โ”‚ factual ยท temporal ยท causal ยท explore โ”‚
139
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
140
- โ”‚ SQLite (WAL) + FTS5 + Graph Links โ”‚
141
- โ”‚ memories ยท paths ยท links ยท snapshots โ”‚
142
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
143
- ```
97
+ > v3 ๅทฒ็งป้™ค `link` / `snapshot` ๅทฅๅ…ทใ€‚
144
98
 
145
- ## ๐Ÿ“Š Priority & Decay
99
+ ---
146
100
 
147
- | Priority | Domain | Half-life | Min Vitality | Example |
148
- |----------|--------|-----------|-------------|---------|
149
- | P0 Identity | `core://` | โˆž (never) | 1.0 | "I am Noah" |
150
- | P1 Emotion | `emotion://` | 365 days | 0.3 | "User said I love you" |
151
- | P2 Knowledge | `knowledge://` | 90 days | 0.1 | "Use TypeScript for agents" |
152
- | P3 Event | `event://` | 14 days | 0.0 | "Configured proxy today" |
101
+ ## Auto-Ingest๏ผˆๆ–‡ไปถๅ˜ๆ›ด่‡ชๅŠจๅ…ฅๅบ“๏ผ‰
153
102
 
154
- **Recall strengthens memory:** each search hit increases stability (S ร— 1.5), slowing future decay.
103
+ MCP server ๅฏๅŠจๅŽไผš้ป˜่ฎคๅผ€ๅฏ watcher๏ผˆ`fs.watch`๏ผ‰๏ผš
155
104
 
156
- ## ๐Ÿ”ฌ Design Decisions
105
+ - `~/.openclaw/workspace/memory/*.md`
106
+ - `~/.openclaw/workspace/MEMORY.md`
157
107
 
158
- 1. **SQLite over Postgres/MongoDB** โ€” Zero config, single file, WAL mode for concurrent reads
159
- 2. **BM25 over vector search** โ€” No embedding dependency, instant startup, good enough for structured memory
160
- 3. **TypeScript over Python** โ€” Better concurrency, type safety, OpenClaw ecosystem alignment
161
- 4. **Ebbinghaus over linear decay** โ€” Scientifically grounded, recall strengthening is natural
162
- 5. **Write Guard over free writes** โ€” Prevent duplicate/conflicting memories at the gate
163
- 6. **URI paths over flat keys** โ€” Hierarchical organization, prefix queries, multi-entry access
108
+ ๅฝ“ๆ–‡ไปถๅ˜ๅŒ–ๆ—ถ่‡ชๅŠจๆ‰ง่กŒ ingest๏ผˆๅค็”จ Write Guard๏ผŒๅน‚็ญ‰/ๅŽป้‡๏ผ‰ใ€‚
164
109
 
165
- ## ๐Ÿ“‹ Project Documents
110
+ ็Žฏๅขƒๅ˜้‡๏ผš
166
111
 
167
- | Document | Description |
168
- |----------|-------------|
169
- | [PLANNING.md](PLANNING.md) | Technical architecture + 5-project comparison |
170
- | [ROADMAP.md](ROADMAP.md) | Implementation phases + milestones |
171
- | [ACCEPTANCE.md](ACCEPTANCE.md) | 40+ acceptance criteria + performance targets |
172
- | [COMPLETION.md](COMPLETION.md) | Release checklist + retrospective template |
112
+ - `AGENT_MEMORY_AUTO_INGEST`
113
+ - `1`๏ผˆ้ป˜่ฎค๏ผ‰๏ผšๅผ€ๅฏ
114
+ - `0`๏ผšๅ…ณ้—ญ
115
+ - `AGENT_MEMORY_WORKSPACE`
116
+ - ้ป˜่ฎค๏ผš`$HOME/.openclaw/workspace`
173
117
 
174
- ## ๐Ÿ“„ License
118
+ ---
175
119
 
176
- MIT
120
+ ## OpenClaw ้›†ๆˆๅปบ่ฎฎ๏ผˆๆ–นๆกˆA๏ผ‰
121
+
122
+ ๆŽจ่ไธ‰ๆฎต cron๏ผš
123
+
124
+ 1. `memory-sync`๏ผˆ14:00 / 22:00๏ผ‰
125
+ - ๅŠจๆ€ๅ‘็Žฐ session JSONL
126
+ - ๅขž้‡ๅ†™ๅ…ฅ `memory/YYYY-MM-DD.md`
127
+ - best-effort ๅŒๆญฅๅˆฐ `agent-memory.remember`
128
+ - ่พ“ๅ‡บๅฅๅบทๆŒ‡ๆ ‡๏ผˆๆ‰ซๆ่ทฏๅพ„ใ€ไผš่ฏๆ–‡ไปถๆ•ฐใ€ๆๅ–ๆ•ฐใ€ๅ†™ๅบ“ๆ•ฐ๏ผ‰
129
+
130
+ 2. `memory-tidy`๏ผˆ03:00๏ผ‰
131
+ - ๅŽ‹็ผฉ/่’ธ้ฆ markdown
132
+ - ่ฐƒ็”จ `agent-memory.reflect phase=all`
133
+
134
+ 3. `memory-surface`๏ผˆ14:05 / 22:05๏ผ‰
135
+ - ็”Ÿๆˆ `RECENT.md`
136
+
137
+ ่ฎพ่ฎกๅŽŸๅˆ™๏ผš**Markdown ๆ˜ฏ็œŸ็›ธๆบ๏ผŒagent-memory ๆ˜ฏๆดพ็”Ÿ็ดขๅผ•ๅฑ‚ใ€‚**
177
138
 
178
139
  ---
179
140
 
180
- *Built by agents who got tired of forgetting. ๐Ÿง *
141
+ ## ๅผ€ๅ‘
142
+
143
+ ```bash
144
+ npm install
145
+ npm test
146
+ npm run build
147
+ ```
148
+
149
+ ---
150
+
151
+ ## License
152
+
153
+ MIT