agent-recall-mcp 2.1.2 → 2.1.4
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/README.md +58 -197
- package/dist/index.js +1 -1
- package/package.json +13 -6
package/README.md
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
# agent-recall-mcp
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Persistent memory for AI agents. Session state that survives restarts, handoffs, and cold starts.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/agent-recall-mcp)
|
|
6
|
-
[](
|
|
6
|
+
[](https://github.com/Goldentrii/AgentRecall/blob/main/LICENSE)
|
|
7
7
|
[](#tools)
|
|
8
8
|
[](#requirements)
|
|
9
9
|
|
|
10
|
-
MCP server
|
|
10
|
+
**agent-recall-mcp** is an MCP server that gives any AI agent persistent session memory, alignment detection, and cross-session intelligence. Works with Claude Code, Cursor, VS Code Copilot, Windsurf, Claude Desktop, and any MCP-compatible client.
|
|
11
11
|
|
|
12
|
-
**Zero cloud. Zero telemetry. All data stays
|
|
12
|
+
**Zero cloud. Zero telemetry. All data stays on your machine.**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Why AgentRecall?
|
|
17
|
+
|
|
18
|
+
| Problem | How AgentRecall solves it |
|
|
19
|
+
|---------|--------------------------|
|
|
20
|
+
| Agent forgets everything between sessions | Three-layer memory persists state across sessions |
|
|
21
|
+
| Cold-start costs 2,000-5,000 tokens of context | Agent reads structured journal in ~200 tokens |
|
|
22
|
+
| Human says one thing, agent builds another | Alignment checks measure the understanding gap |
|
|
23
|
+
| Human contradicts a past decision unknowingly | Nudge protocol surfaces the contradiction |
|
|
24
|
+
| Multi-agent handoff loses context | Machine-readable state transfers cleanly between agents |
|
|
13
25
|
|
|
14
26
|
---
|
|
15
27
|
|
|
@@ -49,9 +61,9 @@ claude mcp add agent-recall -- npx -y agent-recall-mcp
|
|
|
49
61
|
}
|
|
50
62
|
```
|
|
51
63
|
|
|
52
|
-
### Windsurf / Claude Desktop
|
|
64
|
+
### Windsurf / Claude Desktop / Other MCP Clients
|
|
53
65
|
|
|
54
|
-
|
|
66
|
+
Add as an MCP server with command: `npx -y agent-recall-mcp`
|
|
55
67
|
|
|
56
68
|
---
|
|
57
69
|
|
|
@@ -65,7 +77,7 @@ Same pattern — add as an MCP server with `npx -y agent-recall-mcp` as the comm
|
|
|
65
77
|
|------|-------------|
|
|
66
78
|
| `journal_read` | Read entry by date or `"latest"`. Filter by section (`brief`, `qa`, `completed`, `status`, `blockers`, `next`, `decisions`, `reflection`, `files`, `observations`). |
|
|
67
79
|
| `journal_write` | Append to or replace today's journal. Target a specific section or use `replace_all` for full overwrite. |
|
|
68
|
-
| `journal_capture` | Lightweight Layer 1 Q&A capture — one question + answer pair, tagged, timestamped.
|
|
80
|
+
| `journal_capture` | Lightweight Layer 1 Q&A capture — one question + answer pair, tagged, timestamped. |
|
|
69
81
|
| `journal_list` | List recent entries for a project (date, title, momentum). |
|
|
70
82
|
| `journal_search` | Full-text search across all journal entries. Filter by section. |
|
|
71
83
|
| `journal_projects` | List all tracked projects on this machine. |
|
|
@@ -74,14 +86,32 @@ Same pattern — add as an MCP server with `npx -y agent-recall-mcp` as the comm
|
|
|
74
86
|
|
|
75
87
|
| Tool | Description |
|
|
76
88
|
|------|-------------|
|
|
77
|
-
| `alignment_check` | Record what the agent understood, its confidence level, assumptions, and any human correction. Measures the understanding gap. |
|
|
89
|
+
| `alignment_check` | Record what the agent understood, its confidence level, assumptions, and any human correction. Measures the understanding gap over time. |
|
|
78
90
|
| `nudge` | Surface a contradiction between the human's current input and a prior decision. Helps the human clarify their own thinking. |
|
|
79
91
|
|
|
80
92
|
### Synthesis (Cross-Session Intelligence)
|
|
81
93
|
|
|
82
94
|
| Tool | Description |
|
|
83
95
|
|------|-------------|
|
|
84
|
-
| `context_synthesize` | Generate L3 semantic synthesis
|
|
96
|
+
| `context_synthesize` | Generate L3 semantic synthesis — goal evolution, decision history, active blockers, recurring patterns, and contradiction detection across sessions. |
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Three-Layer Memory Architecture
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
L1: Working Memory [per-turn, ~50 tokens] "What happened"
|
|
104
|
+
| synthesized into
|
|
105
|
+
L2: Episodic Memory [daily journal, ~800 tok] "What it means"
|
|
106
|
+
| synthesized into
|
|
107
|
+
L3: Semantic Memory [cross-session, ~200 tok] "What's true across sessions"
|
|
108
|
+
(contradiction detection + goal evolution tracking)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Each layer serves a different consumer:
|
|
112
|
+
- **L1** captures raw events as they happen (fast, append-only)
|
|
113
|
+
- **L2** structures the day's work into a navigable journal (agent reads this on cold start)
|
|
114
|
+
- **L3** synthesizes patterns across sessions (detects contradictions, tracks goal drift)
|
|
85
115
|
|
|
86
116
|
---
|
|
87
117
|
|
|
@@ -96,27 +126,14 @@ Two MCP resources for browsing without tool calls:
|
|
|
96
126
|
|
|
97
127
|
---
|
|
98
128
|
|
|
99
|
-
## Three-Layer Memory
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
L1: Working Memory [per-turn, ~50 tokens] "What happened"
|
|
103
|
-
↓ synthesized into
|
|
104
|
-
L2: Episodic Memory [daily journal, ~800 tok] "What it means"
|
|
105
|
-
↓ synthesized into
|
|
106
|
-
L3: Semantic Memory [cross-session, ~200 tok] "What's true across sessions"
|
|
107
|
-
(contradiction detection + goal evolution tracking)
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
129
|
## Project Auto-Detection
|
|
113
130
|
|
|
114
131
|
When `project = "auto"` (default), the server resolves the project by:
|
|
115
132
|
|
|
116
133
|
1. `AGENT_RECALL_PROJECT` env var
|
|
117
|
-
2. Git remote origin
|
|
118
|
-
3. Git root directory
|
|
119
|
-
4. `package.json`
|
|
134
|
+
2. Git remote origin -> repo name
|
|
135
|
+
3. Git root directory -> basename
|
|
136
|
+
4. `package.json` -> `name` field
|
|
120
137
|
5. Basename of current working directory
|
|
121
138
|
|
|
122
139
|
---
|
|
@@ -125,14 +142,14 @@ When `project = "auto"` (default), the server resolves the project by:
|
|
|
125
142
|
|
|
126
143
|
```
|
|
127
144
|
~/.agent-recall/ (or $AGENT_RECALL_ROOT)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
145
|
+
+-- config.json
|
|
146
|
+
+-- projects/
|
|
147
|
+
+-- {project-slug}/
|
|
148
|
+
+-- journal/
|
|
149
|
+
+-- index.md <- auto-generated index
|
|
150
|
+
+-- YYYY-MM-DD.md <- L2: daily journal
|
|
151
|
+
+-- YYYY-MM-DD-log.md <- L1: raw Q&A capture
|
|
152
|
+
+-- YYYY-MM-DD-alignment.md <- alignment checks + nudges
|
|
136
153
|
```
|
|
137
154
|
|
|
138
155
|
**Legacy support**: automatically reads existing journals from `~/.claude/projects/*/memory/journal/`. New writes go to `~/.agent-recall/`.
|
|
@@ -167,177 +184,21 @@ npx agent-recall-mcp --list-tools # List all 9 tools as JSON
|
|
|
167
184
|
|
|
168
185
|
## Part of AgentRecall
|
|
169
186
|
|
|
170
|
-
This MCP server is one component of the [AgentRecall](https://github.com/Goldentrii/AgentRecall)
|
|
171
|
-
|
|
172
|
-
- **SKILL.md** — Claude Code skill with Think-Execute-Reflect quality loops
|
|
173
|
-
- **agent-recall-mcp** — This MCP server (works with any agent)
|
|
174
|
-
- **Intelligent Distance Protocol** — The underlying theory
|
|
175
|
-
|
|
176
|
-
---
|
|
177
|
-
|
|
178
|
-
## License
|
|
179
|
-
|
|
180
|
-
MIT — [Tongwu](https://github.com/Goldentrii)
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
# agent-recall-mcp(中文文档)
|
|
187
|
-
|
|
188
|
-
> 给你的 AI 智能体一个跨会话记忆的大脑。
|
|
189
|
-
|
|
190
|
-
[AgentRecall](https://github.com/Goldentrii/AgentRecall) 的 MCP 服务器 — 双层会话记忆,Think-Execute-Reflect 质量循环,对齐检测,矛盾提醒。兼容所有 MCP 客户端:Claude Code、Cursor、VS Code Copilot、Windsurf、Claude Desktop 等。
|
|
191
|
-
|
|
192
|
-
**零云端。零遥测。所有数据保存在本地。**
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
## 快速开始
|
|
197
|
-
|
|
198
|
-
### Claude Code
|
|
199
|
-
|
|
200
|
-
```bash
|
|
201
|
-
claude mcp add agent-recall -- npx -y agent-recall-mcp
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### Cursor
|
|
205
|
-
|
|
206
|
-
`.cursor/mcp.json`:
|
|
207
|
-
```json
|
|
208
|
-
{
|
|
209
|
-
"mcpServers": {
|
|
210
|
-
"agent-recall": {
|
|
211
|
-
"command": "npx",
|
|
212
|
-
"args": ["-y", "agent-recall-mcp"]
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### VS Code
|
|
219
|
-
|
|
220
|
-
`.vscode/mcp.json`:
|
|
221
|
-
```json
|
|
222
|
-
{
|
|
223
|
-
"servers": {
|
|
224
|
-
"agent-recall": {
|
|
225
|
-
"command": "npx",
|
|
226
|
-
"args": ["-y", "agent-recall-mcp"]
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
## 9 个工具
|
|
235
|
-
|
|
236
|
-
### 日志(会话记忆)
|
|
237
|
-
|
|
238
|
-
| 工具 | 功能 |
|
|
239
|
-
|------|------|
|
|
240
|
-
| `journal_read` | 按日期或 `"latest"` 读取日志。支持按章节过滤(`brief`、`qa`、`completed`、`status`、`blockers`、`next`、`decisions`、`reflection`、`files`、`observations`)。 |
|
|
241
|
-
| `journal_write` | 追加或替换今日日志。可指定目标章节,或用 `replace_all` 全量覆写。 |
|
|
242
|
-
| `journal_capture` | 轻量 Layer 1 问答捕获 — 一个问题+答案,带标签和时间戳。不加载完整日志。 |
|
|
243
|
-
| `journal_list` | 列出项目的最近日志条目(日期、标题、状态)。 |
|
|
244
|
-
| `journal_search` | 全文搜索所有日志条目,可按章节过滤。 |
|
|
245
|
-
| `journal_projects` | 列出本机所有被追踪的项目。 |
|
|
246
|
-
|
|
247
|
-
### 对齐(智能距离)
|
|
248
|
-
|
|
249
|
-
| 工具 | 功能 |
|
|
250
|
-
|------|------|
|
|
251
|
-
| `alignment_check` | 记录智能体的理解、置信度、假设和人类的纠正。量化理解差距。 |
|
|
252
|
-
| `nudge` | 检测到人类当前输入与之前的决策矛盾时,主动提问帮助人类理清思路。 |
|
|
253
|
-
|
|
254
|
-
### 合成(跨会话智能)
|
|
255
|
-
|
|
256
|
-
| 工具 | 功能 |
|
|
257
|
-
|------|------|
|
|
258
|
-
| `context_synthesize` | 从近期日志生成 L3 语义合成 — 目标演变、决策历史、活跃阻碍、重复模式、矛盾检测。 |
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## 资源(Resources)
|
|
187
|
+
This MCP server is one component of the [AgentRecall](https://github.com/Goldentrii/AgentRecall) ecosystem:
|
|
263
188
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
| `agent-recall://{project}/{date}` | 指定日期的日志条目 |
|
|
189
|
+
- **[SKILL.md](https://github.com/Goldentrii/AgentRecall/blob/main/SKILL.md)** — Claude Code skill with Think-Execute-Reflect quality loops
|
|
190
|
+
- **[agent-recall-mcp](https://www.npmjs.com/package/agent-recall-mcp)** — This MCP server (works with any MCP agent)
|
|
191
|
+
- **[Intelligent Distance Protocol](https://github.com/Goldentrii/AgentRecall/blob/main/docs/intelligent-distance-protocol.md)** — The underlying theory
|
|
268
192
|
|
|
269
193
|
---
|
|
270
194
|
|
|
271
|
-
##
|
|
195
|
+
## Feedback & Contributing
|
|
272
196
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
↓ 合成为
|
|
276
|
-
L2: 情景记忆 [每日日志, ~800 tok] "这意味着什么"
|
|
277
|
-
↓ 合成为
|
|
278
|
-
L3: 语义记忆 [跨会话, ~200 tok] "跨会话的真相"
|
|
279
|
-
(矛盾检测 + 目标演变追踪)
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## 项目自动识别
|
|
285
|
-
|
|
286
|
-
`project = "auto"`(默认)时,按以下优先级识别项目:
|
|
287
|
-
|
|
288
|
-
1. `AGENT_RECALL_PROJECT` 环境变量
|
|
289
|
-
2. Git 远程 origin → 仓库名
|
|
290
|
-
3. Git 根目录 → 目录名
|
|
291
|
-
4. `package.json` → `name` 字段
|
|
292
|
-
5. 当前工作目录的 basename
|
|
197
|
+
- Issues & PRs: [github.com/Goldentrii/AgentRecall](https://github.com/Goldentrii/AgentRecall)
|
|
198
|
+
- Email: tongwu0824@gmail.com
|
|
293
199
|
|
|
294
200
|
---
|
|
295
201
|
|
|
296
|
-
##
|
|
297
|
-
|
|
298
|
-
```
|
|
299
|
-
~/.agent-recall/ (或 $AGENT_RECALL_ROOT)
|
|
300
|
-
├── config.json
|
|
301
|
-
└── projects/
|
|
302
|
-
└── {project-slug}/
|
|
303
|
-
└── journal/
|
|
304
|
-
├── index.md ← 自动生成索引
|
|
305
|
-
├── YYYY-MM-DD.md ← L2: 每日日志
|
|
306
|
-
├── YYYY-MM-DD-log.md ← L1: 原始问答捕获
|
|
307
|
-
└── YYYY-MM-DD-alignment.md ← 对齐检查 + 矛盾提醒
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
**向后兼容**:自动读取 `~/.claude/projects/*/memory/journal/` 中的旧日志。新写入默认到 `~/.agent-recall/`。
|
|
311
|
-
|
|
312
|
-
---
|
|
313
|
-
|
|
314
|
-
## 环境变量
|
|
315
|
-
|
|
316
|
-
| 变量 | 默认值 | 说明 |
|
|
317
|
-
|------|--------|------|
|
|
318
|
-
| `AGENT_RECALL_ROOT` | `~/.agent-recall` | 存储根目录 |
|
|
319
|
-
| `AGENT_RECALL_PROJECT` | (自动识别) | 覆盖项目标识 |
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
## AgentRecall 生态
|
|
324
|
-
|
|
325
|
-
此 MCP 服务器是 [AgentRecall](https://github.com/Goldentrii/AgentRecall) 系统的组件之一:
|
|
326
|
-
|
|
327
|
-
- **SKILL.md** — Claude Code 技能,包含 Think-Execute-Reflect 质量循环
|
|
328
|
-
- **agent-recall-mcp** — 本 MCP 服务器(兼容任意智能体)
|
|
329
|
-
- **智能距离协议(Intelligent Distance Protocol)** — 底层理论框架
|
|
330
|
-
|
|
331
|
-
---
|
|
332
|
-
|
|
333
|
-
## 核心理念
|
|
334
|
-
|
|
335
|
-
**记忆解决遗忘,AgentRecall 解决误解。**
|
|
336
|
-
|
|
337
|
-
人类和 AI 之间的理解差距是结构性的 — 人类说话前后矛盾、碎片化、含糊不清;AI 则以完美的自信构建错误的东西。AgentRecall 通过对齐检测、矛盾提醒和跨会话合成来弥合这个「智能距离」。
|
|
338
|
-
|
|
339
|
-
---
|
|
340
|
-
|
|
341
|
-
## 许可证
|
|
202
|
+
## License
|
|
342
203
|
|
|
343
204
|
MIT — [Tongwu](https://github.com/Goldentrii)
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const execFileAsync = promisify(execFile);
|
|
|
11
11
|
// ---------------------------------------------------------------------------
|
|
12
12
|
// Constants
|
|
13
13
|
// ---------------------------------------------------------------------------
|
|
14
|
-
const VERSION = "2.1.
|
|
14
|
+
const VERSION = "2.1.4";
|
|
15
15
|
const JOURNAL_ROOT = process.env.AGENT_RECALL_ROOT ||
|
|
16
16
|
path.join(os.homedir(), ".agent-recall");
|
|
17
17
|
const LEGACY_ROOT = path.join(os.homedir(), ".claude", "projects");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-recall-mcp",
|
|
3
|
-
"version": "2.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.1.4",
|
|
4
|
+
"description": "Persistent agent memory and alignment detection via MCP — session state, contradiction nudging, and cross-session intelligence for any AI agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -23,18 +23,25 @@
|
|
|
23
23
|
"mcp",
|
|
24
24
|
"mcp-server",
|
|
25
25
|
"model-context-protocol",
|
|
26
|
-
"agent-
|
|
26
|
+
"agent-memory",
|
|
27
27
|
"ai-memory",
|
|
28
|
+
"ai-session-persistence",
|
|
29
|
+
"agent-recall",
|
|
28
30
|
"session-memory",
|
|
29
|
-
"
|
|
31
|
+
"agent-to-agent",
|
|
30
32
|
"ai-agents",
|
|
31
33
|
"claude-code",
|
|
32
34
|
"cursor",
|
|
35
|
+
"vscode",
|
|
36
|
+
"windsurf",
|
|
33
37
|
"intelligent-distance",
|
|
38
|
+
"alignment-detection",
|
|
39
|
+
"contradiction-detection",
|
|
34
40
|
"quality-loop",
|
|
35
41
|
"think-execute-reflect",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
42
|
+
"cold-start",
|
|
43
|
+
"journal",
|
|
44
|
+
"cross-session"
|
|
38
45
|
],
|
|
39
46
|
"license": "MIT",
|
|
40
47
|
"repository": {
|