agent-recall-mcp 3.3.3 → 3.3.5

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.
Files changed (152) hide show
  1. package/README.md +489 -143
  2. package/dist/index.js +6 -13
  3. package/dist/index.js.map +1 -1
  4. package/dist/resources/journal-resources.d.ts.map +1 -1
  5. package/dist/resources/journal-resources.js +5 -29
  6. package/dist/resources/journal-resources.js.map +1 -1
  7. package/dist/server.js +1 -1
  8. package/dist/server.js.map +1 -1
  9. package/dist/tools/alignment-check.d.ts.map +1 -1
  10. package/dist/tools/alignment-check.js +3 -54
  11. package/dist/tools/alignment-check.js.map +1 -1
  12. package/dist/tools/awareness-update.d.ts +2 -8
  13. package/dist/tools/awareness-update.d.ts.map +1 -1
  14. package/dist/tools/awareness-update.js +3 -66
  15. package/dist/tools/awareness-update.js.map +1 -1
  16. package/dist/tools/context-synthesize.d.ts.map +1 -1
  17. package/dist/tools/context-synthesize.js +6 -187
  18. package/dist/tools/context-synthesize.js.map +1 -1
  19. package/dist/tools/journal-archive.d.ts.map +1 -1
  20. package/dist/tools/journal-archive.js +3 -48
  21. package/dist/tools/journal-archive.js.map +1 -1
  22. package/dist/tools/journal-capture.d.ts.map +1 -1
  23. package/dist/tools/journal-capture.js +3 -60
  24. package/dist/tools/journal-capture.js.map +1 -1
  25. package/dist/tools/journal-cold-start.d.ts.map +1 -1
  26. package/dist/tools/journal-cold-start.js +10 -52
  27. package/dist/tools/journal-cold-start.js.map +1 -1
  28. package/dist/tools/journal-list.d.ts.map +1 -1
  29. package/dist/tools/journal-list.js +3 -23
  30. package/dist/tools/journal-list.js.map +1 -1
  31. package/dist/tools/journal-projects.d.ts.map +1 -1
  32. package/dist/tools/journal-projects.js +3 -16
  33. package/dist/tools/journal-projects.js.map +1 -1
  34. package/dist/tools/journal-read.d.ts.map +1 -1
  35. package/dist/tools/journal-read.js +5 -45
  36. package/dist/tools/journal-read.js.map +1 -1
  37. package/dist/tools/journal-rollup.d.ts +3 -0
  38. package/dist/tools/journal-rollup.d.ts.map +1 -0
  39. package/dist/tools/journal-rollup.js +21 -0
  40. package/dist/tools/journal-rollup.js.map +1 -0
  41. package/dist/tools/journal-search.d.ts.map +1 -1
  42. package/dist/tools/journal-search.js +3 -91
  43. package/dist/tools/journal-search.js.map +1 -1
  44. package/dist/tools/journal-state.d.ts +0 -3
  45. package/dist/tools/journal-state.d.ts.map +1 -1
  46. package/dist/tools/journal-state.js +5 -93
  47. package/dist/tools/journal-state.js.map +1 -1
  48. package/dist/tools/journal-write.d.ts.map +1 -1
  49. package/dist/tools/journal-write.js +3 -62
  50. package/dist/tools/journal-write.js.map +1 -1
  51. package/dist/tools/knowledge-read.d.ts.map +1 -1
  52. package/dist/tools/knowledge-read.js +3 -100
  53. package/dist/tools/knowledge-read.js.map +1 -1
  54. package/dist/tools/knowledge-write.d.ts.map +1 -1
  55. package/dist/tools/knowledge-write.js +3 -66
  56. package/dist/tools/knowledge-write.js.map +1 -1
  57. package/dist/tools/nudge.d.ts.map +1 -1
  58. package/dist/tools/nudge.js +3 -25
  59. package/dist/tools/nudge.js.map +1 -1
  60. package/dist/tools/palace-lint.d.ts +2 -6
  61. package/dist/tools/palace-lint.d.ts.map +1 -1
  62. package/dist/tools/palace-lint.js +3 -135
  63. package/dist/tools/palace-lint.js.map +1 -1
  64. package/dist/tools/palace-read.d.ts +2 -5
  65. package/dist/tools/palace-read.d.ts.map +1 -1
  66. package/dist/tools/palace-read.js +5 -62
  67. package/dist/tools/palace-read.js.map +1 -1
  68. package/dist/tools/palace-search.d.ts +2 -5
  69. package/dist/tools/palace-search.d.ts.map +1 -1
  70. package/dist/tools/palace-search.js +3 -66
  71. package/dist/tools/palace-search.js.map +1 -1
  72. package/dist/tools/palace-walk.d.ts +2 -11
  73. package/dist/tools/palace-walk.d.ts.map +1 -1
  74. package/dist/tools/palace-walk.js +3 -149
  75. package/dist/tools/palace-walk.js.map +1 -1
  76. package/dist/tools/palace-write.d.ts +2 -5
  77. package/dist/tools/palace-write.d.ts.map +1 -1
  78. package/dist/tools/palace-write.js +3 -90
  79. package/dist/tools/palace-write.js.map +1 -1
  80. package/dist/tools/recall-insight.d.ts +2 -8
  81. package/dist/tools/recall-insight.d.ts.map +1 -1
  82. package/dist/tools/recall-insight.js +3 -35
  83. package/dist/tools/recall-insight.js.map +1 -1
  84. package/package.json +22 -29
  85. package/dist/helpers/journal-files.d.ts +0 -30
  86. package/dist/helpers/journal-files.d.ts.map +0 -1
  87. package/dist/helpers/journal-files.js +0 -96
  88. package/dist/helpers/journal-files.js.map +0 -1
  89. package/dist/helpers/sections.d.ts +0 -12
  90. package/dist/helpers/sections.d.ts.map +0 -1
  91. package/dist/helpers/sections.js +0 -84
  92. package/dist/helpers/sections.js.map +0 -1
  93. package/dist/palace/awareness.d.ts +0 -67
  94. package/dist/palace/awareness.d.ts.map +0 -1
  95. package/dist/palace/awareness.js +0 -231
  96. package/dist/palace/awareness.js.map +0 -1
  97. package/dist/palace/consolidate.d.ts +0 -28
  98. package/dist/palace/consolidate.d.ts.map +0 -1
  99. package/dist/palace/consolidate.js +0 -129
  100. package/dist/palace/consolidate.js.map +0 -1
  101. package/dist/palace/fan-out.d.ts +0 -15
  102. package/dist/palace/fan-out.d.ts.map +0 -1
  103. package/dist/palace/fan-out.js +0 -78
  104. package/dist/palace/fan-out.js.map +0 -1
  105. package/dist/palace/graph.d.ts +0 -11
  106. package/dist/palace/graph.d.ts.map +0 -1
  107. package/dist/palace/graph.js +0 -59
  108. package/dist/palace/graph.js.map +0 -1
  109. package/dist/palace/identity.d.ts +0 -6
  110. package/dist/palace/identity.d.ts.map +0 -1
  111. package/dist/palace/identity.js +0 -18
  112. package/dist/palace/identity.js.map +0 -1
  113. package/dist/palace/index-manager.d.ts +0 -7
  114. package/dist/palace/index-manager.d.ts.map +0 -1
  115. package/dist/palace/index-manager.js +0 -46
  116. package/dist/palace/index-manager.js.map +0 -1
  117. package/dist/palace/insights-index.d.ts +0 -39
  118. package/dist/palace/insights-index.d.ts.map +0 -1
  119. package/dist/palace/insights-index.js +0 -101
  120. package/dist/palace/insights-index.js.map +0 -1
  121. package/dist/palace/log.d.ts +0 -9
  122. package/dist/palace/log.d.ts.map +0 -1
  123. package/dist/palace/log.js +0 -28
  124. package/dist/palace/log.js.map +0 -1
  125. package/dist/palace/obsidian.d.ts +0 -12
  126. package/dist/palace/obsidian.d.ts.map +0 -1
  127. package/dist/palace/obsidian.js +0 -76
  128. package/dist/palace/obsidian.js.map +0 -1
  129. package/dist/palace/rooms.d.ts +0 -14
  130. package/dist/palace/rooms.d.ts.map +0 -1
  131. package/dist/palace/rooms.js +0 -117
  132. package/dist/palace/rooms.js.map +0 -1
  133. package/dist/palace/salience.d.ts +0 -15
  134. package/dist/palace/salience.d.ts.map +0 -1
  135. package/dist/palace/salience.js +0 -33
  136. package/dist/palace/salience.js.map +0 -1
  137. package/dist/storage/fs-utils.d.ts +0 -8
  138. package/dist/storage/fs-utils.d.ts.map +0 -1
  139. package/dist/storage/fs-utils.js +0 -28
  140. package/dist/storage/fs-utils.js.map +0 -1
  141. package/dist/storage/paths.d.ts +0 -21
  142. package/dist/storage/paths.d.ts.map +0 -1
  143. package/dist/storage/paths.js +0 -59
  144. package/dist/storage/paths.js.map +0 -1
  145. package/dist/storage/project.d.ts +0 -17
  146. package/dist/storage/project.d.ts.map +0 -1
  147. package/dist/storage/project.js +0 -130
  148. package/dist/storage/project.js.map +0 -1
  149. package/dist/types.d.ts +0 -112
  150. package/dist/types.d.ts.map +0 -1
  151. package/dist/types.js +0 -31
  152. package/dist/types.js.map +0 -1
