@smyslenny/agent-memory 2.0.0 โ 2.2.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/.github/workflows/test.yml +22 -0
- package/CHANGELOG.md +20 -0
- package/README.md +46 -6
- package/README.zh-CN.md +6 -6
- package/dist/bin/agent-memory.js +1118 -301
- package/dist/bin/agent-memory.js.map +1 -1
- package/dist/db-DsY3zz8f.d.ts +16 -0
- package/dist/index.d.ts +148 -18
- package/dist/index.js +968 -130
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +940 -181
- package/dist/mcp/server.js.map +1 -1
- package/docs/design/0004-agent-memory-integration.md +316 -0
- package/docs/design/0005-reranker-api-integration.md +276 -0
- package/docs/design/0006-multi-provider-embedding.md +196 -0
- package/docs/roadmap/integration-plan-v1.md +139 -0
- package/docs/roadmap/memory-architecture.md +168 -0
- package/docs/roadmap/warm-boot.md +135 -0
- package/package.json +3 -1
- package/dist/db-CMsKtBt0.d.ts +0 -9
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
pull_request:
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
vitest:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
strategy:
|
|
11
|
+
fail-fast: false
|
|
12
|
+
matrix:
|
|
13
|
+
node: [18, 20, 22]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: ${{ matrix.node }}
|
|
19
|
+
cache: npm
|
|
20
|
+
- run: npm ci
|
|
21
|
+
- run: npm test
|
|
22
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.2 (2026-02-22)
|
|
4
|
+
|
|
5
|
+
### ๐ OpenClaw Integration V1 (Cron Synchronization)
|
|
6
|
+
|
|
7
|
+
- **Capture โ Consolidate โ Surface closed loop** โ agent-memory now integrates seamlessly with OpenClaw's built-in memory cron jobs (`memory-sync`, `memory-tidy`, `memory-surface`) with zero code changes ([DD-0004](docs/design/0004-agent-memory-integration.md))
|
|
8
|
+
- **memory-sync** (14:00 & 22:00): Each new journal bullet is auto-synced to agent-memory via `mcporter call agent-memory.remember` with keyword-based type classification and URI dedup
|
|
9
|
+
- **memory-tidy** (03:00): Triggers `agent-memory.reflect phase=all` (Ebbinghaus decay + tidy + govern) after Markdown consolidation, with consistency spot-check
|
|
10
|
+
- **memory-surface** (14:05 & 22:05): Generates structured `RECENT.md` (โค80 lines) from high-vitality agent-memory entries, with fallback to raw journal reading
|
|
11
|
+
- **Design principle**: Markdown remains source of truth; agent-memory is a derived index layer with best-effort sync
|
|
12
|
+
- **README updated** with full OpenClaw Integration guide
|
|
13
|
+
|
|
14
|
+
## 2.1.1 (2026-02-21)
|
|
15
|
+
|
|
16
|
+
### ๐ Documentation
|
|
17
|
+
|
|
18
|
+
- **Memory-janitor integration guide** โ New `examples/openclaw-setup.md` section explaining what a memory janitor is and how to wire it to agent-memory (decay trigger + consistency check) ([PR #2](https://github.com/smysle/agent-memory/pull/2))
|
|
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)
|
|
22
|
+
|
|
3
23
|
## 2.0.0 (2026-02-20)
|
|
4
24
|
|
|
5
25
|
### ๐ Complete Rewrite
|
package/README.md
CHANGED
|
@@ -37,8 +37,8 @@ Inspired by how human brains consolidate memories during sleep, AgentMemory mana
|
|
|
37
37
|
| ๐ธ๏ธ **Knowledge Graph** | Multi-hop traversal across memory associations | PowerMem |
|
|
38
38
|
| ๐ธ **Snapshots** | Auto-snapshot before every change, one-click rollback | nocturne + Memory Palace |
|
|
39
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) |
|
|
40
|
+
| ๐ **Sleep Cycle** | Automated sync โ decay โ tidy โ govern pipeline | - |
|
|
41
|
+
| ๐ **Priority System** | P0 identity (never decays) โ P3 event (14-day half-life) | - |
|
|
42
42
|
| ๐ค **Multi-Agent** | Agent isolation via `agent_id` scope | PowerMem |
|
|
43
43
|
| ๐ **MCP Server** | 9 tools, works with Claude Code / Cursor / OpenClaw | Standard MCP |
|
|
44
44
|
|
|
@@ -47,7 +47,7 @@ Inspired by how human brains consolidate memories during sleep, AgentMemory mana
|
|
|
47
47
|
### Install
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
npm install agent-memory
|
|
50
|
+
npm install @smyslenny/agent-memory
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
### CLI
|
|
@@ -79,7 +79,7 @@ agent-memory status
|
|
|
79
79
|
### Library
|
|
80
80
|
|
|
81
81
|
```typescript
|
|
82
|
-
import { openDatabase, syncOne, searchBM25, boot, runDecay } from 'agent-memory';
|
|
82
|
+
import { openDatabase, syncOne, searchBM25, boot, runDecay } from '@smyslenny/agent-memory';
|
|
83
83
|
|
|
84
84
|
const db = openDatabase({ path: './memory.db' });
|
|
85
85
|
|
|
@@ -106,9 +106,9 @@ runDecay(db);
|
|
|
106
106
|
```json
|
|
107
107
|
{
|
|
108
108
|
"mcpServers": {
|
|
109
|
-
"agent-memory": {
|
|
109
|
+
"@smyslenny/agent-memory": {
|
|
110
110
|
"command": "node",
|
|
111
|
-
"args": ["node_modules/agent-memory/dist/mcp/server.js"],
|
|
111
|
+
"args": ["node_modules/@smyslenny/agent-memory/dist/mcp/server.js"],
|
|
112
112
|
"env": {
|
|
113
113
|
"AGENT_MEMORY_DB": "./memory.db"
|
|
114
114
|
}
|
|
@@ -119,6 +119,46 @@ runDecay(db);
|
|
|
119
119
|
|
|
120
120
|
**9 MCP Tools:** `remember` ยท `recall` ยท `recall_path` ยท `boot` ยท `forget` ยท `link` ยท `snapshot` ยท `reflect` ยท `status`
|
|
121
121
|
|
|
122
|
+
## ๐ OpenClaw Integration
|
|
123
|
+
|
|
124
|
+
AgentMemory works **out of the box** with [OpenClaw](https://github.com/smysle/openclaw)'s built-in memory cron jobs โ no code changes required. The integration implements a **Capture โ Consolidate โ Surface** closed loop that keeps Markdown journals and the structured memory DB in sync automatically.
|
|
125
|
+
|
|
126
|
+
### How It Works
|
|
127
|
+
|
|
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
|
+
```
|
|
136
|
+
|
|
137
|
+
| Phase | Cron Job | What Happens | agent-memory Integration |
|
|
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 |
|
|
142
|
+
|
|
143
|
+
### Key Design Principles
|
|
144
|
+
|
|
145
|
+
- **Markdown is source of truth** โ agent-memory is a derived index layer; all data flows Markdown โ DB, never the reverse.
|
|
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).
|
|
149
|
+
|
|
150
|
+
### Setup
|
|
151
|
+
|
|
152
|
+
If you're running OpenClaw with the standard memory cron suite (`memory-sync`, `memory-tidy`, `memory-surface`), the integration is **already active** โ the cron prompts include agent-memory sync steps. Just make sure:
|
|
153
|
+
|
|
154
|
+
1. **agent-memory is installed and initialized** โ `agent-memory init`
|
|
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`
|
|
157
|
+
|
|
158
|
+
For detailed setup and prompt templates, see:
|
|
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)
|
|
161
|
+
|
|
122
162
|
## ๐๏ธ Architecture
|
|
123
163
|
|
|
124
164
|
```
|
package/README.zh-CN.md
CHANGED
|
@@ -36,8 +36,8 @@ AI Agent ๆฏๆฌกไผ่ฏ้ฝไผ้ๅฟไธๅใไธไธๆ็ชๅฃๆ้๏ผๅฏน่ฏๅๅฒ
|
|
|
36
36
|
| ๐ธ๏ธ **็ฅ่ฏๅพ่ฐฑ** | ่ฎฐๅฟๅ
ณ่็ๅค่ทณ้ๅ | PowerMem |
|
|
37
37
|
| ๐ธ **ๅฟซ็
ง็ณป็ป** | ๆฏๆฌกไฟฎๆนๅ่ชๅจๅฟซ็
ง๏ผไธ้ฎๅๆป | nocturne + Memory Palace |
|
|
38
38
|
| ๐ **ๆๅพๆ็ฅๆ็ดข** | ไบๅฎๅ/ๆถ้ดๅ/ๅ ๆๅ/ๆข็ดขๅๆฅ่ฏข่ทฏ็ฑ | Memory Palace |
|
|
39
|
-
| ๐ **็ก็ ๅจๆ** | ่ชๅจๅ sync โ decay โ tidy โ govern ๆตๆฐด็บฟ |
|
|
40
|
-
| ๐ **ไผๅ
็บง็ณป็ป** | P0 ่บซไปฝ๏ผๆฐธไธ่กฐๅ๏ผโ P3 ไบไปถ๏ผ14ๅคฉๅ่กฐๆ๏ผ |
|
|
39
|
+
| ๐ **็ก็ ๅจๆ** | ่ชๅจๅ sync โ decay โ tidy โ govern ๆตๆฐด็บฟ | - |
|
|
40
|
+
| ๐ **ไผๅ
็บง็ณป็ป** | P0 ่บซไปฝ๏ผๆฐธไธ่กฐๅ๏ผโ P3 ไบไปถ๏ผ14ๅคฉๅ่กฐๆ๏ผ | - |
|
|
41
41
|
| ๐ค **ๅค Agent** | ้่ฟ `agent_id` ๅฎ็ฐ่ฎฐๅฟ้็ฆป | PowerMem |
|
|
42
42
|
| ๐ **MCP Server** | 9 ไธชๅทฅๅ
ท๏ผๆฏๆ Claude Code / Cursor / OpenClaw | ๆ ๅ MCP |
|
|
43
43
|
|
|
@@ -46,7 +46,7 @@ AI Agent ๆฏๆฌกไผ่ฏ้ฝไผ้ๅฟไธๅใไธไธๆ็ชๅฃๆ้๏ผๅฏน่ฏๅๅฒ
|
|
|
46
46
|
### ๅฎ่ฃ
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
npm install agent-memory
|
|
49
|
+
npm install @smyslenny/agent-memory
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
### ๅฝไปค่ก
|
|
@@ -78,7 +78,7 @@ agent-memory status
|
|
|
78
78
|
### ไฝไธบๅบไฝฟ็จ
|
|
79
79
|
|
|
80
80
|
```typescript
|
|
81
|
-
import { openDatabase, syncOne, searchBM25, boot, runDecay } from 'agent-memory';
|
|
81
|
+
import { openDatabase, syncOne, searchBM25, boot, runDecay } from '@smyslenny/agent-memory';
|
|
82
82
|
|
|
83
83
|
const db = openDatabase({ path: './memory.db' });
|
|
84
84
|
|
|
@@ -105,9 +105,9 @@ runDecay(db);
|
|
|
105
105
|
```json
|
|
106
106
|
{
|
|
107
107
|
"mcpServers": {
|
|
108
|
-
"agent-memory": {
|
|
108
|
+
"@smyslenny/agent-memory": {
|
|
109
109
|
"command": "node",
|
|
110
|
-
"args": ["node_modules/agent-memory/dist/mcp/server.js"],
|
|
110
|
+
"args": ["node_modules/@smyslenny/agent-memory/dist/mcp/server.js"],
|
|
111
111
|
"env": {
|
|
112
112
|
"AGENT_MEMORY_DB": "./memory.db"
|
|
113
113
|
}
|