agent-recall-mcp 2.1.1 → 2.1.2
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 +343 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# agent-recall-mcp
|
|
2
|
+
|
|
3
|
+
> Give your AI agent a brain that survives every session.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/agent-recall-mcp)
|
|
6
|
+
[](../LICENSE)
|
|
7
|
+
[](#tools)
|
|
8
|
+
[](#requirements)
|
|
9
|
+
|
|
10
|
+
MCP server for [AgentRecall](https://github.com/Goldentrii/AgentRecall) — two-layer session memory with Think-Execute-Reflect quality loops, alignment detection, and contradiction nudging. Works with any MCP-compatible agent: Claude Code, Cursor, VS Code Copilot, Windsurf, Claude Desktop, and more.
|
|
11
|
+
|
|
12
|
+
**Zero cloud. Zero telemetry. All data stays local.**
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
### Claude Code
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
claude mcp add agent-recall -- npx -y agent-recall-mcp
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Cursor
|
|
25
|
+
|
|
26
|
+
`.cursor/mcp.json`:
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"mcpServers": {
|
|
30
|
+
"agent-recall": {
|
|
31
|
+
"command": "npx",
|
|
32
|
+
"args": ["-y", "agent-recall-mcp"]
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### VS Code
|
|
39
|
+
|
|
40
|
+
`.vscode/mcp.json`:
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"servers": {
|
|
44
|
+
"agent-recall": {
|
|
45
|
+
"command": "npx",
|
|
46
|
+
"args": ["-y", "agent-recall-mcp"]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Windsurf / Claude Desktop
|
|
53
|
+
|
|
54
|
+
Same pattern — add as an MCP server with `npx -y agent-recall-mcp` as the command.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Tools
|
|
59
|
+
|
|
60
|
+
9 MCP tools across three categories:
|
|
61
|
+
|
|
62
|
+
### Journal (Session Memory)
|
|
63
|
+
|
|
64
|
+
| Tool | Description |
|
|
65
|
+
|------|-------------|
|
|
66
|
+
| `journal_read` | Read entry by date or `"latest"`. Filter by section (`brief`, `qa`, `completed`, `status`, `blockers`, `next`, `decisions`, `reflection`, `files`, `observations`). |
|
|
67
|
+
| `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. Doesn't load the full journal. |
|
|
69
|
+
| `journal_list` | List recent entries for a project (date, title, momentum). |
|
|
70
|
+
| `journal_search` | Full-text search across all journal entries. Filter by section. |
|
|
71
|
+
| `journal_projects` | List all tracked projects on this machine. |
|
|
72
|
+
|
|
73
|
+
### Alignment (Intelligent Distance)
|
|
74
|
+
|
|
75
|
+
| Tool | Description |
|
|
76
|
+
|------|-------------|
|
|
77
|
+
| `alignment_check` | Record what the agent understood, its confidence level, assumptions, and any human correction. Measures the understanding gap. |
|
|
78
|
+
| `nudge` | Surface a contradiction between the human's current input and a prior decision. Helps the human clarify their own thinking. |
|
|
79
|
+
|
|
80
|
+
### Synthesis (Cross-Session Intelligence)
|
|
81
|
+
|
|
82
|
+
| Tool | Description |
|
|
83
|
+
|------|-------------|
|
|
84
|
+
| `context_synthesize` | Generate L3 semantic synthesis from recent journals — goal evolution, decision history, active blockers, recurring patterns, contradiction detection. |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Resources
|
|
89
|
+
|
|
90
|
+
Two MCP resources for browsing without tool calls:
|
|
91
|
+
|
|
92
|
+
| URI Pattern | Description |
|
|
93
|
+
|-------------|-------------|
|
|
94
|
+
| `agent-recall://{project}/index` | Project journal index |
|
|
95
|
+
| `agent-recall://{project}/{date}` | Specific journal entry |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
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
|
+
## Project Auto-Detection
|
|
113
|
+
|
|
114
|
+
When `project = "auto"` (default), the server resolves the project by:
|
|
115
|
+
|
|
116
|
+
1. `AGENT_RECALL_PROJECT` env var
|
|
117
|
+
2. Git remote origin → repo name
|
|
118
|
+
3. Git root directory → basename
|
|
119
|
+
4. `package.json` → `name` field
|
|
120
|
+
5. Basename of current working directory
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Storage
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
~/.agent-recall/ (or $AGENT_RECALL_ROOT)
|
|
128
|
+
├── config.json
|
|
129
|
+
└── projects/
|
|
130
|
+
└── {project-slug}/
|
|
131
|
+
└── journal/
|
|
132
|
+
├── index.md ← auto-generated index
|
|
133
|
+
├── YYYY-MM-DD.md ← L2: daily journal
|
|
134
|
+
├── YYYY-MM-DD-log.md ← L1: raw Q&A capture
|
|
135
|
+
└── YYYY-MM-DD-alignment.md ← alignment checks + nudges
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Legacy support**: automatically reads existing journals from `~/.claude/projects/*/memory/journal/`. New writes go to `~/.agent-recall/`.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## CLI
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
npx agent-recall-mcp # Start MCP server (stdio)
|
|
146
|
+
npx agent-recall-mcp --help # Show help
|
|
147
|
+
npx agent-recall-mcp --list-tools # List all 9 tools as JSON
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Environment Variables
|
|
153
|
+
|
|
154
|
+
| Variable | Default | Description |
|
|
155
|
+
|----------|---------|-------------|
|
|
156
|
+
| `AGENT_RECALL_ROOT` | `~/.agent-recall` | Storage root directory |
|
|
157
|
+
| `AGENT_RECALL_PROJECT` | (auto-detect) | Override project slug |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Requirements
|
|
162
|
+
|
|
163
|
+
- Node.js >= 18
|
|
164
|
+
- Dependencies: `@modelcontextprotocol/sdk`, `zod`
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Part of AgentRecall
|
|
169
|
+
|
|
170
|
+
This MCP server is one component of the [AgentRecall](https://github.com/Goldentrii/AgentRecall) system:
|
|
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)
|
|
263
|
+
|
|
264
|
+
| URI 模式 | 说明 |
|
|
265
|
+
|----------|------|
|
|
266
|
+
| `agent-recall://{project}/index` | 项目日志索引 |
|
|
267
|
+
| `agent-recall://{project}/{date}` | 指定日期的日志条目 |
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## 三层记忆架构
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
L1: 工作记忆 [每轮, ~50 tokens] "发生了什么"
|
|
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
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
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
|
+
## 许可证
|
|
342
|
+
|
|
343
|
+
MIT — [Tongwu](https://github.com/Goldentrii)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-recall-mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "AI session memory with Think-Execute-Reflect quality loops — give your agent a brain that survives every session",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"agent-recall-mcp": "dist/index.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
12
13
|
],
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "tsc && node -e \"require('fs').chmodSync('dist/index.js', '755')\"",
|