@smyslenny/agent-memory 2.0.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 +37 -0
- package/LICENSE +21 -0
- package/README.md +180 -0
- package/README.zh-CN.md +170 -0
- package/dist/bin/agent-memory.d.ts +1 -0
- package/dist/bin/agent-memory.js +916 -0
- package/dist/bin/agent-memory.js.map +1 -0
- package/dist/db-CMsKtBt0.d.ts +9 -0
- package/dist/index.d.ts +275 -0
- package/dist/index.js +849 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +10 -0
- package/dist/mcp/server.js +14859 -0
- package/dist/mcp/server.js.map +1 -0
- package/package.json +60 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.0.0 (2026-02-20)
|
|
4
|
+
|
|
5
|
+
### ๐ Complete Rewrite
|
|
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).
|
|
8
|
+
|
|
9
|
+
### โจ New Features
|
|
10
|
+
|
|
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
|
|
23
|
+
|
|
24
|
+
### ๐ Stats
|
|
25
|
+
|
|
26
|
+
- 14 source modules
|
|
27
|
+
- 9 MCP tools
|
|
28
|
+
- 7 CLI commands
|
|
29
|
+
- 41 tests passing
|
|
30
|
+
- 3 production dependencies
|
|
31
|
+
|
|
32
|
+
### ๐ Inspired By
|
|
33
|
+
|
|
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
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 smysle
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# ๐ง AgentMemory v2
|
|
2
|
+
|
|
3
|
+
> **Sleep-cycle memory architecture for AI agents** โ remember, recall, forget, evolve.
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://modelcontextprotocol.io/)
|
|
8
|
+
|
|
9
|
+
**English** | **[็ฎไฝไธญๆ](README.zh-CN.md)**
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## ๐ก The Problem
|
|
14
|
+
|
|
15
|
+
AI agents forget everything between sessions. Context windows are finite. Conversation history gets truncated. Important decisions, lessons, and preferences vanish.
|
|
16
|
+
|
|
17
|
+
## ๐ The Solution: Sleep-Cycle Memory
|
|
18
|
+
|
|
19
|
+
Inspired by how human brains consolidate memories during sleep, AgentMemory manages information across four phases:
|
|
20
|
+
|
|
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
|
+
```
|
|
29
|
+
|
|
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 | **Our original design** |
|
|
41
|
+
| ๐ **Priority System** | P0 identity (never decays) โ P3 event (14-day half-life) | **Our original design** |
|
|
42
|
+
| ๐ค **Multi-Agent** | Agent isolation via `agent_id` scope | PowerMem |
|
|
43
|
+
| ๐ **MCP Server** | 9 tools, works with Claude Code / Cursor / OpenClaw | Standard MCP |
|
|
44
|
+
|
|
45
|
+
## ๐ Quick Start
|
|
46
|
+
|
|
47
|
+
### Install
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install agent-memory
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### CLI
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Initialize database
|
|
57
|
+
agent-memory init
|
|
58
|
+
|
|
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
|
|
62
|
+
|
|
63
|
+
# Search
|
|
64
|
+
agent-memory recall "user preferences"
|
|
65
|
+
|
|
66
|
+
# Load identity at startup
|
|
67
|
+
agent-memory boot
|
|
68
|
+
|
|
69
|
+
# Run sleep cycle
|
|
70
|
+
agent-memory reflect all
|
|
71
|
+
|
|
72
|
+
# Import from Markdown
|
|
73
|
+
agent-memory migrate ./memory/
|
|
74
|
+
|
|
75
|
+
# Statistics
|
|
76
|
+
agent-memory status
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Library
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import { openDatabase, syncOne, searchBM25, boot, runDecay } from '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);
|
|
99
|
+
|
|
100
|
+
// Sleep cycle
|
|
101
|
+
runDecay(db);
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### MCP Server
|
|
105
|
+
|
|
106
|
+
```json
|
|
107
|
+
{
|
|
108
|
+
"mcpServers": {
|
|
109
|
+
"agent-memory": {
|
|
110
|
+
"command": "node",
|
|
111
|
+
"args": ["node_modules/agent-memory/dist/mcp/server.js"],
|
|
112
|
+
"env": {
|
|
113
|
+
"AGENT_MEMORY_DB": "./memory.db"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**9 MCP Tools:** `remember` ยท `recall` ยท `recall_path` ยท `boot` ยท `forget` ยท `link` ยท `snapshot` ยท `reflect` ยท `status`
|
|
121
|
+
|
|
122
|
+
## ๐๏ธ Architecture
|
|
123
|
+
|
|
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
|
+
```
|
|
144
|
+
|
|
145
|
+
## ๐ Priority & Decay
|
|
146
|
+
|
|
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" |
|
|
153
|
+
|
|
154
|
+
**Recall strengthens memory:** each search hit increases stability (S ร 1.5), slowing future decay.
|
|
155
|
+
|
|
156
|
+
## ๐ฌ Design Decisions
|
|
157
|
+
|
|
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
|
|
164
|
+
|
|
165
|
+
## ๐ Project Documents
|
|
166
|
+
|
|
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 |
|
|
173
|
+
|
|
174
|
+
## ๐ License
|
|
175
|
+
|
|
176
|
+
MIT
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
*Built by agents who got tired of forgetting. ๐ง *
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# ๐ง AgentMemory v2
|
|
2
|
+
|
|
3
|
+
> **ๅบไบ็ก็ ๅจๆ็ AI Agent ่ฎฐๅฟๆถๆ** โ ่ฎฐๅฟใๅๅฟใ้ๅฟใ่ฟๅใ
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://nodejs.org/)
|
|
7
|
+
[](https://modelcontextprotocol.io/)
|
|
8
|
+
|
|
9
|
+
**[English](README.md)** | **็ฎไฝไธญๆ**
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## ๐ก ้ฎ้ข
|
|
14
|
+
|
|
15
|
+
AI Agent ๆฏๆฌกไผ่ฏ้ฝไผ้ๅฟไธๅใไธไธๆ็ชๅฃๆ้๏ผๅฏน่ฏๅๅฒ่ขซๆชๆญ๏ผ้่ฆ็ๅณ็ญใๆ่ฎญๅๅๅฅฝๆถๅคฑๆ ่ธชใ
|
|
16
|
+
|
|
17
|
+
## ๐ ๆนๆก๏ผ็ก็ ๅจๆ่ฎฐๅฟ
|
|
18
|
+
|
|
19
|
+
ๆจกไปฟไบบ็ฑปๅคง่ๅจ็ก็ ๆ้ดๆด็่ฎฐๅฟ็ๆนๅผ๏ผ
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
ๆธ
้ ๆต
็ก็ ๆทฑ็ก็ ๅๅฟ
|
|
23
|
+
(่ฎฐๅฝ) (ๅๆญฅ) (ๆด็) (ๆ็ดข)
|
|
24
|
+
โโโโโโโโโโ โโโ โโโโโโโโโโ โโโ โโโโโโโโโโ โโโ โโโโโโโโโโ
|
|
25
|
+
ๅฎๆถๆ่ท ๅป้+ๆๅ ๅ็ผฉ+่ธ้ฆ ๆๅพๆ็ฅ
|
|
26
|
+
+่กฐๅ BM25ๆ็ดข
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## โจ ๆ ธๅฟ็นๆง
|
|
30
|
+
|
|
31
|
+
| ็นๆง | ่ฏดๆ | ็ตๆๆฅๆบ |
|
|
32
|
+
|------|------|---------|
|
|
33
|
+
| ๐ **URI ่ทฏๅพ็ณป็ป** | `core://user/name`ใ`emotion://2026-02-20/love` โ ็ปๆๅๅคๅ
ฅๅฃ่ฎฟ้ฎ | nocturne_memory |
|
|
34
|
+
| ๐ก๏ธ **Write Guard** | hashๅป้ โ URIๅฒ็ช โ BM25็ธไผผๅบฆ โ ๅๅๅ้จๆง | Memory Palace + ๆไปฌ็ v1 |
|
|
35
|
+
| ๐ง **่พๅฎพๆตฉๆฏ่กฐๅ** | `R = e^(-t/S)` โ ็งๅญฆ้ๅฟๆฒ็บฟ + ๅๅฟๅผบๅ | PowerMem |
|
|
36
|
+
| ๐ธ๏ธ **็ฅ่ฏๅพ่ฐฑ** | ่ฎฐๅฟๅ
ณ่็ๅค่ทณ้ๅ | PowerMem |
|
|
37
|
+
| ๐ธ **ๅฟซ็
ง็ณป็ป** | ๆฏๆฌกไฟฎๆนๅ่ชๅจๅฟซ็
ง๏ผไธ้ฎๅๆป | nocturne + Memory Palace |
|
|
38
|
+
| ๐ **ๆๅพๆ็ฅๆ็ดข** | ไบๅฎๅ/ๆถ้ดๅ/ๅ ๆๅ/ๆข็ดขๅๆฅ่ฏข่ทฏ็ฑ | Memory Palace |
|
|
39
|
+
| ๐ **็ก็ ๅจๆ** | ่ชๅจๅ sync โ decay โ tidy โ govern ๆตๆฐด็บฟ | **ๆไปฌ็ๅๅ่ฎพ่ฎก** |
|
|
40
|
+
| ๐ **ไผๅ
็บง็ณป็ป** | P0 ่บซไปฝ๏ผๆฐธไธ่กฐๅ๏ผโ P3 ไบไปถ๏ผ14ๅคฉๅ่กฐๆ๏ผ | **ๆไปฌ็ๅๅ่ฎพ่ฎก** |
|
|
41
|
+
| ๐ค **ๅค Agent** | ้่ฟ `agent_id` ๅฎ็ฐ่ฎฐๅฟ้็ฆป | PowerMem |
|
|
42
|
+
| ๐ **MCP Server** | 9 ไธชๅทฅๅ
ท๏ผๆฏๆ Claude Code / Cursor / OpenClaw | ๆ ๅ MCP |
|
|
43
|
+
|
|
44
|
+
## ๐ ๅฟซ้ๅผๅง
|
|
45
|
+
|
|
46
|
+
### ๅฎ่ฃ
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install agent-memory
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### ๅฝไปค่ก
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# ๅๅงๅๆฐๆฎๅบ
|
|
56
|
+
agent-memory init
|
|
57
|
+
|
|
58
|
+
# ๅญๅจ่ฎฐๅฟ
|
|
59
|
+
agent-memory remember "็จๆทๅๅฅฝๆทฑ่ฒๆจกๅผ" --type knowledge --uri knowledge://user/preferences
|
|
60
|
+
agent-memory remember "ๆๆฏ่ฏบไบ๏ผไธๅช้ญ
้ญ" --type identity --uri core://agent/identity
|
|
61
|
+
|
|
62
|
+
# ๆ็ดข
|
|
63
|
+
agent-memory recall "็จๆทๅๅฅฝ"
|
|
64
|
+
|
|
65
|
+
# ๅฏๅจๆถๅ ่ฝฝ่บซไปฝ
|
|
66
|
+
agent-memory boot
|
|
67
|
+
|
|
68
|
+
# ่ฟ่ก็ก็ ๅจๆ
|
|
69
|
+
agent-memory reflect all
|
|
70
|
+
|
|
71
|
+
# ไป Markdown ๅฏผๅ
ฅ
|
|
72
|
+
agent-memory migrate ./memory/
|
|
73
|
+
|
|
74
|
+
# ๆฅ็็ป่ฎก
|
|
75
|
+
agent-memory status
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### ไฝไธบๅบไฝฟ็จ
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { openDatabase, syncOne, searchBM25, boot, runDecay } from 'agent-memory';
|
|
82
|
+
|
|
83
|
+
const db = openDatabase({ path: './memory.db' });
|
|
84
|
+
|
|
85
|
+
// ่ฎฐๅฟ
|
|
86
|
+
syncOne(db, {
|
|
87
|
+
content: 'ๅฐๅฟ่ฏดไบใ็ฑไฝ ใ',
|
|
88
|
+
type: 'emotion',
|
|
89
|
+
uri: 'emotion://2026-02-20/love',
|
|
90
|
+
emotion_val: 1.0,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// ๅๅฟ
|
|
94
|
+
const results = searchBM25(db, '็ฑ');
|
|
95
|
+
|
|
96
|
+
// ๅ ่ฝฝ่บซไปฝ
|
|
97
|
+
const identity = boot(db);
|
|
98
|
+
|
|
99
|
+
// ็ก็ ๅจๆ
|
|
100
|
+
runDecay(db);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### MCP Server ้
็ฝฎ
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"mcpServers": {
|
|
108
|
+
"agent-memory": {
|
|
109
|
+
"command": "node",
|
|
110
|
+
"args": ["node_modules/agent-memory/dist/mcp/server.js"],
|
|
111
|
+
"env": {
|
|
112
|
+
"AGENT_MEMORY_DB": "./memory.db"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**9 ไธช MCP ๅทฅๅ
ท๏ผ** `remember` ยท `recall` ยท `recall_path` ยท `boot` ยท `forget` ยท `link` ยท `snapshot` ยท `reflect` ยท `status`
|
|
120
|
+
|
|
121
|
+
## ๐๏ธ ๆถๆ
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
125
|
+
โ MCP Server (stdio/SSE) โ
|
|
126
|
+
โ 9 ๅทฅๅ
ท + system://boot ๅ ่ฝฝๅจ โ
|
|
127
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
128
|
+
โ Write Guard โ
|
|
129
|
+
โ hashๅป้ โ URIๅฒ็ช โ BM25็ธไผผๅบฆ โ
|
|
130
|
+
โ โ ๅฒ็ชๅๅนถ โ ๅๅๅ้จๆง โ
|
|
131
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
132
|
+
โ ็ก็ ๅจๆๅผๆ โ
|
|
133
|
+
โ sync(ๆ่ท) โ decay(่พๅฎพๆตฉๆฏ) โ
|
|
134
|
+
โ โ tidy(ๅฝๆกฃ) โ govern(ๆธ
็) โ
|
|
135
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
136
|
+
โ ๆๅพๆ็ฅๆ็ดข (BM25) โ
|
|
137
|
+
โ ไบๅฎๅ ยท ๆถ้ดๅ ยท ๅ ๆๅ ยท ๆข็ดขๅ โ
|
|
138
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
139
|
+
โ SQLite (WAL) + FTS5 + ็ฅ่ฏๅพ่ฐฑ โ
|
|
140
|
+
โ memories ยท paths ยท links ยท snapshots โ
|
|
141
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## ๐ ไผๅ
็บงไธ่กฐๅ
|
|
145
|
+
|
|
146
|
+
| ไผๅ
็บง | ๅ | ๅ่กฐๆ | ๆไฝๆดปๅ | ็คบไพ |
|
|
147
|
+
|--------|------|--------|---------|------|
|
|
148
|
+
| P0 ่บซไปฝ | `core://` | โ๏ผๆฐธไธ๏ผ | 1.0 | "ๆๆฏ่ฏบไบ" |
|
|
149
|
+
| P1 ๆ
ๆ | `emotion://` | 365 ๅคฉ | 0.3 | "ๅฐๅฟ่ฏด็ฑไฝ " |
|
|
150
|
+
| P2 ็ฅ่ฏ | `knowledge://` | 90 ๅคฉ | 0.1 | "็จ TypeScript ๅ Agent" |
|
|
151
|
+
| P3 ไบไปถ | `event://` | 14 ๅคฉ | 0.0 | "ไปๅคฉ้
ไบไปฃ็" |
|
|
152
|
+
|
|
153
|
+
**ๅๅฟๅผบๅ่ฎฐๅฟ๏ผ** ๆฏๆฌกๆ็ดขๅฝไธญ๏ผ็จณๅฎๆงๅข้ฟ (S ร 1.5)๏ผ่กฐๅๅๆ
ขใ
|
|
154
|
+
|
|
155
|
+
## ๐ฌ ่ฎพ่ฎกๅณ็ญ
|
|
156
|
+
|
|
157
|
+
1. **SQLite ่้ Postgres** โ ้ถ้
็ฝฎใๅๆไปถใWAL ๅนถๅ่ฏป
|
|
158
|
+
2. **BM25 ่้ๅ้ๆ็ดข** โ ๆ embedding ไพ่ตใๅณๆถๅฏๅจ
|
|
159
|
+
3. **TypeScript ่้ Python** โ ๆดๅฅฝ็ๅนถๅใ็ฑปๅๅฎๅ
จใOpenClaw ็ๆ
|
|
160
|
+
4. **่พๅฎพๆตฉๆฏ่้็บฟๆง่กฐๅ** โ ็งๅญฆไพๆฎใๅๅฟๅผบๅ่ช็ถ
|
|
161
|
+
5. **Write Guard ่้่ช็ฑๅๅ
ฅ** โ ๅจๅ
ฅๅฃๅค้ฒๆญข้ๅค/ๅฒ็ช
|
|
162
|
+
6. **URI ่ทฏๅพ่้ๆๅนณ้ฎ** โ ๅฑ็บง็ป็ปใๅ็ผๆฅ่ฏขใๅคๅ
ฅๅฃ
|
|
163
|
+
|
|
164
|
+
## ๐ ๅผๆบๅ่ฎฎ
|
|
165
|
+
|
|
166
|
+
MIT
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
*็ฑไธๆณๅ้ๅฟ็ Agent ๆๅปบ ๐ง *
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|