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.
- package/README.md +489 -143
- package/dist/index.js +6 -13
- package/dist/index.js.map +1 -1
- package/dist/resources/journal-resources.d.ts.map +1 -1
- package/dist/resources/journal-resources.js +5 -29
- package/dist/resources/journal-resources.js.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/alignment-check.d.ts.map +1 -1
- package/dist/tools/alignment-check.js +3 -54
- package/dist/tools/alignment-check.js.map +1 -1
- package/dist/tools/awareness-update.d.ts +2 -8
- package/dist/tools/awareness-update.d.ts.map +1 -1
- package/dist/tools/awareness-update.js +3 -66
- package/dist/tools/awareness-update.js.map +1 -1
- package/dist/tools/context-synthesize.d.ts.map +1 -1
- package/dist/tools/context-synthesize.js +6 -187
- package/dist/tools/context-synthesize.js.map +1 -1
- package/dist/tools/journal-archive.d.ts.map +1 -1
- package/dist/tools/journal-archive.js +3 -48
- package/dist/tools/journal-archive.js.map +1 -1
- package/dist/tools/journal-capture.d.ts.map +1 -1
- package/dist/tools/journal-capture.js +3 -60
- package/dist/tools/journal-capture.js.map +1 -1
- package/dist/tools/journal-cold-start.d.ts.map +1 -1
- package/dist/tools/journal-cold-start.js +10 -52
- package/dist/tools/journal-cold-start.js.map +1 -1
- package/dist/tools/journal-list.d.ts.map +1 -1
- package/dist/tools/journal-list.js +3 -23
- package/dist/tools/journal-list.js.map +1 -1
- package/dist/tools/journal-projects.d.ts.map +1 -1
- package/dist/tools/journal-projects.js +3 -16
- package/dist/tools/journal-projects.js.map +1 -1
- package/dist/tools/journal-read.d.ts.map +1 -1
- package/dist/tools/journal-read.js +5 -45
- package/dist/tools/journal-read.js.map +1 -1
- package/dist/tools/journal-rollup.d.ts +3 -0
- package/dist/tools/journal-rollup.d.ts.map +1 -0
- package/dist/tools/journal-rollup.js +21 -0
- package/dist/tools/journal-rollup.js.map +1 -0
- package/dist/tools/journal-search.d.ts.map +1 -1
- package/dist/tools/journal-search.js +3 -91
- package/dist/tools/journal-search.js.map +1 -1
- package/dist/tools/journal-state.d.ts +0 -3
- package/dist/tools/journal-state.d.ts.map +1 -1
- package/dist/tools/journal-state.js +5 -93
- package/dist/tools/journal-state.js.map +1 -1
- package/dist/tools/journal-write.d.ts.map +1 -1
- package/dist/tools/journal-write.js +3 -62
- package/dist/tools/journal-write.js.map +1 -1
- package/dist/tools/knowledge-read.d.ts.map +1 -1
- package/dist/tools/knowledge-read.js +3 -100
- package/dist/tools/knowledge-read.js.map +1 -1
- package/dist/tools/knowledge-write.d.ts.map +1 -1
- package/dist/tools/knowledge-write.js +3 -66
- package/dist/tools/knowledge-write.js.map +1 -1
- package/dist/tools/nudge.d.ts.map +1 -1
- package/dist/tools/nudge.js +3 -25
- package/dist/tools/nudge.js.map +1 -1
- package/dist/tools/palace-lint.d.ts +2 -6
- package/dist/tools/palace-lint.d.ts.map +1 -1
- package/dist/tools/palace-lint.js +3 -135
- package/dist/tools/palace-lint.js.map +1 -1
- package/dist/tools/palace-read.d.ts +2 -5
- package/dist/tools/palace-read.d.ts.map +1 -1
- package/dist/tools/palace-read.js +5 -62
- package/dist/tools/palace-read.js.map +1 -1
- package/dist/tools/palace-search.d.ts +2 -5
- package/dist/tools/palace-search.d.ts.map +1 -1
- package/dist/tools/palace-search.js +3 -66
- package/dist/tools/palace-search.js.map +1 -1
- package/dist/tools/palace-walk.d.ts +2 -11
- package/dist/tools/palace-walk.d.ts.map +1 -1
- package/dist/tools/palace-walk.js +3 -149
- package/dist/tools/palace-walk.js.map +1 -1
- package/dist/tools/palace-write.d.ts +2 -5
- package/dist/tools/palace-write.d.ts.map +1 -1
- package/dist/tools/palace-write.js +3 -90
- package/dist/tools/palace-write.js.map +1 -1
- package/dist/tools/recall-insight.d.ts +2 -8
- package/dist/tools/recall-insight.d.ts.map +1 -1
- package/dist/tools/recall-insight.js +3 -35
- package/dist/tools/recall-insight.js.map +1 -1
- package/package.json +22 -29
- package/dist/helpers/journal-files.d.ts +0 -30
- package/dist/helpers/journal-files.d.ts.map +0 -1
- package/dist/helpers/journal-files.js +0 -96
- package/dist/helpers/journal-files.js.map +0 -1
- package/dist/helpers/sections.d.ts +0 -12
- package/dist/helpers/sections.d.ts.map +0 -1
- package/dist/helpers/sections.js +0 -84
- package/dist/helpers/sections.js.map +0 -1
- package/dist/palace/awareness.d.ts +0 -67
- package/dist/palace/awareness.d.ts.map +0 -1
- package/dist/palace/awareness.js +0 -231
- package/dist/palace/awareness.js.map +0 -1
- package/dist/palace/consolidate.d.ts +0 -28
- package/dist/palace/consolidate.d.ts.map +0 -1
- package/dist/palace/consolidate.js +0 -129
- package/dist/palace/consolidate.js.map +0 -1
- package/dist/palace/fan-out.d.ts +0 -15
- package/dist/palace/fan-out.d.ts.map +0 -1
- package/dist/palace/fan-out.js +0 -78
- package/dist/palace/fan-out.js.map +0 -1
- package/dist/palace/graph.d.ts +0 -11
- package/dist/palace/graph.d.ts.map +0 -1
- package/dist/palace/graph.js +0 -59
- package/dist/palace/graph.js.map +0 -1
- package/dist/palace/identity.d.ts +0 -6
- package/dist/palace/identity.d.ts.map +0 -1
- package/dist/palace/identity.js +0 -18
- package/dist/palace/identity.js.map +0 -1
- package/dist/palace/index-manager.d.ts +0 -7
- package/dist/palace/index-manager.d.ts.map +0 -1
- package/dist/palace/index-manager.js +0 -46
- package/dist/palace/index-manager.js.map +0 -1
- package/dist/palace/insights-index.d.ts +0 -39
- package/dist/palace/insights-index.d.ts.map +0 -1
- package/dist/palace/insights-index.js +0 -101
- package/dist/palace/insights-index.js.map +0 -1
- package/dist/palace/log.d.ts +0 -9
- package/dist/palace/log.d.ts.map +0 -1
- package/dist/palace/log.js +0 -28
- package/dist/palace/log.js.map +0 -1
- package/dist/palace/obsidian.d.ts +0 -12
- package/dist/palace/obsidian.d.ts.map +0 -1
- package/dist/palace/obsidian.js +0 -76
- package/dist/palace/obsidian.js.map +0 -1
- package/dist/palace/rooms.d.ts +0 -14
- package/dist/palace/rooms.d.ts.map +0 -1
- package/dist/palace/rooms.js +0 -117
- package/dist/palace/rooms.js.map +0 -1
- package/dist/palace/salience.d.ts +0 -15
- package/dist/palace/salience.d.ts.map +0 -1
- package/dist/palace/salience.js +0 -33
- package/dist/palace/salience.js.map +0 -1
- package/dist/storage/fs-utils.d.ts +0 -8
- package/dist/storage/fs-utils.d.ts.map +0 -1
- package/dist/storage/fs-utils.js +0 -28
- package/dist/storage/fs-utils.js.map +0 -1
- package/dist/storage/paths.d.ts +0 -21
- package/dist/storage/paths.d.ts.map +0 -1
- package/dist/storage/paths.js +0 -59
- package/dist/storage/paths.js.map +0 -1
- package/dist/storage/project.d.ts +0 -17
- package/dist/storage/project.d.ts.map +0 -1
- package/dist/storage/project.js +0 -130
- package/dist/storage/project.js.map +0 -1
- package/dist/types.d.ts +0 -112
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -31
- package/dist/types.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,65 +1,99 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
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-
|
|
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>
|
|
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
|
+
|
|
|
27
|
+
<b>中文:</b>
|
|
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
|
-
##
|
|
38
|
+
## Why Choose AgentRecall
|
|
19
39
|
|
|
20
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
|
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
|
-
##
|
|
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 (
|
|
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` |
|
|
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
|
-
##
|
|
278
|
+
## SDK API
|
|
169
279
|
|
|
170
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
288
|
+
### Core Methods
|
|
200
289
|
|
|
201
|
-
|
|
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
|
-
|
|
298
|
+
### Palace Methods
|
|
204
299
|
|
|
205
|
-
|
|
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
|
-
|
|
308
|
+
### Awareness & Insight Methods
|
|
208
309
|
|
|
209
|
-
|
|
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
|
-
|
|
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
|
-
|
|
324
|
+
### LangChain / CrewAI Integration Example
|
|
214
325
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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
|
-
##
|
|
349
|
+
## CLI Commands
|
|
226
350
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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.4 — AgentRecall 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
|
-
##
|
|
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
|
-
**
|
|
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
|
-
|
|
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
|
-
**
|
|
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
|
-
|
|
418
|
+
### Storage Layout
|
|
248
419
|
|
|
249
|
-
|
|
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:
|
|
270
|
-
-
|
|
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
|
-
>
|
|
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
|
-
|
|
545
|
+
一个**持久记忆系统**,让 AI 智能体拥有**跨会话复合感知**。不是日志,不是数据库——是一个用得越多越聪明的第二大脑。
|
|
287
546
|
|
|
288
|
-
|
|
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
|
-
##
|
|
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
|
-
### 架构工具(
|
|
667
|
+
### 架构工具(4 个)
|
|
377
668
|
|
|
378
669
|
| 工具 | 功能 |
|
|
379
670
|
|------|------|
|
|
380
671
|
| `journal_state` | JSON 状态层 — agent 间毫秒级结构化交接 |
|
|
381
|
-
| `journal_cold_start` |
|
|
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
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
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
|
-
|
|
747
|
+
## 架构
|
|
418
748
|
|
|
419
|
-
|
|
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
|
-
|
|
759
|
+
### 核心机制
|
|
422
760
|
|
|
423
|
-
|
|
761
|
+
**扇出写入** — 写入一个房间,相关房间通过 `[[wikilinks]]` 自动更新交叉引用。零 LLM 成本。
|
|
424
762
|
|
|
425
|
-
|
|
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
|
-
|
|
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
|
-
|
|
787
|
+
---
|
|
447
788
|
|
|
448
|
-
|
|
789
|
+
## 文档
|
|
449
790
|
|
|
450
|
-
|
|
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
|
-
- 邮箱:
|
|
460
|
-
-
|
|
805
|
+
- 邮箱:[tong.wu@novada.com](mailto:tong.wu@novada.com)
|
|
806
|
+
- 网站:[novada.com](https://www.novada.com)
|
|
461
807
|
|
|
462
808
|
MIT 许可证。
|