package/README.md CHANGED
@@ -1,65 +1,99 @@
1
- <p align="center">
2
- <h1 align="center">AgentRecall</h1>
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
- </p>
1
+ <h1 align="center">AgentRecall</h1>
2
+
3
+ <p align="center"><strong>Persistent, compounding memory for AI agents. MCP server + SDK + CLI.</strong></p>
6
4
 
7
5
  <p align="center">
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>
6
+ <a href="https://www.npmjs.com/package/agent-recall-mcp"><img src="https://img.shields.io/npm/v/agent-recall-mcp?style=flat-square&label=MCP&color=5D34F2" alt="MCP npm"></a>
7
+ <a href="https://www.npmjs.com/package/agent-recall-sdk"><img src="https://img.shields.io/npm/v/agent-recall-sdk?style=flat-square&label=SDK&color=0EA5E9" alt="SDK npm"></a>
8
+ <a href="https://www.npmjs.com/package/agent-recall-cli"><img src="https://img.shields.io/npm/v/agent-recall-cli?style=flat-square&label=CLI&color=10B981" alt="CLI npm"></a>
9
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
- <img src="https://img.shields.io/badge/protocol-Intelligent_Distance-5B2D8E?style=flat-square" alt="Protocol">
10
+ <img src="https://img.shields.io/badge/MCP-22_tools-orange?style=flat-square" alt="Tools">
12
11
  <img src="https://img.shields.io/badge/cloud-zero-blue?style=flat-square" alt="Zero Cloud">
13
12
  <img src="https://img.shields.io/badge/Obsidian-compatible-7C3AED?style=flat-square" alt="Obsidian">
14
13
  </p>
15
14
 
15
+ <p align="center">
16
+ <b>EN:</b>&nbsp;
17
+ <a href="#why-choose-agentrecall">Why</a> ·
18
+ <a href="#three-ways-to-use-it">Use</a> ·
19
+ <a href="#what-is-agentrecall">What</a> ·
20
+ <a href="#quick-start">Install</a> ·
21
+ <a href="#22-mcp-tools">Tools</a> ·
22
+ <a href="#sdk-api">SDK</a> ·
23
+ <a href="#cli-commands">CLI</a> ·
24
+ <a href="#architecture">Architecture</a> ·
25
+ <a href="#docs">Docs</a>
26
+ &nbsp;&nbsp;|&nbsp;&nbsp;
27
+ <b>中文:</b>&nbsp;
28
+ <a href="#agentrecall中文文档">简介</a> ·
29
+ <a href="#快速开始">安装</a> ·
30
+ <a href="#22-个-mcp-工具">工具</a> ·
31
+ <a href="#sdk-api-1">SDK</a> ·
32
+ <a href="#cli-命令">CLI</a> ·
33
+ <a href="#架构">架构</a>
34
+ </p>
35
+
16
36
  ---
17
37
 
18
- ## `/arsave` Save Everything in One Shot
38
+ ## Why Choose AgentRecall
19
39
 
20
- > **Two commands. That's all you need.**
40
+ **Your agents forget everything between sessions.** Decisions evaporate. Mistakes repeat. Context rebuilds from scratch every time. AgentRecall fixes this with persistent memory that compounds — getting smarter, not bigger.
21
41
 
22
- | Command | When | What it does |
23
- |---------|------|-------------|
24
- | **`/arsave`** | End of session | Write journal + consolidate to palace + update awareness + optional git push |
25
- | **`/arstart`** | Start of session | Recall cross-project insights + walk palace + load context |
42
+ - **Near-universal compatibility.** MCP server for any MCP-compatible agent (Claude Code, Cursor, Windsurf, VS Code, Codex). SDK for any JS/TS framework (LangChain, CrewAI, Vercel AI SDK, custom agents). CLI for terminal and CI workflows. One memory system, every surface.
43
+
44
+ - **Compounding awareness, not infinite logs.** Memory is capped at 200 lines. New insights either merge with existing ones (strengthening them) or replace the weakest. After 100 sessions, your awareness file is still 200 lines — but each line carries the weight of cross-validated, confirmed observations.
26
45
 
