agent-recall-mcp 3.2.3 → 3.3.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 +276 -218
- package/dist/helpers/journal-files.d.ts +30 -0
- package/dist/helpers/journal-files.d.ts.map +1 -0
- package/dist/helpers/journal-files.js +96 -0
- package/dist/helpers/journal-files.js.map +1 -0
- package/dist/helpers/sections.d.ts +12 -0
- package/dist/helpers/sections.d.ts.map +1 -0
- package/dist/helpers/sections.js +84 -0
- package/dist/helpers/sections.js.map +1 -0
- package/dist/index.js +59 -1199
- package/dist/index.js.map +1 -1
- package/dist/palace/awareness.d.ts +67 -0
- package/dist/palace/awareness.d.ts.map +1 -0
- package/dist/palace/awareness.js +231 -0
- package/dist/palace/awareness.js.map +1 -0
- package/dist/palace/consolidate.d.ts +28 -0
- package/dist/palace/consolidate.d.ts.map +1 -0
- package/dist/palace/consolidate.js +129 -0
- package/dist/palace/consolidate.js.map +1 -0
- package/dist/palace/fan-out.d.ts +15 -0
- package/dist/palace/fan-out.d.ts.map +1 -0
- package/dist/palace/fan-out.js +78 -0
- package/dist/palace/fan-out.js.map +1 -0
- package/dist/palace/graph.d.ts +11 -0
- package/dist/palace/graph.d.ts.map +1 -0
- package/dist/palace/graph.js +59 -0
- package/dist/palace/graph.js.map +1 -0
- package/dist/palace/identity.d.ts +6 -0
- package/dist/palace/identity.d.ts.map +1 -0
- package/dist/palace/identity.js +18 -0
- package/dist/palace/identity.js.map +1 -0
- package/dist/palace/index-manager.d.ts +7 -0
- package/dist/palace/index-manager.d.ts.map +1 -0
- package/dist/palace/index-manager.js +46 -0
- package/dist/palace/index-manager.js.map +1 -0
- package/dist/palace/insights-index.d.ts +39 -0
- package/dist/palace/insights-index.d.ts.map +1 -0
- package/dist/palace/insights-index.js +101 -0
- package/dist/palace/insights-index.js.map +1 -0
- package/dist/palace/log.d.ts +9 -0
- package/dist/palace/log.d.ts.map +1 -0
- package/dist/palace/log.js +28 -0
- package/dist/palace/log.js.map +1 -0
- package/dist/palace/obsidian.d.ts +12 -0
- package/dist/palace/obsidian.d.ts.map +1 -0
- package/dist/palace/obsidian.js +76 -0
- package/dist/palace/obsidian.js.map +1 -0
- package/dist/palace/rooms.d.ts +14 -0
- package/dist/palace/rooms.d.ts.map +1 -0
- package/dist/palace/rooms.js +117 -0
- package/dist/palace/rooms.js.map +1 -0
- package/dist/palace/salience.d.ts +15 -0
- package/dist/palace/salience.d.ts.map +1 -0
- package/dist/palace/salience.js +33 -0
- package/dist/palace/salience.js.map +1 -0
- package/dist/resources/journal-resources.d.ts +3 -0
- package/dist/resources/journal-resources.d.ts.map +1 -0
- package/dist/resources/journal-resources.js +72 -0
- package/dist/resources/journal-resources.js.map +1 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +7 -0
- package/dist/server.js.map +1 -0
- package/dist/storage/fs-utils.d.ts +8 -0
- package/dist/storage/fs-utils.d.ts.map +1 -0
- package/dist/storage/fs-utils.js +28 -0
- package/dist/storage/fs-utils.js.map +1 -0
- package/dist/storage/paths.d.ts +21 -0
- package/dist/storage/paths.d.ts.map +1 -0
- package/dist/storage/paths.js +59 -0
- package/dist/storage/paths.js.map +1 -0
- package/dist/storage/project.d.ts +17 -0
- package/dist/storage/project.d.ts.map +1 -0
- package/dist/storage/project.js +130 -0
- package/dist/storage/project.js.map +1 -0
- package/dist/tools/alignment-check.d.ts +3 -0
- package/dist/tools/alignment-check.d.ts.map +1 -0
- package/dist/tools/alignment-check.js +73 -0
- package/dist/tools/alignment-check.js.map +1 -0
- package/dist/tools/awareness-update.d.ts +9 -0
- package/dist/tools/awareness-update.d.ts.map +1 -0
- package/dist/tools/awareness-update.js +90 -0
- package/dist/tools/awareness-update.js.map +1 -0
- package/dist/tools/context-synthesize.d.ts +3 -0
- package/dist/tools/context-synthesize.d.ts.map +1 -0
- package/dist/tools/context-synthesize.js +204 -0
- package/dist/tools/context-synthesize.js.map +1 -0
- package/dist/tools/journal-archive.d.ts +3 -0
- package/dist/tools/journal-archive.d.ts.map +1 -0
- package/dist/tools/journal-archive.js +62 -0
- package/dist/tools/journal-archive.js.map +1 -0
- package/dist/tools/journal-capture.d.ts +3 -0
- package/dist/tools/journal-capture.d.ts.map +1 -0
- package/dist/tools/journal-capture.js +87 -0
- package/dist/tools/journal-capture.js.map +1 -0
- package/dist/tools/journal-cold-start.d.ts +3 -0
- package/dist/tools/journal-cold-start.d.ts.map +1 -0
- package/dist/tools/journal-cold-start.js +70 -0
- package/dist/tools/journal-cold-start.js.map +1 -0
- package/dist/tools/journal-list.d.ts +3 -0
- package/dist/tools/journal-list.d.ts.map +1 -0
- package/dist/tools/journal-list.js +43 -0
- package/dist/tools/journal-list.js.map +1 -0
- package/dist/tools/journal-projects.d.ts +3 -0
- package/dist/tools/journal-projects.d.ts.map +1 -0
- package/dist/tools/journal-projects.js +25 -0
- package/dist/tools/journal-projects.js.map +1 -0
- package/dist/tools/journal-read.d.ts +3 -0
- package/dist/tools/journal-read.d.ts.map +1 -0
- package/dist/tools/journal-read.js +72 -0
- package/dist/tools/journal-read.js.map +1 -0
- package/dist/tools/journal-search.d.ts +3 -0
- package/dist/tools/journal-search.d.ts.map +1 -0
- package/dist/tools/journal-search.js +113 -0
- package/dist/tools/journal-search.js.map +1 -0
- package/dist/tools/journal-state.d.ts +6 -0
- package/dist/tools/journal-state.d.ts.map +1 -0
- package/dist/tools/journal-state.js +111 -0
- package/dist/tools/journal-state.js.map +1 -0
- package/dist/tools/journal-write.d.ts +3 -0
- package/dist/tools/journal-write.d.ts.map +1 -0
- package/dist/tools/journal-write.js +88 -0
- package/dist/tools/journal-write.js.map +1 -0
- package/dist/tools/knowledge-read.d.ts +3 -0
- package/dist/tools/knowledge-read.d.ts.map +1 -0
- package/dist/tools/knowledge-read.js +118 -0
- package/dist/tools/knowledge-read.js.map +1 -0
- package/dist/tools/knowledge-write.d.ts +3 -0
- package/dist/tools/knowledge-write.d.ts.map +1 -0
- package/dist/tools/knowledge-write.js +89 -0
- package/dist/tools/knowledge-write.js.map +1 -0
- package/dist/tools/nudge.d.ts +3 -0
- package/dist/tools/nudge.d.ts.map +1 -0
- package/dist/tools/nudge.js +41 -0
- package/dist/tools/nudge.js.map +1 -0
- package/dist/tools/palace-lint.d.ts +7 -0
- package/dist/tools/palace-lint.d.ts.map +1 -0
- package/dist/tools/palace-lint.js +149 -0
- package/dist/tools/palace-lint.js.map +1 -0
- package/dist/tools/palace-read.d.ts +6 -0
- package/dist/tools/palace-read.d.ts.map +1 -0
- package/dist/tools/palace-read.js +78 -0
- package/dist/tools/palace-read.js.map +1 -0
- package/dist/tools/palace-search.d.ts +6 -0
- package/dist/tools/palace-search.d.ts.map +1 -0
- package/dist/tools/palace-search.js +81 -0
- package/dist/tools/palace-search.js.map +1 -0
- package/dist/tools/palace-walk.d.ts +12 -0
- package/dist/tools/palace-walk.d.ts.map +1 -0
- package/dist/tools/palace-walk.js +167 -0
- package/dist/tools/palace-walk.js.map +1 -0
- package/dist/tools/palace-write.d.ts +6 -0
- package/dist/tools/palace-write.d.ts.map +1 -0
- package/dist/tools/palace-write.js +108 -0
- package/dist/tools/palace-write.js.map +1 -0
- package/dist/tools/recall-insight.d.ts +9 -0
- package/dist/tools/recall-insight.d.ts.map +1 -0
- package/dist/tools/recall-insight.js +51 -0
- package/dist/tools/recall-insight.js.map +1 -0
- package/dist/types.d.ts +112 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +31 -0
- package/dist/types.js.map +1 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -1,67 +1,45 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<h1 align="center">AgentRecall</h1>
|
|
3
|
-
<p align="center"><strong>
|
|
4
|
-
<p align="center">
|
|
3
|
+
<p align="center"><strong>Memory Palace for AI Agents — A Second Brain That Compounds</strong></p>
|
|
4
|
+
<p align="center">Room-based knowledge organization · Cross-project insight recall · Salience scoring · Obsidian-compatible</p>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/agent-recall-mcp"><img src="https://img.shields.io/npm/v/agent-recall-mcp?style=flat-square&color=5D34F2" alt="npm"></a>
|
|
9
|
-
<a href="https://github.com/
|
|
10
|
-
<img src="https://img.shields.io/badge/MCP-
|
|
9
|
+
<a href="https://github.com/Goldentrii/AgentRecall/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-brightgreen?style=flat-square" alt="License"></a>
|
|
10
|
+
<img src="https://img.shields.io/badge/MCP-21_tools-orange?style=flat-square" alt="Tools">
|
|
11
11
|
<img src="https://img.shields.io/badge/protocol-Intelligent_Distance-5B2D8E?style=flat-square" alt="Protocol">
|
|
12
12
|
<img src="https://img.shields.io/badge/cloud-zero-blue?style=flat-square" alt="Zero Cloud">
|
|
13
|
+
<img src="https://img.shields.io/badge/Obsidian-compatible-7C3AED?style=flat-square" alt="Obsidian">
|
|
13
14
|
</p>
|
|
14
15
|
|
|
15
16
|
---
|
|
16
17
|
|
|
17
|
-
##
|
|
18
|
+
## What Is AgentRecall?
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
AgentRecall is an **MCP server** (Model Context Protocol) that gives AI agents persistent memory, cross-project insight recall, and a self-compounding awareness system. It works with Claude Code, Cursor, VS Code, Windsurf, and any MCP-compatible agent.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
**
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
**Not just a memory system.** Most agent memory tools store and retrieve. AgentRecall also:
|
|
23
|
+
- **Organizes** knowledge into themed rooms (Memory Palace)
|
|
24
|
+
- **Compounds** — insights merge and strengthen over time, not just accumulate
|
|
25
|
+
- **Cross-references** — writing to one room auto-updates related rooms
|
|
26
|
+
- **Recalls** — before starting a task, surfaces relevant lessons from any project
|
|
27
|
+
- **Detects misunderstanding** — measures the gap between human intent and agent interpretation
|
|
26
28
|
|
|
27
29
|
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Human gives: scattered, non-linear instructions
|
|
37
|
-
Agent picks: one instruction, ignores the rest
|
|
38
|
-
Gap: the connective tissue between points is lost
|
|
30
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
31
|
+
│ Layer 1: Quick Capture journal_capture │
|
|
32
|
+
│ Layer 2: Daily Journal journal_write / journal_read │
|
|
33
|
+
│ Layer 3: Memory Palace palace_write / palace_walk │
|
|
34
|
+
│ Layer 4: Awareness awareness_update (compounding) │
|
|
35
|
+
│ Layer 5: Insight Index recall_insight (cross-project) │
|
|
36
|
+
└──────────────────────────────────────────────────────────────┘
|
|
39
37
|
```
|
|
40
38
|
|
|
41
|
-
**AgentRecall doesn't try to close this gap. It builds the protocol to navigate it.**
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## How AgentRecall Bridges the Gap
|
|
46
|
-
|
|
47
|
-
| Intelligent Distance Gap | AgentRecall Tool | What It Does |
|
|
48
|
-
|--------------------------|-----------------|-------------|
|
|
49
|
-
| Agent forgets what human said yesterday | `journal_read` + `journal_cold_start` | Persistent memory — 3-layer, cache-aware |
|
|
50
|
-
| Agent misunderstands human intent | `alignment_check` | Records confidence + assumptions → human corrects BEFORE work |
|
|
51
|
-
| Agent contradicts a prior decision | `nudge` | Detects contradiction → surfaces it BEFORE damage |
|
|
52
|
-
| Agent says "done" but human disagrees | Think-Execute-Reflect loop | Quality scoring with COUNTS ("built 11 pages, 35 tabs"), not feelings ("went well") |
|
|
53
|
-
| Agent builds from imagination, not data | `journal_state` (JSON) | Structured state transfers agent-to-agent — no prose interpretation |
|
|
54
|
-
| Agent repeats the same mistake | Failures section + `context_synthesize` | Cross-session pattern detection → promoted to permanent memory |
|
|
55
|
-
| Next agent starts from zero | `journal_cold_start` (v3) | Hot/warm/cold cache — loads 3 files instead of 28 |
|
|
56
|
-
|
|
57
|
-
**Memory solves forgetting. AgentRecall solves misunderstanding.**
|
|
58
|
-
|
|
59
39
|
---
|
|
60
40
|
|
|
61
41
|
## Quick Start
|
|
62
42
|
|
|
63
|
-
### MCP Server (any agent)
|
|
64
|
-
|
|
65
43
|
```bash
|
|
66
44
|
# Claude Code
|
|
67
45
|
claude mcp add agent-recall -- npx -y agent-recall-mcp
|
|
@@ -71,212 +49,224 @@ claude mcp add agent-recall -- npx -y agent-recall-mcp
|
|
|
71
49
|
|
|
72
50
|
# VS Code — .vscode/mcp.json
|
|
73
51
|
{ "servers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } }
|
|
74
|
-
```
|
|
75
52
|
|
|
76
|
-
|
|
53
|
+
# Windsurf — ~/.codeium/windsurf/mcp_config.json
|
|
54
|
+
{ "mcpServers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } }
|
|
55
|
+
```
|
|
77
56
|
|
|
57
|
+
**Skill (Claude Code only):**
|
|
78
58
|
```bash
|
|
79
59
|
mkdir -p ~/.claude/skills/agent-recall
|
|
80
60
|
curl -o ~/.claude/skills/agent-recall/SKILL.md \
|
|
81
|
-
https://raw.githubusercontent.com/
|
|
61
|
+
https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/SKILL.md
|
|
82
62
|
```
|
|
83
63
|
|
|
84
|
-
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## How an Agent Uses AgentRecall
|
|
67
|
+
|
|
68
|
+
### Session Start
|
|
69
|
+
```
|
|
70
|
+
1. recall_insight(context="current task description") → relevant cross-project insights
|
|
71
|
+
2. palace_walk(depth="active") → project context + awareness
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### During Work
|
|
75
|
+
```
|
|
76
|
+
3. alignment_check(goal="...", confidence="medium") → verify understanding before big tasks
|
|
77
|
+
4. palace_write(room="architecture", content="...") → permanent knowledge with cross-refs
|
|
78
|
+
5. journal_capture(question="...", answer="...") → lightweight Q&A log
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Session End
|
|
82
|
+
```
|
|
83
|
+
6. journal_write(content="...", section="decisions") → daily journal entry
|
|
84
|
+
7. awareness_update(insights=[...]) → compound into awareness system
|
|
85
|
+
8. context_synthesize(consolidate=true) → promote journal → palace rooms
|
|
86
|
+
```
|
|
85
87
|
|
|
86
88
|
---
|
|
87
89
|
|
|
88
|
-
##
|
|
90
|
+
## 21 MCP Tools
|
|
91
|
+
|
|
92
|
+
### Memory Palace (5 tools)
|
|
93
|
+
|
|
94
|
+
| Tool | Purpose |
|
|
95
|
+
|------|---------|
|
|
96
|
+
| `palace_read` | Read a room or list all rooms in the Memory Palace |
|
|
97
|
+
| `palace_write` | Write memory with fan-out — auto-updates cross-references via `[[wikilinks]]` |
|
|
98
|
+
| `palace_walk` | Progressive cold-start: identity (~50 tok) → active (~200) → relevant (~500) → full (~2000) |
|
|
99
|
+
| `palace_lint` | Health check: stale, orphan, low-salience rooms. `fix=true` to auto-archive |
|
|
100
|
+
| `palace_search` | Search across all rooms, results ranked by salience score |
|
|
101
|
+
|
|
102
|
+
### Awareness & Insights (2 tools)
|
|
103
|
+
|
|
104
|
+
| Tool | Purpose |
|
|
105
|
+
|------|---------|
|
|
106
|
+
| `awareness_update` | Add insights to the compounding awareness system. Merges with existing, detects patterns |
|
|
107
|
+
| `recall_insight` | Before starting work, recall cross-project insights relevant to the current task |
|
|
89
108
|
|
|
90
109
|
### Session Memory (6 tools)
|
|
91
110
|
|
|
92
111
|
| Tool | Purpose |
|
|
93
112
|
|------|---------|
|
|
94
|
-
| `journal_read` | Read entry by date or "latest"
|
|
95
|
-
| `journal_write` | Write
|
|
96
|
-
| `journal_capture` | Lightweight L1 Q&A capture |
|
|
97
|
-
| `journal_list` | List recent entries |
|
|
98
|
-
| `journal_search` | Full-text search across history |
|
|
113
|
+
| `journal_read` | Read entry by date or "latest", with section filtering |
|
|
114
|
+
| `journal_write` | Write daily journal. Optional `palace_room` for palace integration |
|
|
115
|
+
| `journal_capture` | Lightweight L1 Q&A capture. Optional `palace_room` |
|
|
116
|
+
| `journal_list` | List recent journal entries |
|
|
117
|
+
| `journal_search` | Full-text search across history. `include_palace=true` for palace too |
|
|
99
118
|
| `journal_projects` | List all tracked projects |
|
|
100
119
|
|
|
101
|
-
###
|
|
120
|
+
### Architecture (3 tools)
|
|
102
121
|
|
|
103
122
|
| Tool | Purpose |
|
|
104
123
|
|------|---------|
|
|
105
|
-
| `journal_state` |
|
|
106
|
-
| `journal_cold_start` |
|
|
107
|
-
| `journal_archive` |
|
|
124
|
+
| `journal_state` | JSON state layer — structured read/write for agent-to-agent handoffs |
|
|
125
|
+
| `journal_cold_start` | Cache-aware cold start: HOT (0-1d) / WARM (2-7d) / COLD (7d+) |
|
|
126
|
+
| `journal_archive` | Archive old entries to cold storage with summaries |
|
|
108
127
|
|
|
109
|
-
###
|
|
128
|
+
### Knowledge (2 tools)
|
|
110
129
|
|
|
111
130
|
| Tool | Purpose |
|
|
112
131
|
|------|---------|
|
|
113
|
-
| `
|
|
114
|
-
| `
|
|
115
|
-
| `context_synthesize` | L3 synthesis: patterns, contradictions, goal evolution |
|
|
116
|
-
|
|
117
|
-
---
|
|
132
|
+
| `knowledge_write` | Write permanent lessons — dynamic categories, auto-creates palace rooms |
|
|
133
|
+
| `knowledge_read` | Read lessons by project, category, or search query |
|
|
118
134
|
|
|
119
|
-
|
|
135
|
+
### Alignment (3 tools)
|
|
120
136
|
|
|
121
|
-
|
|
137
|
+
| Tool | Purpose |
|
|
138
|
+
|------|---------|
|
|
139
|
+
| `alignment_check` | Record confidence + assumptions → human corrects BEFORE work starts |
|
|
140
|
+
| `nudge` | Detect contradiction between current and past input → surface before damage |
|
|
141
|
+
| `context_synthesize` | L3 synthesis. `consolidate=true` writes results into palace rooms |
|
|
122
142
|
|
|
123
|
-
|
|
124
|
-
ALIGNMENT CHECK:
|
|
125
|
-
- Goal: Build a REST API for user management
|
|
126
|
-
- Confidence: medium
|
|
127
|
-
- Assumptions: PostgreSQL, no auth yet, CRUD only
|
|
128
|
-
- Unclear: Should this include role-based access?
|
|
129
|
-
```
|
|
143
|
+
---
|
|
130
144
|
|
|
131
|
-
|
|
145
|
+
## Architecture
|
|
132
146
|
|
|
133
|
-
|
|
147
|
+
### Memory Palace
|
|
134
148
|
|
|
135
|
-
|
|
149
|
+
Inspired by the Method of Loci, Karpathy's LLM Wiki, and nashsu/llm_wiki.
|
|
136
150
|
|
|
137
151
|
```
|
|
138
|
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
152
|
+
~/.agent-recall/
|
|
153
|
+
awareness.md # 200-line compounding document (global)
|
|
154
|
+
awareness-state.json # Structured awareness data
|
|
155
|
+
insights-index.json # Cross-project insight matching
|
|
156
|
+
projects/
|
|
157
|
+
<project>/
|
|
158
|
+
journal/ # RAW SOURCES (immutable)
|
|
159
|
+
YYYY-MM-DD.md # Daily journal
|
|
160
|
+
YYYY-MM-DD-log.md # L1 captures
|
|
161
|
+
YYYY-MM-DD.state.json # JSON state
|
|
162
|
+
palace/ # MEMORY PALACE (mutable wiki)
|
|
163
|
+
identity.md # ~50 token project identity card
|
|
164
|
+
palace-index.json # Room catalog + salience scores
|
|
165
|
+
graph.json # Cross-reference edges
|
|
166
|
+
log.md # Operation audit trail
|
|
167
|
+
rooms/
|
|
168
|
+
goals/ # Active goals, evolution
|
|
169
|
+
architecture/ # Technical decisions, patterns
|
|
170
|
+
blockers/ # Current and resolved
|
|
171
|
+
alignment/ # Human corrections, misunderstandings
|
|
172
|
+
knowledge/ # Learned lessons by category
|
|
173
|
+
<custom>/ # Agents create rooms on demand
|
|
142
174
|
```
|
|
143
175
|
|
|
144
|
-
|
|
176
|
+
### Key Mechanisms
|
|
145
177
|
|
|
146
|
-
|
|
178
|
+
**Fan-out writes** — Write to one room, cross-references auto-update in related rooms via `[[wikilinks]]`. Mechanical, zero LLM cost.
|
|
147
179
|
|
|
148
|
-
|
|
180
|
+
**Salience scoring** — Every room has a salience score: `importance(0.4) + recency(0.3) + access_frequency(0.2) + connections(0.1)`. High-salience rooms surface first. Below threshold → auto-archive.
|
|
149
181
|
|
|
150
|
-
|
|
151
|
-
┌─────────────────────────────────────────────────────────┐
|
|
152
|
-
│ L1: Working Memory [per-turn, ~50 tok] "What happened"│
|
|
153
|
-
│ ↓ synthesized into │
|
|
154
|
-
│ L2: Episodic Memory [daily, ~800 tok] "What it means"│
|
|
155
|
-
│ ↓ synthesized into │
|
|
156
|
-
│ L3: Semantic Memory [cross-session] "What's true" │
|
|
157
|
-
│ (contradiction detection + goal evolution) │
|
|
158
|
-
├─────────────────────────────────────────────────────────┤
|
|
159
|
-
│ v3: JSON State Layer [per-session] Agent-to-agent data │
|
|
160
|
-
│ journal_state → .state.json alongside .md │
|
|
161
|
-
├─────────────────────────────────────────────────────────┤
|
|
162
|
-
│ v3: Cache Layer HOT (0-1d) → WARM (2-7d) → COLD │
|
|
163
|
-
│ journal_cold_start → loads 3 files, not 28 │
|
|
164
|
-
└─────────────────────────────────────────────────────────┘
|
|
165
|
-
```
|
|
182
|
+
**Compounding awareness** — `awareness.md` is capped at 200 lines. When new insights are added, similar existing ones merge (strengthen), dissimilar ones compete (lowest-confirmation gets replaced). The constraint creates compression. Compression creates compounding.
|
|
166
183
|
|
|
167
|
-
|
|
184
|
+
**Cross-project insight recall** — `insights-index.json` maps insights to situations via keywords. `recall_insight("building quality gates")` returns relevant lessons from any project, ranked by severity × confirmation count.
|
|
168
185
|
|
|
169
|
-
|
|
186
|
+
**Obsidian-compatible** — Every palace file has YAML frontmatter + `[[wikilinks]]`. Open `palace/` as an Obsidian vault → graph view shows room connections. Zero Obsidian dependency.
|
|
170
187
|
|
|
171
|
-
|
|
188
|
+
### Intelligent Distance Protocol
|
|
172
189
|
|
|
173
|
-
|
|
174
|
-
🧠 THINK → Was the approach right? Was research done?
|
|
175
|
-
⚡ EXECUTE → What happened vs planned? (COUNTS, not feelings)
|
|
176
|
-
🔍 REFLECT → 5-dimension quality score + Intelligent Distance gap
|
|
177
|
-
🔄 FEEDBACK → Loop (needs iteration) or Exit (quality sufficient)
|
|
178
|
-
```
|
|
190
|
+
The gap between human intent and agent understanding is structural — different cognitive origins, not a temporary technology problem. AgentRecall doesn't close this gap; it navigates it:
|
|
179
191
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
192
|
+
| Gap | Tool | How |
|
|
193
|
+
|-----|------|-----|
|
|
194
|
+
| Agent misunderstands intent | `alignment_check` | Records confidence + assumptions → human corrects before work |
|
|
195
|
+
| Agent contradicts prior decision | `nudge` | Surfaces contradiction → human clarifies |
|
|
196
|
+
| Agent forgets across sessions | `palace_walk` | Progressive loading from identity to full context |
|
|
197
|
+
| Agent repeats past mistakes | `recall_insight` | Cross-project insights surface before work starts |
|
|
198
|
+
| Agent's work quality is unclear | Think-Execute-Reflect | Counts, not feelings ("built 11 pages") |
|
|
184
199
|
|
|
185
200
|
---
|
|
186
201
|
|
|
187
202
|
## Supported Agents
|
|
188
203
|
|
|
189
|
-
| Agent |
|
|
190
|
-
|
|
191
|
-
| Claude Code | ✅ | ✅ |
|
|
192
|
-
| Cursor |
|
|
193
|
-
| VS Code Copilot |
|
|
194
|
-
| Windsurf |
|
|
195
|
-
| Claude Desktop |
|
|
196
|
-
| Any MCP agent |
|
|
197
|
-
| Any AI agent | — | — | ✅ (manual) |
|
|
204
|
+
| Agent | MCP | Skill | Notes |
|
|
205
|
+
|-------|:---:|:-----:|-------|
|
|
206
|
+
| Claude Code | ✅ | ✅ | Full support — MCP + SKILL.md |
|
|
207
|
+
| Cursor | ✅ | ⚡ | MCP via .cursor/mcp.json |
|
|
208
|
+
| VS Code (Copilot) | ✅ | — | MCP via .vscode/mcp.json |
|
|
209
|
+
| Windsurf | ✅ | ⚡ | MCP via mcp_config.json |
|
|
210
|
+
| Claude Desktop | ✅ | — | MCP server |
|
|
211
|
+
| Any MCP agent | ✅ | — | Standard MCP protocol |
|
|
198
212
|
|
|
199
213
|
---
|
|
200
214
|
|
|
201
|
-
##
|
|
215
|
+
## Design Philosophy
|
|
202
216
|
|
|
203
|
-
|
|
204
|
-
- Cold-start: **5 min → 2 seconds** (with v3 cache: loads 3 files not 28)
|
|
205
|
-
- Decision history: **0% → 100% retained** across sessions
|
|
206
|
-
- Misunderstanding caught before wrong work: **6+ instances** via alignment checks
|
|
207
|
-
- Quality loop caught **4 code review gaps** that would have shipped
|
|
208
|
-
- Failures section prevented **3 repeated mistakes** across agent handoffs
|
|
217
|
+
**Memory is not the goal. Understanding is.**
|
|
209
218
|
|
|
210
|
-
|
|
219
|
+
Most memory systems optimize for retrieval accuracy. AgentRecall optimizes for **alignment accuracy** — reducing the gap between what the human means and what the agent does.
|
|
211
220
|
|
|
212
|
-
|
|
221
|
+
**Compounding over accumulation.** A filing cabinet with better labels is still a filing cabinet. AgentRecall's awareness system forces merge-on-insert: every new insight either strengthens an existing one or replaces the weakest. After 100 sessions, `awareness.md` is still 200 lines — but each line carries the weight of confirmed, cross-validated observations.
|
|
213
222
|
|
|
214
|
-
|
|
223
|
+
**Cross-project by default.** Insights learned in one project apply everywhere. `recall_insight` doesn't care which project produced the lesson — it matches the current situation against the global index.
|
|
215
224
|
|
|
216
|
-
**
|
|
217
|
-
|
|
218
|
-
- Email: tongwu0824@gmail.com
|
|
219
|
-
- GitHub Issues: [NovadaLabs/AgentRecall](https://github.com/NovadaLabs/AgentRecall/issues)
|
|
220
|
-
|
|
221
|
-
1. **Use the protocol** for a week → [report](https://github.com/NovadaLabs/AgentRecall/issues)
|
|
222
|
-
2. **Implement it** in a new agent → PR welcome
|
|
223
|
-
3. **Improve the spec** → [protocol doc](docs/intelligent-distance-protocol.md)
|
|
225
|
+
**Agent-friendly, human-visible.** Everything is markdown on disk. Agents consume it via MCP tools. Humans browse it in Obsidian (or any text editor). Zero cloud, zero telemetry, zero lock-in.
|
|
224
226
|
|
|
225
227
|
---
|
|
226
228
|
|
|
227
|
-
##
|
|
228
|
-
|
|
229
|
-
MIT — *Concept & Design: [tongwu](https://github.com/Goldentrii)*
|
|
230
|
-
|
|
231
|
-
**Memory solves forgetting. AgentRecall solves misunderstanding.**
|
|
229
|
+
## Real Results
|
|
232
230
|
|
|
233
|
-
|
|
231
|
+
Validated over 30+ sessions across 5 production projects:
|
|
232
|
+
- Cold-start: **5 min → 2 seconds** (cache-aware loading)
|
|
233
|
+
- Decision retention: **0% → 100%** across sessions
|
|
234
|
+
- Misunderstanding caught before wrong work: **6+ instances** via alignment checks
|
|
235
|
+
- Repeated mistakes prevented: **3 instances** via cross-project insight recall
|
|
236
|
+
- All data local, all files markdown, all tools stateless
|
|
234
237
|
|
|
235
238
|
---
|
|
236
239
|
|
|
237
|
-
|
|
240
|
+
## Contributing
|
|
238
241
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
+
Built by [tongwu](https://github.com/Goldentrii).
|
|
242
243
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
- Issues & feedback: [GitHub Issues](https://github.com/Goldentrii/AgentRecall/issues)
|
|
245
|
+
- Email: tongwu0824@gmail.com
|
|
246
|
+
- Protocol spec: [docs/intelligent-distance-protocol.md](docs/intelligent-distance-protocol.md)
|
|
246
247
|
|
|
247
|
-
|
|
248
|
+
MIT License.
|
|
248
249
|
|
|
249
|
-
|
|
250
|
-
人类说:「全部点击」
|
|
251
|
-
AI 理解:「点击主要的」
|
|
252
|
-
差距:「全部」≠「主要的」
|
|
250
|
+
---
|
|
253
251
|
|
|
254
|
-
|
|
255
|
-
AI 认为:「差不多就行」
|
|
256
|
-
差距:「完全一样」≠「差不多」
|
|
252
|
+
---
|
|
257
253
|
|
|
258
|
-
|
|
259
|
-
AI 选择:一条指令,忽略其余
|
|
260
|
-
差距:点与点之间的逻辑关联丢失了
|
|
261
|
-
```
|
|
254
|
+
# AgentRecall(中文文档)
|
|
262
255
|
|
|
263
|
-
|
|
256
|
+
> 给你的 AI 智能体一个会成长的第二大脑。
|
|
264
257
|
|
|
265
258
|
---
|
|
266
259
|
|
|
267
|
-
## AgentRecall
|
|
260
|
+
## AgentRecall 是什么?
|
|
268
261
|
|
|
269
|
-
|
|
270
|
-
|-------------|-----------------|------|
|
|
271
|
-
| 智能体忘了人类昨天说的话 | `journal_read` + `journal_cold_start` | 三层记忆 + 缓存感知冷启动 |
|
|
272
|
-
| 智能体误解人类意图 | `alignment_check` | 记录置信度 + 假设 → 人类在工作开始前纠正 |
|
|
273
|
-
| 智能体与之前的决策矛盾 | `nudge` | 检测矛盾 → 在造成损失前提出 |
|
|
274
|
-
| 智能体说「完成了」但人类不同意 | Think-Execute-Reflect 循环 | 用数字评分(「建了 11 页 35 个标签」),不用感觉(「做得不错」)|
|
|
275
|
-
| 智能体凭想象构建,而非基于数据 | `journal_state` (JSON) | agent 间结构化交接 — 毫秒级,无需解析散文 |
|
|
276
|
-
| 智能体重复同样的错误 | 失败记录 + `context_synthesize` | 跨会话模式检测 → 提升为永久记忆 |
|
|
277
|
-
| 下一个 agent 从零开始 | `journal_cold_start` (v3) | 热/温/冷缓存 — 加载 3 个文件而非 28 个 |
|
|
262
|
+
AgentRecall 是一个 **MCP 服务器**(Model Context Protocol),为 AI 智能体提供持久化记忆、跨项目洞察召回和自复合感知系统。支持 Claude Code、Cursor、VS Code、Windsurf 及所有 MCP 兼容的智能体。
|
|
278
263
|
|
|
279
|
-
|
|
264
|
+
**不只是记忆系统。** 大多数智能体记忆工具只做存储和检索。AgentRecall 还能:
|
|
265
|
+
- **组织** — 知识按主题房间分类(记忆宫殿)
|
|
266
|
+
- **复合** — 洞察随时间合并增强,不是单纯累积
|
|
267
|
+
- **交叉引用** — 写入一个房间时自动更新相关房间
|
|
268
|
+
- **召回** — 开始任务前,自动呈现任何项目中的相关经验教训
|
|
269
|
+
- **检测误解** — 测量人类意图和智能体理解之间的差距
|
|
280
270
|
|
|
281
271
|
---
|
|
282
272
|
|
|
@@ -293,85 +283,153 @@ claude mcp add agent-recall -- npx -y agent-recall-mcp
|
|
|
293
283
|
{ "servers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } }
|
|
294
284
|
```
|
|
295
285
|
|
|
286
|
+
**Claude Code 技能安装:**
|
|
287
|
+
```bash
|
|
288
|
+
mkdir -p ~/.claude/skills/agent-recall
|
|
289
|
+
curl -o ~/.claude/skills/agent-recall/SKILL.md \
|
|
290
|
+
https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/SKILL.md
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## 智能体使用流程
|
|
296
|
+
|
|
297
|
+
### 会话开始
|
|
298
|
+
```
|
|
299
|
+
1. recall_insight(context="当前任务描述") → 跨项目相关洞察
|
|
300
|
+
2. palace_walk(depth="active") → 项目上下文 + 感知摘要
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### 工作中
|
|
304
|
+
```
|
|
305
|
+
3. alignment_check(goal="...", confidence="medium") → 大任务前确认理解
|
|
306
|
+
4. palace_write(room="architecture", content="...") → 永久知识 + 交叉引用
|
|
307
|
+
5. journal_capture(question="...", answer="...") → 轻量问答记录
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### 会话结束
|
|
311
|
+
```
|
|
312
|
+
6. journal_write(content="...", section="decisions") → 每日日志
|
|
313
|
+
7. awareness_update(insights=[...]) → 洞察复合到感知系统
|
|
314
|
+
8. context_synthesize(consolidate=true) → 日志内容提升到宫殿
|
|
315
|
+
```
|
|
316
|
+
|
|
296
317
|
---
|
|
297
318
|
|
|
298
|
-
##
|
|
319
|
+
## 21 个 MCP 工具
|
|
320
|
+
|
|
321
|
+
### 记忆宫殿(5 个)
|
|
322
|
+
|
|
323
|
+
| 工具 | 功能 |
|
|
324
|
+
|------|------|
|
|
325
|
+
| `palace_read` | 读取房间内容或列出所有房间 |
|
|
326
|
+
| `palace_write` | 写入记忆,自动通过 `[[wikilinks]]` 扇出交叉引用 |
|
|
327
|
+
| `palace_walk` | 渐进式冷启动:identity (~50 tok) → active (~200) → relevant (~500) → full (~2000) |
|
|
328
|
+
| `palace_lint` | 健康检查:过期、孤立、低显著性房间。`fix=true` 自动归档 |
|
|
329
|
+
| `palace_search` | 全房间搜索,按显著性评分排序 |
|
|
330
|
+
|
|
331
|
+
### 感知与洞察(2 个)
|
|
332
|
+
|
|
333
|
+
| 工具 | 功能 |
|
|
334
|
+
|------|------|
|
|
335
|
+
| `awareness_update` | 添加洞察到复合感知系统。自动合并相似洞察,检测跨洞察模式 |
|
|
336
|
+
| `recall_insight` | 开始任务前,召回跨项目的相关洞察 |
|
|
299
337
|
|
|
300
338
|
### 会话记忆(6 个)
|
|
301
339
|
|
|
302
340
|
| 工具 | 功能 |
|
|
303
341
|
|------|------|
|
|
304
342
|
| `journal_read` | 按日期读取日志,支持章节过滤 |
|
|
305
|
-
| `journal_write` |
|
|
343
|
+
| `journal_write` | 写入每日日志。可选 `palace_room` 同步到宫殿 |
|
|
306
344
|
| `journal_capture` | 轻量问答捕获 |
|
|
307
345
|
| `journal_list` | 列出最近日志 |
|
|
308
|
-
| `journal_search` |
|
|
346
|
+
| `journal_search` | 全文搜索。`include_palace=true` 同时搜索宫殿 |
|
|
309
347
|
| `journal_projects` | 列出所有项目 |
|
|
310
348
|
|
|
311
|
-
###
|
|
349
|
+
### 架构工具(3 个)
|
|
312
350
|
|
|
313
351
|
| 工具 | 功能 |
|
|
314
352
|
|------|------|
|
|
315
|
-
| `journal_state` |
|
|
316
|
-
| `journal_cold_start` |
|
|
317
|
-
| `journal_archive` |
|
|
353
|
+
| `journal_state` | JSON 状态层 — agent 间毫秒级结构化交接 |
|
|
354
|
+
| `journal_cold_start` | 缓存感知冷启动:热 (0-1天) / 温 (2-7天) / 冷 (7天+) |
|
|
355
|
+
| `journal_archive` | 归档旧条目到冷存储 |
|
|
318
356
|
|
|
319
|
-
###
|
|
357
|
+
### 知识工具(2 个)
|
|
320
358
|
|
|
321
359
|
| 工具 | 功能 |
|
|
322
360
|
|------|------|
|
|
323
|
-
| `
|
|
324
|
-
| `
|
|
325
|
-
|
|
361
|
+
| `knowledge_write` | 写入永久教训 — 动态类别,自动创建宫殿房间 |
|
|
362
|
+
| `knowledge_read` | 按项目、类别或搜索词读取教训 |
|
|
363
|
+
|
|
364
|
+
### 对齐工具(3 个)
|
|
365
|
+
|
|
366
|
+
| 工具 | 功能 |
|
|
367
|
+
|------|------|
|
|
368
|
+
| `alignment_check` | 记录置信度 + 假设 → 人类在工作前纠正 |
|
|
369
|
+
| `nudge` | 检测与过去决策的矛盾 → 在造成损失前提出 |
|
|
370
|
+
| `context_synthesize` | L3 合成。`consolidate=true` 将结果写入宫殿房间 |
|
|
326
371
|
|
|
327
372
|
---
|
|
328
373
|
|
|
329
|
-
##
|
|
374
|
+
## 架构
|
|
375
|
+
|
|
376
|
+
### 五层记忆模型
|
|
330
377
|
|
|
331
378
|
```
|
|
332
|
-
|
|
333
|
-
│
|
|
334
|
-
│
|
|
335
|
-
│
|
|
336
|
-
│
|
|
337
|
-
│
|
|
338
|
-
|
|
339
|
-
├─────────────────────────────────────────────────────────┤
|
|
340
|
-
│ v3: JSON 状态层 [每会话] agent 间结构化数据 │
|
|
341
|
-
├─────────────────────────────────────────────────────────┤
|
|
342
|
-
│ v3: 缓存层 热(0-1天)→ 温(2-7天)→ 冷(7天+) │
|
|
343
|
-
│ journal_cold_start → 加载 3 个文件而非 28 个 │
|
|
344
|
-
└─────────────────────────────────────────────────────────┘
|
|
379
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
380
|
+
│ L1: 工作记忆 journal_capture 「发生了什么」 │
|
|
381
|
+
│ L2: 情景记忆 journal_write 「这意味着什么」 │
|
|
382
|
+
│ L3: 记忆宫殿 palace_write / walk 「跨会话的知识」 │
|
|
383
|
+
│ L4: 感知系统 awareness_update 「复合的洞察」 │
|
|
384
|
+
│ L5: 洞察索引 recall_insight 「跨项目的经验」 │
|
|
385
|
+
└──────────────────────────────────────────────────────────────┘
|
|
345
386
|
```
|
|
346
387
|
|
|
347
|
-
|
|
388
|
+
### 核心机制
|
|
348
389
|
|
|
349
|
-
|
|
390
|
+
**扇出写入** — 写入一个房间,相关房间通过 `[[wikilinks]]` 自动更新交叉引用。机械式处理,零 LLM 成本。
|
|
350
391
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
392
|
+
**显著性评分** — 每个房间有显著性分数:`重要性(0.4) + 时效性(0.3) + 访问频率(0.2) + 连接数(0.1)`。高显著性房间优先展示,低于阈值自动归档。
|
|
393
|
+
|
|
394
|
+
**复合感知** — `awareness.md` 上限 200 行。新洞察加入时,相似的合并(增强),不相似的竞争(最低确认次数的被替换)。约束创造压缩,压缩创造复合。
|
|
395
|
+
|
|
396
|
+
**跨项目洞察召回** — `insights-index.json` 通过关键词将洞察映射到场景。`recall_insight("构建质量检查")` 返回来自任何项目的相关教训。
|
|
397
|
+
|
|
398
|
+
**Obsidian 兼容** — 每个宫殿文件都有 YAML frontmatter + `[[wikilinks]]`。将 `palace/` 作为 Obsidian vault 打开 → 图形视图展示房间连接。零 Obsidian 依赖。
|
|
357
399
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
400
|
+
### 智能距离协议
|
|
401
|
+
|
|
402
|
+
人类意图与智能体理解之间的差距是结构性的 — 源于不同的认知起源,不是临时的技术问题。
|
|
403
|
+
|
|
404
|
+
| 差距 | 工具 | 机制 |
|
|
405
|
+
|------|------|------|
|
|
406
|
+
| 智能体误解意图 | `alignment_check` | 记录置信度 + 假设 → 人类在工作前纠正 |
|
|
407
|
+
| 智能体与先前决策矛盾 | `nudge` | 发现矛盾 → 人类澄清 |
|
|
408
|
+
| 智能体跨会话遗忘 | `palace_walk` | 从身份到完整上下文的渐进式加载 |
|
|
409
|
+
| 智能体重复过去的错误 | `recall_insight` | 跨项目洞察在工作前自动呈现 |
|
|
362
410
|
|
|
363
411
|
---
|
|
364
412
|
|
|
365
|
-
##
|
|
413
|
+
## 设计理念
|
|
366
414
|
|
|
367
|
-
|
|
415
|
+
**记忆不是目的,理解才是。**
|
|
368
416
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
417
|
+
大多数记忆系统优化检索准确性。AgentRecall 优化**对齐准确性** — 缩小人类意图和智能体行为之间的差距。
|
|
418
|
+
|
|
419
|
+
**复合优于累积。** 贴了更好标签的文件柜还是文件柜。AgentRecall 的感知系统在插入时强制合并:每个新洞察要么增强已有的,要么替换最弱的。100 个会话后,`awareness.md` 仍是 200 行 — 但每一行承载着经过确认和交叉验证的观察。
|
|
420
|
+
|
|
421
|
+
**默认跨项目。** 在一个项目中学到的洞察适用于所有项目。`recall_insight` 不关心教训来自哪个项目 — 它匹配当前场景和全局索引。
|
|
422
|
+
|
|
423
|
+
**智能体友好,人类可见。** 一切都是磁盘上的 markdown。智能体通过 MCP 工具消费。人类在 Obsidian(或任何文本编辑器)中浏览。零云端、零遥测、零锁定。
|
|
372
424
|
|
|
373
425
|
---
|
|
374
426
|
|
|
375
|
-
##
|
|
427
|
+
## 贡献
|
|
428
|
+
|
|
429
|
+
由 [tongwu](https://github.com/Goldentrii) 构建。
|
|
430
|
+
|
|
431
|
+
- Issues & 反馈:[GitHub Issues](https://github.com/Goldentrii/AgentRecall/issues)
|
|
432
|
+
- 邮箱:tongwu0824@gmail.com
|
|
433
|
+
- 协议规范:[docs/intelligent-distance-protocol.md](docs/intelligent-distance-protocol.md)
|
|
376
434
|
|
|
377
|
-
MIT
|
|
435
|
+
MIT 许可证。
|