27
- Type `/arsave` after a long project session. Everything gets saved. Type `/arstart` next time. Everything loads back.
46
+ - **Cross-project recall.** Lessons learned in one project apply everywhere. Built a rate limiter last month? That lesson surfaces when you're building one today — in a different repo, through a different agent.
28
47
 
48
+ - **Zero cloud, zero telemetry, all local.** Everything is markdown on disk. Browse it in Obsidian, grep it in the terminal, version it in git. No accounts, no API keys, no lock-in.
49
+
50
+ ---
51
+
52
+ ## Three Ways to Use It
53
+
54
+ **MCP** — for AI agents (Claude Code, Cursor, Windsurf, VS Code, Codex):
29
55
  ```bash
30
- # Install commands (one-time)
31
- mkdir -p ~/.claude/commands
32
- curl -o ~/.claude/commands/arsave.md https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/commands/arsave.md
33
- curl -o ~/.claude/commands/arstart.md https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/commands/arstart.md
56
+ claude mcp add agent-recall -- npx -y agent-recall-mcp
57
+ ```
58
+
59
+ **SDK** for any JS/TS application (LangChain, CrewAI, Vercel AI SDK, custom):
60
+ ```typescript
61
+ import { AgentRecall } from "agent-recall-sdk";
62
+ const memory = new AgentRecall({ project: "my-app" });
63
+ await memory.capture("What stack?", "Next.js + Postgres");
64
+ ```
65
+
66
+ **CLI** — for terminal workflows and CI:
67
+ ```bash
68
+ npx agent-recall-cli capture "What stack?" "Next.js + Postgres"
69
+ npx agent-recall-cli palace walk --depth active
34
70
  ```
35
71
 
36
72
  ---
37
73
 
38
74
  ## What Is AgentRecall?
39
75
 
40
- 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.
76
+ A **persistent memory system** that gives AI agents **compounding awareness** across sessions. Not a log. Not a database. A second brain that gets smarter the more you use it.
41
77
 
42
- **Not just a memory system.** Most agent memory tools store and retrieve. AgentRecall also:
43
- - **Organizes** knowledge into themed rooms (Memory Palace)
44
- - **Compounds** — insights merge and strengthen over time, not just accumulate
45
- - **Cross-references** — writing to one room auto-updates related rooms
46
- - **Recalls** — before starting a task, surfaces relevant lessons from any project
47
- - **Detects misunderstanding** — measures the gap between human intent and agent interpretation
78
+ **The problem:** AI agents start from zero every session. They forget your decisions, repeat your mistakes, lose context mid-project, and misunderstand you the same way twice.
48
79
 
49
- ```
50
- ┌──────────────────────────────────────────────────────────────┐
51
- │ Layer 1: Quick Capture journal_capture │
52
- │ Layer 2: Daily Journal journal_write / journal_read │
53
- │ Layer 3: Memory Palace palace_write / palace_walk │
54
- │ Layer 4: Awareness awareness_update (compounding) │
55
- │ Layer 5: Insight Index recall_insight (cross-project)
56
- └──────────────────────────────────────────────────────────────┘
57
- ```
80
+ **The fix:** AgentRecall stores knowledge in a five-layer memory pyramid — from quick captures to cross-project insights — and forces compression so memory gets more valuable over time, not more bloated.
81
+
82
+ | Without AgentRecall | With AgentRecall |
83
+ |---------------------|------------------|
84
+ | Agent forgets yesterday's decisions | Decisions live in palace rooms, loaded on cold start |
85
+ | Same mistake repeated across sessions | `recall_insight` surfaces past lessons before work starts |
86
+ | 5 min context recovery on each session start | 2 second cold start from palace (~200 tokens) |
87
+ | Flat memory files that grow forever | 200-line awareness cap forces merge-or-replace |
88
+ | Knowledge trapped in one project | Cross-project insights match by keyword |
89
+ | Agent misunderstands, you correct, it forgets | `alignment_check` records corrections permanently |
58
90
 
59
91
  ---
60
92
 
61
93
  ## Quick Start
62
94
 
95
+ ### MCP Server (for AI agents)
96
+
63
97
  ```bash
64
98
  # Claude Code
65
99
  claude mcp add agent-recall -- npx -y agent-recall-mcp
@@ -73,7 +107,7 @@ claude mcp add agent-recall -- npx -y agent-recall-mcp
73
107
  # Windsurf — ~/.codeium/windsurf/mcp_config.json
74
108
  { "mcpServers": { "agent-recall": { "command": "npx", "args": ["-y", "agent-recall-mcp"] } } }
75
109
 
76
- # Codex — ~/.codex/config.toml (or .codex/config.toml for project-scoped)
110
+ # Codex
77
111
  codex mcp add agent-recall -- npx -y agent-recall-mcp
78
112
  ```
79
113
 
@@ -84,6 +118,81 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
84
118
  https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/SKILL.md
85
119
  ```
86
120
 
121
+ ### SDK (for JS/TS applications)
122
+
123
+ ```bash
124
+ npm install agent-recall-sdk
125
+ ```
126
+
127
+ ```typescript
128
+ import { AgentRecall } from "agent-recall-sdk";
129
+
130
+ const memory = new AgentRecall({ project: "my-app" });
131
+
132
+ // Capture knowledge
133
+ await memory.capture("What ORM?", "Drizzle — type-safe, lightweight");
134
+
135
+ // Write to memory palace
136
+ await memory.palaceWrite("architecture", "Stack: Next.js 16 + Drizzle + Postgres");
137
+
138
+ // Cold start — load project context in ~200 tokens
139
+ const context = await memory.coldStart();
140
+
141
+ // Recall cross-project insights
142
+ const insights = await memory.recallInsight("rate limiting");
143
+
144
+ // Walk the palace at different depths
145
+ const walk = await memory.walk("active");
146
+ ```
147
+
148
+ ### CLI (for terminal and CI)
149
+
150
+ ```bash
151
+ npm install -g agent-recall-cli
152
+ # or use npx: npx agent-recall-cli <command>
153
+ ```
154
+
155
+ ```bash
156
+ # Capture a Q&A pair
157
+ ar capture "What ORM?" "Drizzle" --project my-app
158
+
159
+ # Read today's journal
160
+ ar read --date latest
161
+
162
+ # Walk the memory palace
163
+ ar palace walk --depth active
164
+
165
+ # Search across all memory
166
+ ar search "rate limiting" --include-palace
167
+
168
+ # Recall cross-project insights
169
+ ar insight "building auth middleware"
170
+
171
+ # Write to a palace room
172
+ ar palace write architecture "Switched from REST to tRPC"
173
+
174
+ # Compact old journals into weekly summaries
175
+ ar rollup --min-age-days 14
176
+ ```
177
+
178
+ ---
179
+
180
+ ## `/arsave` and `/arstart`
181
+
182
+ > **Two commands. That's all you need for session management.**
183
+
184
+ | Command | When | What it does |
185
+ |---------|------|-------------|
186
+ | **`/arsave`** | End of session | Write journal + consolidate to palace + update awareness + optional git push |
187
+ | **`/arstart`** | Start of session | Recall cross-project insights + walk palace + load context |
188
+
189
+ ```bash
190
+ # Install commands (one-time, Claude Code only)
191
+ mkdir -p ~/.claude/commands
192
+ curl -o ~/.claude/commands/arsave.md https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/commands/arsave.md
193
+ curl -o ~/.claude/commands/arstart.md https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/commands/arstart.md
194
+ ```
195
+
87
196
  ---
88
197
 
89
198
  ## How an Agent Uses AgentRecall
@@ -110,7 +219,7 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
110
219
 
111
220
  ---
112
221
 
113
- ## 21 MCP Tools
222
+ ## 22 MCP Tools
114
223
 
115
224
  ### Memory Palace (5 tools)
116
225
 
@@ -140,13 +249,14 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
140
249
  | `journal_search` | Full-text search across history. `include_palace=true` for palace too |
141
250
  | `journal_projects` | List all tracked projects |
142
251
 
143
- ### Architecture (3 tools)
252
+ ### Architecture (4 tools)
144
253
 
145
254
  | Tool | Purpose |
146
255
  |------|---------|
147
256
  | `journal_state` | JSON state layer — structured read/write for agent-to-agent handoffs |
148
- | `journal_cold_start` | Cache-aware cold start: HOT (0-1d) / WARM (2-7d) / COLD (7d+) |
257
+ | `journal_cold_start` | Palace-first cold start: loads identity + awareness + top rooms (~200 tok), then HOT journals only |
149
258
  | `journal_archive` | Archive old entries to cold storage with summaries |
259
+ | `journal_rollup` | Condense old daily journals into weekly summaries. Prevents accumulation. `dry_run=true` to preview |
150
260
 
151
261
  ### Knowledge (2 tools)
152
262
 
@@ -165,88 +275,190 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
165
275
 
166
276
  ---
167
277
 
168
- ## Architecture
278
+ ## SDK API
169
279
 
170
- ### Memory Palace
280
+ The `agent-recall-sdk` package exposes the `AgentRecall` class — a programmatic interface to the full memory system. Use it to add persistent, compounding memory to any JS/TS agent framework: LangChain, CrewAI, Vercel AI SDK, AutoGen, or your own.
171
281
 
172
- Inspired by the Method of Loci, Karpathy's LLM Wiki, and nashsu/llm_wiki.
282
+ ```typescript
283
+ import { AgentRecall } from "agent-recall-sdk";
173
284
 
174
- ```
175
- ~/.agent-recall/
176
- awareness.md # 200-line compounding document (global)
177
- awareness-state.json # Structured awareness data
178
- insights-index.json # Cross-project insight matching
179
- projects/
180
- <project>/
181
- journal/ # RAW SOURCES (immutable)
182
- YYYY-MM-DD.md # Daily journal
183
- YYYY-MM-DD-log.md # L1 captures
184
- YYYY-MM-DD.state.json # JSON state
185
- palace/ # MEMORY PALACE (mutable wiki)
186
- identity.md # ~50 token project identity card
187
- palace-index.json # Room catalog + salience scores
188
- graph.json # Cross-reference edges
189
- log.md # Operation audit trail
190
- rooms/
191
- goals/ # Active goals, evolution
192
- architecture/ # Technical decisions, patterns
193
- blockers/ # Current and resolved
194
- alignment/ # Human corrections, misunderstandings
195
- knowledge/ # Learned lessons by category
196
- <custom>/ # Agents create rooms on demand
285
+ const ar = new AgentRecall({ project: "my-project" });
197
286
  ```
198
287
 
199
- ### Key Mechanisms
288
+ ### Core Methods
200
289
 
201
- **Fan-out writes** Write to one room, cross-references auto-update in related rooms via `[[wikilinks]]`. Mechanical, zero LLM cost.
290
+ | Method | Returns | Description |
291
+ |--------|---------|-------------|
292
+ | `capture(question, answer, opts?)` | `JournalCaptureResult` | Quick Q&A capture (L1 memory) |
293
+ | `journalWrite(content, opts?)` | `JournalWriteResult` | Write daily journal entry |
294
+ | `journalRead(opts?)` | `JournalReadResult` | Read journal by date or "latest" |
295
+ | `journalSearch(query, opts?)` | `JournalSearchResult` | Full-text search across journals |
296
+ | `coldStart()` | `JournalColdStartResult` | Palace-first context loading (~200 tokens) |
202
297
 
203
- **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.
298
+ ### Palace Methods
204
299
 
205
- **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.
300
+ | Method | Returns | Description |
301
+ |--------|---------|-------------|
302
+ | `palaceWrite(room, content, opts?)` | `PalaceWriteResult` | Write to a room with fan-out cross-refs |
303
+ | `palaceRead(room?, topic?)` | `PalaceReadResult` | Read room content or list all rooms |
304
+ | `walk(depth?, focus?)` | `PalaceWalkResult` | Progressive walk: identity → active → relevant → full |
305
+ | `palaceSearch(query, room?)` | `PalaceSearchResult` | Search rooms by content |
306
+ | `lint(fix?)` | `PalaceLintResult` | Health check and auto-archive |
206
307
 
207
- **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.
308
+ ### Awareness & Insight Methods
208
309
 
209
- **Obsidian-compatible** Every palace file has YAML frontmatter + `[[wikilinks]]`. Open `palace/` as an Obsidian vault → graph view shows room connections. Zero Obsidian dependency.
310
+ | Method | Returns | Description |
311
+ |--------|---------|-------------|
312
+ | `awarenessUpdate(insights, opts?)` | `AwarenessUpdateResult` | Compound new insights into awareness |
313
+ | `readAwareness()` | `string` | Read the 200-line awareness document |
314
+ | `recallInsight(context, opts?)` | `RecallInsightResult` | Cross-project insight recall |
315
+
316
+ ### Alignment Methods
210
317
 
211
- ### Intelligent Distance Protocol
318
+ | Method | Returns | Description |
319
+ |--------|---------|-------------|
320
+ | `alignmentCheck(input)` | `AlignmentCheckResult` | Record confidence + assumptions |
321
+ | `nudge(input)` | `NudgeResult` | Detect contradictions with past decisions |
322
+ | `synthesize(opts?)` | `ContextSynthesizeResult` | L3 synthesis, optional palace consolidation |
212
323
 
213
- 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:
324
+ ### LangChain / CrewAI Integration Example
214
325
 
215
- | Gap | Tool | How |
216
- |-----|------|-----|
217
- | Agent misunderstands intent | `alignment_check` | Records confidence + assumptions → human corrects before work |
218
- | Agent contradicts prior decision | `nudge` | Surfaces contradiction → human clarifies |
219
- | Agent forgets across sessions | `palace_walk` | Progressive loading from identity to full context |
220
- | Agent repeats past mistakes | `recall_insight` | Cross-project insights surface before work starts |
221
- | Agent's work quality is unclear | Think-Execute-Reflect | Counts, not feelings ("built 11 pages") |
326
+ ```typescript
327
+ import { AgentRecall } from "agent-recall-sdk";
328
+
329
+ const memory = new AgentRecall({ project: "langchain-app" });
330
+
331
+ // Before agent runs load context
332
+ const context = await memory.coldStart();
333
+ const insights = await memory.recallInsight("current task description");
334
+
335
+ // Inject into system prompt
336
+ const systemPrompt = `You have persistent memory:\n${context.summary}\n\nRelevant insights:\n${insights.matches.map(m => m.insight).join("\n")}`;
337
+
338
+ // After agent runs — save what was learned
339
+ await memory.capture("What did the agent decide?", agentOutput);
340
+ await memory.awarenessUpdate([{
341
+ insight: "Rate limiting needs token bucket, not fixed window",
342
+ evidence: "Fixed window caused burst failures in load test",
343
+ applies_when: ["rate-limiting", "api-design", "load-testing"]
344
+ }]);
345
+ ```
222
346
 
223
347
  ---
224
348
 
225
- ## Supported Agents
349
+ ## CLI Commands
226
350
 
227
- | Agent | MCP | Skill | Notes |
228
- |-------|:---:|:-----:|-------|
229
- | Claude Code | ✅ | ✅ | Full support — MCP + SKILL.md |
230
- | OpenAI Codex | ✅ | | `codex mcp add` — config.toml |
231
- | Cursor | ✅ | ⚡ | MCP via .cursor/mcp.json |
232
- | VS Code (Copilot) | ✅ | — | MCP via .vscode/mcp.json |
233
- | Windsurf | | ⚡ | MCP via mcp_config.json |
234
- | Claude Desktop | ✅ | — | MCP server |
235
- | Any MCP agent | ✅ | — | Standard MCP protocol |
351
+ The `agent-recall-cli` package provides the `ar` command for terminal workflows, CI pipelines, and quick access to your agent's memory outside of an editor.
352
+
353
+ ```
354
+ ar v3.3.4AgentRecall CLI
355
+
356
+ JOURNAL:
357
+ ar read [--date YYYY-MM-DD] [--section <name>]
358
+ ar write <content> [--section <name>]
359
+ ar capture <question> <answer> [--tags tag1,tag2]
360
+ ar list [--limit N]
361
+ ar search <query> [--include-palace]
362
+ ar state read|write [data]
363
+ ar cold-start
364
+ ar archive [--older-than-days N]
365
+ ar rollup [--min-age-days N] [--dry-run]
366
+
367
+ PALACE:
368
+ ar palace read [<room>] [--topic <name>]
369
+ ar palace write <room> <content> [--importance high|medium|low]
370
+ ar palace walk [--depth identity|active|relevant|full]
371
+ ar palace search <query>
372
+ ar palace lint [--fix]
373
+
374
+ AWARENESS:
375
+ ar awareness read
376
+ ar awareness update --insight "title" --evidence "ev" --applies-when kw1,kw2
377
+
378
+ INSIGHT:
379
+ ar insight <context> [--limit N]
380
+
381
+ META:
382
+ ar projects
383
+ ar synthesize [--entries N]
384
+ ar knowledge write --category <cat> --title "t" --what "w" --cause "c" --fix "f"
385
+ ar knowledge read [--category <cat>]
386
+
387
+ GLOBAL FLAGS:
388
+ --root <path> Storage root (default: ~/.agent-recall)
389
+ --project <slug> Project override
390
+ ```
236
391
 
237
392
  ---
238
393
 
239
- ## Design Philosophy
394
+ ## Architecture
395
+
396
+ ### Five-Layer Memory Pyramid
397
+
398
+ ```
399
+ L1: Working Memory journal_capture "what happened"
400
+ L2: Episodic Memory journal_write "what it means"
401
+ L3: Memory Palace palace_write / walk "knowledge across sessions"
402
+ L4: Awareness awareness_update "compounding insights"
403
+ L5: Insight Index recall_insight "cross-project experience"
404
+ ```
405
+
406
+ ### Key Mechanisms
407
+
408
+ **Fan-out writes** — Write to one room, cross-references auto-update in related rooms via `[[wikilinks]]`. Mechanical, zero LLM cost.
409
+
410
+ **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.
240
411
 
241
- **Memory is not the goal. Understanding is.**
412
+ **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.
242
413
 
243
- 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.
414
+ **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 x confirmation count.
244
415
 
245
- **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.
416
+ **Obsidian-compatible** Every palace file has YAML frontmatter + `[[wikilinks]]`. Open `palace/` as an Obsidian vault graph view shows room connections. Zero Obsidian dependency.
246
417
 
247
- **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.
418
+ ### Storage Layout
248
419
 
249
- **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.
420
+ ```
421
+ ~/.agent-recall/
422
+ awareness.md # 200-line compounding document (global)
423
+ awareness-state.json # Structured awareness data
424
+ insights-index.json # Cross-project insight matching
425
+ projects/
426
+ <project>/
427
+ journal/
428
+ YYYY-MM-DD.md # Daily journal
429
+ YYYY-MM-DD-log.md # L1 captures
430
+ YYYY-MM-DD.state.json # JSON state
431
+ palace/
432
+ identity.md # ~50 token project identity card
433
+ palace-index.json # Room catalog + salience scores
434
+ graph.json # Cross-reference edges
435
+ rooms/
436
+ goals/ # Active goals, evolution
437
+ architecture/ # Technical decisions, patterns
438
+ blockers/ # Current and resolved
439
+ alignment/ # Human corrections
440
+ knowledge/ # Learned lessons by category
441
+ <custom>/ # Agents create rooms on demand
442
+ ```
443
+
444
+ ---
445
+
446
+ ## Platform Compatibility
447
+
448
+ | Platform | MCP | SDK | CLI | Notes |
449
+ |----------|:---:|:---:|:---:|-------|
450
+ | Claude Code | ✅ | ✅ | ✅ | Full support — MCP + SKILL.md + commands |
451
+ | Cursor | ✅ | ✅ | ✅ | MCP via .cursor/mcp.json |
452
+ | VS Code (Copilot) | ✅ | ✅ | ✅ | MCP via .vscode/mcp.json |
453
+ | Windsurf | ✅ | ✅ | ✅ | MCP via mcp_config.json |
454
+ | OpenAI Codex | ✅ | ✅ | ✅ | `codex mcp add` — config.toml |
455
+ | Claude Desktop | ✅ | — | — | MCP server |
456
+ | LangChain / LangGraph | — | ✅ | — | `new AgentRecall()` in your chain |
457
+ | CrewAI | — | ✅ | — | SDK in tool definitions |
458
+ | Vercel AI SDK | — | ✅ | — | SDK in server actions |
459
+ | Custom JS/TS agents | — | ✅ | ✅ | SDK + CLI for any agent framework |
460
+ | CI / GitHub Actions | — | — | ✅ | `npx agent-recall-cli` in workflows |
461
+ | Any MCP agent | ✅ | — | — | Standard MCP protocol |
250
462
 
251
463
  ---
252
464
 
@@ -261,13 +473,24 @@ Validated over 30+ sessions across 5 production projects:
261
473
 
262
474
  ---
263
475
 
476
+ ## Docs
477
+
478
+ | Document | Description |
479
+ |----------|-------------|
480
+ | [Intelligent Distance Protocol](docs/intelligent-distance-protocol.md) | The foundational theory — why the gap between human and AI is structural, and how to navigate it |
481
+ | [MCP Adapter Spec](docs/mcp-adapter-spec.md) | Technical spec for building adapters on top of AgentRecall |
482
+ | [SDK Design](docs/sdk-design.md) | Design doc for the SDK architecture |
483
+ | [Upgrade v3.4](UPGRADE-v3.4.md) | Changelog: weekly roll-up, palace-first cold start, promotion verification |
484
+
485
+ ---
486
+
264
487
  ## Contributing
265
488
 
266
- Built by [tongwu](https://github.com/Goldentrii).
489
+ Built by [tongwu](https://github.com/Goldentrii) at [Novada](https://www.novada.com).
267
490
 
268
491
  - Issues & feedback: [GitHub Issues](https://github.com/Goldentrii/AgentRecall/issues)
269
- - Email: tongwu0824@gmail.com
270
- - Protocol spec: [docs/intelligent-distance-protocol.md](https://github.com/Goldentrii/AgentRecall/blob/main/docs/intelligent-distance-protocol.md)
492
+ - Email: [tong.wu@novada.com](mailto:tong.wu@novada.com)
493
+ - Website: [novada.com](https://www.novada.com)
271
494
 
272
495
  MIT License.
273
496
 
@@ -277,25 +500,68 @@ MIT License.
277
500
 
278
501
  # AgentRecall(中文文档)
279
502
 
280
- > 给你的 AI 智能体一个会成长的第二大脑。
503
+ > **你的 AI 智能体每次对话都从零开始。AgentRecall 解决这个问题。**
504
+
505
+ ---
506
+
507
+ ## 为什么选择 AgentRecall
508
+
509
+ **你的智能体在会话之间遗忘一切。** 决策蒸发,错误重复,上下文每次从零构建。AgentRecall 用持久记忆修复这个问题 — 记忆会复合增长,而不是无限膨胀。
510
+
511
+ - **近乎通用的兼容性。** MCP 服务器支持所有 MCP 兼容智能体(Claude Code、Cursor、Windsurf、VS Code、Codex)。SDK 支持任何 JS/TS 框架(LangChain、CrewAI、Vercel AI SDK、自定义智能体)。CLI 支持终端和 CI 工作流。一套记忆系统,覆盖所有场景。
512
+
513
+ - **复合感知,而非无限日志。** 记忆上限 200 行。新洞察要么与已有的合并(增强),要么替换最弱的。100 个会话后,感知文件仍然是 200 行 — 但每一行都承载着经过交叉验证的确认观察。
514
+
515
+ - **跨项目召回。** 在一个项目中学到的教训适用于所有项目。上个月做了限流器?今天在另一个项目构建时,那个教训会自动浮现。
516
+
517
+ - **零云端,零遥测,全部本地。** 一切都是磁盘上的 markdown。在 Obsidian 中浏览,在终端中 grep,在 git 中版本管理。无需账户、API 密钥或锁定。
518
+
519
+ ---
520
+
521
+ ## 三种使用方式
522
+
523
+ **MCP** — 面向 AI 智能体(Claude Code、Cursor、Windsurf、VS Code、Codex):
524
+ ```bash
525
+ claude mcp add agent-recall -- npx -y agent-recall-mcp
526
+ ```
527
+
528
+ **SDK** — 面向任何 JS/TS 应用(LangChain、CrewAI、Vercel AI SDK、自定义):
529
+ ```typescript
530
+ import { AgentRecall } from "agent-recall-sdk";
531
+ const memory = new AgentRecall({ project: "my-app" });
532
+ await memory.capture("用什么技术栈?", "Next.js + Postgres");
533
+ ```
534
+
535
+ **CLI** — 面向终端工作流和 CI:
536
+ ```bash
537
+ npx agent-recall-cli capture "用什么技术栈?" "Next.js + Postgres"
538
+ npx agent-recall-cli palace walk --depth active
539
+ ```
281
540
 
282
541
  ---
283
542
 
284
543
  ## AgentRecall 是什么?
285
544
 
286
- AgentRecall 是一个 **MCP 服务器**(Model Context Protocol),为 AI 智能体提供持久化记忆、跨项目洞察召回和自复合感知系统。支持 Claude Code、Cursor、VS Code、Windsurf 及所有 MCP 兼容的智能体。
545
+ 一个**持久记忆系统**,让 AI 智能体拥有**跨会话复合感知**。不是日志,不是数据库——是一个用得越多越聪明的第二大脑。
287
546
 
288
- **不只是记忆系统。** 大多数智能体记忆工具只做存储和检索。AgentRecall 还能:
289
- - **组织** — 知识按主题房间分类(记忆宫殿)
290
- - **复合** — 洞察随时间合并增强,不是单纯累积
291
- - **交叉引用** — 写入一个房间时自动更新相关房间
292
- - **召回** 开始任务前,自动呈现任何项目中的相关经验教训
293
- - **检测误解** — 测量人类意图和智能体理解之间的差距
547
+ **问题:** AI 智能体每次会话都是全新开始。忘记你的决策,重复同样的错误,丢失项目上下文,以同样的方式误解你。
548
+
549
+ **解决方案:** AgentRecall 将知识存储在五层记忆金字塔中——从快速捕获到跨项目洞察——并通过强制压缩让记忆随时间增值,而不是膨胀。
550
+
551
+ | 没有 AgentRecall | 有 AgentRecall |
552
+ |-----------------|---------------|
553
+ | 智能体忘记昨天的决策 | 决策存在宫殿房间,冷启动时加载 |
554
+ | 跨会话重复同样的错误 | `recall_insight` 工作前自动呈现过去教训 |
555
+ | 每次开始需要 5 分钟恢复上下文 | 2 秒冷启动,从宫殿加载(~200 token) |
556
+ | 平面记忆文件无限增长 | 200 行感知上限,强制合并或替换 |
557
+ | 知识锁在单个项目 | 跨项目洞察按关键词匹配 |
294
558
 
295
559
  ---
296
560
 
297
561
  ## 快速开始
298
562
 
563
+ ### MCP 服务器(面向 AI 智能体)
564
+
299
565
  ```bash
300
566
  # Claude Code
301
567
  claude mcp add agent-recall -- npx -y agent-recall-mcp
@@ -317,6 +583,31 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
317
583
  https://raw.githubusercontent.com/Goldentrii/AgentRecall/main/SKILL.md
318
584
  ```
319
585
 
586
+ ### SDK(面向 JS/TS 应用)
587
+
588
+ ```bash
589
+ npm install agent-recall-sdk
590
+ ```
591
+
592
+ ```typescript
593
+ import { AgentRecall } from "agent-recall-sdk";
594
+
595
+ const memory = new AgentRecall({ project: "my-app" });
596
+ await memory.capture("用什么 ORM?", "Drizzle — 类型安全、轻量");
597
+ await memory.palaceWrite("architecture", "技术栈:Next.js 16 + Drizzle + Postgres");
598
+ const context = await memory.coldStart();
599
+ ```
600
+
601
+ ### CLI(面向终端和 CI)
602
+
603
+ ```bash
604
+ npm install -g agent-recall-cli
605
+
606
+ ar capture "用什么 ORM?" "Drizzle" --project my-app
607
+ ar palace walk --depth active
608
+ ar insight "构建认证中间件"
609
+ ```
610
+
320
611
  ---
321
612
 
322
613
  ## 智能体使用流程
@@ -343,7 +634,7 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
343
634
 
344
635
  ---
345
636
 
346
- ## 21 个 MCP 工具
637
+ ## 22 个 MCP 工具
347
638
 
348
639
  ### 记忆宫殿(5 个)
349
640
 
@@ -373,13 +664,14 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
373
664
  | `journal_search` | 全文搜索。`include_palace=true` 同时搜索宫殿 |
374
665
  | `journal_projects` | 列出所有项目 |
375
666
 
376
- ### 架构工具(3 个)
667
+ ### 架构工具(4 个)
377
668
 
378
669
  | 工具 | 功能 |
379
670
  |------|------|
380
671
  | `journal_state` | JSON 状态层 — agent 间毫秒级结构化交接 |
381
- | `journal_cold_start` | 缓存感知冷启动:热 (0-1天) / 温 (2-7天) / 冷 (7天+) |
672
+ | `journal_cold_start` | 宫殿优先冷启动:先加载身份+感知+高权重房间(~200 token),再加载日志 |
382
673
  | `journal_archive` | 归档旧条目到冷存储 |
674
+ | `journal_rollup` | 将旧日志压缩为周报。防止日志无限积累。`dry_run=true` 预览 |
383
675
 
384
676
  ### 知识工具(2 个)
385
677
 
@@ -398,65 +690,119 @@ curl -o ~/.claude/skills/agent-recall/SKILL.md \
398
690
 
399
691
  ---
400
692
 
401
- ## 架构
693
+ ## SDK API
402
694
 
403
- ### 五层记忆模型
695
+ `agent-recall-sdk` 提供 `AgentRecall` 类 — 完整记忆系统的编程接口。可用于 LangChain、CrewAI、Vercel AI SDK 或任何自定义 JS/TS 智能体框架。
404
696
 
697
+ ```typescript
698
+ import { AgentRecall } from "agent-recall-sdk";
699
+ const ar = new AgentRecall({ project: "my-project" });
405
700
  ```
406
- ┌──────────────────────────────────────────────────────────────┐
407
- │ L1: 工作记忆 journal_capture 「发生了什么」 │
408
- │ L2: 情景记忆 journal_write 「这意味着什么」 │
409
- │ L3: 记忆宫殿 palace_write / walk 「跨会话的知识」 │
410
- │ L4: 感知系统 awareness_update 「复合的洞察」 │
411
- │ L5: 洞察索引 recall_insight 「跨项目的经验」 │
412
- └──────────────────────────────────────────────────────────────┘
701
+
702
+ | 方法 | 说明 |
703
+ |------|------|
704
+ | `capture(question, answer, opts?)` | 快速问答捕获(L1 记忆) |
705
+ | `journalWrite(content, opts?)` | 写入每日日志 |
706
+ | `coldStart()` | 宫殿优先上下文加载(~200 token) |
707
+ | `palaceWrite(room, content, opts?)` | 写入房间,自动扇出交叉引用 |
708
+ | `palaceRead(room?, topic?)` | 读取房间内容 |
709
+ | `walk(depth?, focus?)` | 渐进式宫殿漫步 |
710
+ | `awarenessUpdate(insights, opts?)` | 复合新洞察到感知系统 |
711
+ | `recallInsight(context, opts?)` | 跨项目洞察召回 |
712
+ | `alignmentCheck(input)` | 记录置信度和假设 |
713
+ | `synthesize(opts?)` | L3 合成,可选宫殿整合 |
714
+
715
+ ---
716
+
717
+ ## CLI 命令
718
+
719
+ `agent-recall-cli` 提供 `ar` 命令,用于终端工作流和 CI 管道。
720
+
721
+ ```bash
722
+ # 日志
723
+ ar read [--date YYYY-MM-DD] [--section <name>]
724
+ ar write <content> [--section <name>]
725
+ ar capture <question> <answer> [--tags tag1,tag2]
726
+ ar search <query> [--include-palace]
727
+ ar rollup [--min-age-days N] [--dry-run]
728
+
729
+ # 宫殿
730
+ ar palace read [<room>]
731
+ ar palace write <room> <content> [--importance high|medium|low]
732
+ ar palace walk [--depth identity|active|relevant|full]
733
+ ar palace search <query>
734
+
735
+ # 感知与洞察
736
+ ar awareness read
737
+ ar awareness update --insight "标题" --evidence "证据" --applies-when kw1,kw2
738
+ ar insight <context> [--limit N]
739
+
740
+ # 全局选项
741
+ --root <path> 存储根目录(默认:~/.agent-recall)
742
+ --project <slug> 项目覆盖
413
743
  ```
414
744
 
415
- ### 核心机制
745
+ ---
416
746
 
417
- **扇出写入** — 写入一个房间,相关房间通过 `[[wikilinks]]` 自动更新交叉引用。机械式处理,零 LLM 成本。
747
+ ## 架构
418
748
 
419
- **显著性评分** — 每个房间有显著性分数:`重要性(0.4) + 时效性(0.3) + 访问频率(0.2) + 连接数(0.1)`。高显著性房间优先展示,低于阈值自动归档。
749
+ ### 五层记忆模型
750
+
751
+ ```
752
+ L1: 工作记忆 journal_capture 「发生了什么」
753
+ L2: 情景记忆 journal_write 「这意味着什么」
754
+ L3: 记忆宫殿 palace_write / walk 「跨会话的知识」
755
+ L4: 感知系统 awareness_update 「复合的洞察」
756
+ L5: 洞察索引 recall_insight 「跨项目的经验」
757
+ ```
420
758
 
421
- **复合感知** — `awareness.md` 上限 200 行。新洞察加入时,相似的合并(增强),不相似的竞争(最低确认次数的被替换)。约束创造压缩,压缩创造复合。
759
+ ### 核心机制
422
760
 
423
- **跨项目洞察召回** — `insights-index.json` 通过关键词将洞察映射到场景。`recall_insight("构建质量检查")` 返回来自任何项目的相关教训。
761
+ **扇出写入**写入一个房间,相关房间通过 `[[wikilinks]]` 自动更新交叉引用。零 LLM 成本。
424
762
 
425
- **Obsidian 兼容** 每个宫殿文件都有 YAML frontmatter + `[[wikilinks]]`。将 `palace/` 作为 Obsidian vault 打开 → 图形视图展示房间连接。零 Obsidian 依赖。
763
+ **显著性评分**`重要性(0.4) + 时效性(0.3) + 访问频率(0.2) + 连接数(0.1)`。高显著性房间优先展示,低于阈值自动归档。
426
764
 
427
- ### 智能距离协议
765
+ **复合感知** — `awareness.md` 上限 200 行。新洞察与相似的合并(增强),与不相似的竞争(最低确认次数的被替换)。约束创造压缩,压缩创造复合。
428
766
 
429
- 人类意图与智能体理解之间的差距是结构性的源于不同的认知起源,不是临时的技术问题。
767
+ **跨项目洞察召回**通过关键词将洞察映射到场景。`recall_insight("构建质量检查")` 返回来自任何项目的相关教训。
430
768
 
431
- | 差距 | 工具 | 机制 |
432
- |------|------|------|
433
- | 智能体误解意图 | `alignment_check` | 记录置信度 + 假设 → 人类在工作前纠正 |
434
- | 智能体与先前决策矛盾 | `nudge` | 发现矛盾 → 人类澄清 |
435
- | 智能体跨会话遗忘 | `palace_walk` | 从身份到完整上下文的渐进式加载 |
436
- | 智能体重复过去的错误 | `recall_insight` | 跨项目洞察在工作前自动呈现 |
769
+ **Obsidian 兼容** YAML frontmatter + `[[wikilinks]]`。将 `palace/` 作为 Obsidian vault 打开即可。零 Obsidian 依赖。
437
770
 
438
771
  ---
439
772
 
440
- ## 设计理念
441
-
442
- **记忆不是目的,理解才是。**
773
+ ## 平台兼容性
443
774
 
444
- 大多数记忆系统优化检索准确性。AgentRecall 优化**对齐准确性** 缩小人类意图和智能体行为之间的差距。
775
+ | 平台 | MCP | SDK | CLI | 说明 |
776
+ |------|:---:|:---:|:---:|------|
777
+ | Claude Code | ✅ | ✅ | ✅ | 完整支持 — MCP + 技能 + 命令 |
778
+ | Cursor | ✅ | ✅ | ✅ | MCP via .cursor/mcp.json |
779
+ | VS Code (Copilot) | ✅ | ✅ | ✅ | MCP via .vscode/mcp.json |
780
+ | Windsurf | ✅ | ✅ | ✅ | MCP via mcp_config.json |
781
+ | OpenAI Codex | ✅ | ✅ | ✅ | `codex mcp add` |
782
+ | LangChain / CrewAI | — | ✅ | — | SDK 集成到你的 chain 中 |
783
+ | Vercel AI SDK | — | ✅ | — | SDK 在 server actions 中使用 |
784
+ | CI / GitHub Actions | — | — | ✅ | `npx agent-recall-cli` |
785
+ | 任何 MCP 智能体 | ✅ | — | — | 标准 MCP 协议 |
445
786
 
446
- **复合优于累积。** 贴了更好标签的文件柜还是文件柜。AgentRecall 的感知系统在插入时强制合并:每个新洞察要么增强已有的,要么替换最弱的。100 个会话后,`awareness.md` 仍是 200 行 — 但每一行承载着经过确认和交叉验证的观察。
787
+ ---
447
788
 
448
- **默认跨项目。** 在一个项目中学到的洞察适用于所有项目。`recall_insight` 不关心教训来自哪个项目 — 它匹配当前场景和全局索引。
789
+ ## 文档
449
790
 
450
- **智能体友好,人类可见。** 一切都是磁盘上的 markdown。智能体通过 MCP 工具消费。人类在 Obsidian(或任何文本编辑器)中浏览。零云端、零遥测、零锁定。
791
+ | 文档 | 说明 |
792
+ |------|------|
793
+ | [智能距离协议](docs/intelligent-distance-protocol.md) | 基础理论 — 人类与 AI 之间的差距是结构性的,如何导航 |
794
+ | [MCP 适配器规范](docs/mcp-adapter-spec.md) | 基于 AgentRecall 构建适配器的技术规范 |
795
+ | [SDK 设计](docs/sdk-design.md) | SDK 架构设计文档 |
796
+ | [v3.4 升级说明](UPGRADE-v3.4.md) | 周报压缩、宫殿优先冷启动、提升验证 |
451
797
 
452
798
  ---
453
799
 
454
800
  ## 贡献
455
801
 
456
- 由 [tongwu](https://github.com/Goldentrii) 构建。
802
+ 由 [tongwu](https://github.com/Goldentrii) 在 [Novada](https://www.novada.com) 构建。
457
803
 
458
804
  - Issues & 反馈:[GitHub Issues](https://github.com/Goldentrii/AgentRecall/issues)
459
- - 邮箱:tongwu0824@gmail.com
460
- - 协议规范:[docs/intelligent-distance-protocol.md](https://github.com/Goldentrii/AgentRecall/blob/main/docs/intelligent-distance-protocol.md)
805
+ - 邮箱:[tong.wu@novada.com](mailto:tong.wu@novada.com)
806
+ - 网站:[novada.com](https://www.novada.com)
461
807
 
462
808
  MIT 许可证。