toon-memory 4.2.0 → 4.3.0
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.de.md +245 -22
- package/README.es.md +185 -14
- package/README.fr.md +237 -15
- package/README.ja.md +239 -18
- package/README.ko.md +244 -21
- package/README.md +53 -9
- package/README.pt-br.md +243 -22
- package/README.zh.md +238 -16
- package/dist/cli/setup.js +2 -1
- package/mcp/server.js +41 -13
- package/package.json +1 -1
- package/src/lib/graph.ts +13 -3
- package/src/lib/quality.ts +14 -4
- package/src/lib/utils.ts +24 -0
- package/src/mcp/tools.ts +4 -3
package/README.ko.md
CHANGED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# toon-memory
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> 세션을 넘어 지속되는 메모리를 AI 코딩 에이전트에 제공하세요 — 모든 세션에서 의사결정, 패턴, 버그를 기억합니다.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/toon-memory)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
[](https://github.com/LuiggiVal08/toon-memory/actions/workflows/ci.yml)
|
|
10
10
|
[](https://luiggival08.github.io/toon-memory/)
|
|
11
|
+
[](https://lobehub.com/mcp/luiggival08-toon-memory)
|
|
11
12
|
|
|
12
13
|
---
|
|
13
14
|
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
- [MCP 도구](#mcp-도구)
|
|
22
23
|
- [다세션 협업](#다세션-협업)
|
|
23
24
|
- [메모리 그래프 (그래프 기반 리콜)](#메모리-그래프-그래프-기반-리콜)
|
|
25
|
+
- [메모리 그래프 뷰어](#메모리-그래프-뷰어)
|
|
24
26
|
- [팁과 모범 사례](#팁과-모범-사례)
|
|
25
27
|
- [CLI 명령어](#cli-명령어)
|
|
26
28
|
- [설정](#설정)
|
|
@@ -30,6 +32,7 @@
|
|
|
30
32
|
- [FAQ](#faq)
|
|
31
33
|
- [개발](#개발)
|
|
32
34
|
- [기여하기](#기여하기)
|
|
35
|
+
- [보안 및 개인정보](#보안-및-개인정보)
|
|
33
36
|
- [라이선스](#라이선스)
|
|
34
37
|
|
|
35
38
|
---
|
|
@@ -38,7 +41,7 @@
|
|
|
38
41
|
|
|
39
42
|
어제 세션에서 AI 에이전트가 모든 것을 잊어버린 경험 있으신가요? 같은 아키텍처 결정을 세 번째로 설명하는데, 이미 거절한 접근법을 또 제안하나요?
|
|
40
43
|
|
|
41
|
-
**toon-memory는 이 문제를 해결합니다.** 재시작 후에도 유지되는
|
|
44
|
+
**toon-memory는 이 문제를 해결합니다.** AI 에이전트에 연속성을 제공합니다 — 재시작 후에도 유지되는 메모리로, 프로젝트에서 시간이 지남에 따라 실제로 학습하게 됩니다. 같은 결정을 두 번 설명할 필요가 없습니다.
|
|
42
45
|
|
|
43
46
|
📖 **[문서 읽기](https://luiggival08.github.io/toon-memory/)**
|
|
44
47
|
|
|
@@ -63,7 +66,7 @@
|
|
|
63
66
|
|
|
64
67
|
## 기능
|
|
65
68
|
|
|
66
|
-
-
|
|
69
|
+
- **완전한 메모리 도구 키트** — Model Context Protocol을 통한 전체 메모리 관리. `memory_smart_recall` (세션 바이어스가 있는 통합 리콜), `memory_sessions` 다세션 협업, `context_*` 도구를 통한 원 호출 컨텍스트 생성(브리핑, 차이점, 집중, 건강 감사, 내보내기), `memory_compress` (LLM 기반 압축), `memory_consolidate` (결정론적 중복제거/병합/정리), `memory_primer` (자동 주입 컨텍스트), `memory_merge_sessions` (세션 간 병합), `memory_pin`/`memory_unpin` (우선순위 1-5로 중요 항목 핀 고정), `memory_checkpoint` (7d TTL의 세션 스냅샷), `memory_search` (태그 필터 + 세션 바이어스가 있는 통합 검색), `memory_tag` (일괄 태그 작업), `memory_export_gist`/`memory_import_gist` (GitHub Gist 동기화), `memory_forget` (소프트/하드 삭제, 복원, 대체), `memory_reflect` (오래됨/품질 반성), `memory_promote` (저신뢰도 초안 자동 승격) 포함
|
|
67
70
|
- **MCP 리소스** — 도구 호출 없이 컨텍스트로 메모리 읽기. 시스템 프라이머(자동 생성 지식 맵) 포함
|
|
68
71
|
- **에이전트 15개 지원** — OpenCode, VS Code, Claude Code, Cursor, Windsurf, Cline, Continue, Codex CLI, Gemini CLI, Zed, Antigravity, Aider, KiloCode, OpenClaw, Kiro
|
|
69
72
|
- **인터랙티브 설치기** — 메뉴에서 설정할 에이전트 선택
|
|
@@ -87,9 +90,30 @@
|
|
|
87
90
|
- **스마트 리콜** — `memory_smart_recall`이 BM25 + 그래프 + 감쇠 + 품질을 하나의 호출로 결합. LLM이 모든 작업 시작 시 호출
|
|
88
91
|
- **품질 점수** — 모든 항목에 구조(태그, 링크, 콘텐츠 구체성, 최신성)를 기반으로 0–1 품질 점수 자동 부여. 고품질 항목이 먼저 표시
|
|
89
92
|
- **병합-중복제거** — 같은 `key`로 저장하면 속성을 덮어쓰지 않고 병합 (태그 합집합, 최대 신뢰도, 최신 날짜, 결합된 링크)
|
|
93
|
+
- **근사 중복 감지** — 정리(consolidation)가 Jaccard 유사도(임계값 0.7)로 근사 중복을 감지하고 병합
|
|
90
94
|
- **신뢰도 점수** — 각 항목이 정보의 신뢰성을 추적: 사용자 주장 = 1.0, 추론 = 0.65–0.75
|
|
95
|
+
- **LLM 기반 압축** — `memory_compress`가 AI로 긴 항목을 요약. `memory_consolidate(mode: "low-quality")`는 결정론적으로 일괄 정리
|
|
96
|
+
- **크로스 세션 병합** — `memory_merge_sessions`가 파일에 대한 병렬 세션 간 관찰을 병합
|
|
97
|
+
- **GitHub Gist 동기화** — `memory_export_gist`와 `memory_import_gist`가 GitHub Gist를 통해 메모리 항목을 동기화 (의존성 제로)
|
|
98
|
+
- **Verbatim 모드** — `config.verbatim`이 저장 시 기존 항목을 덮어쓰지 않고 보존
|
|
91
99
|
- **컨텍스트 생성 도구** — `context_generate` (전체 브리핑), `context_diff` (증분), `context_focus` (집중), `context_health` (감사), `context_export` (마크다운) — 각각 5-6개의 수동 도구 호출을 대체. LLM 불필요, 순수 결정론적 집계
|
|
92
100
|
- **시스템 프라이머** — MCP 리소스로 노출되는 자동 생성 지식 맵. 에이전트가 세션 시작 시 로드하여 즉시 컨텍스트 확보
|
|
101
|
+
- **경로 범위 지정** — 항목을 glob 패턴으로 파일 경로에 범위 지정(`path_scope`) 가능. 리콜이 범위별로 자동 필터링
|
|
102
|
+
- **예산 제어** — 세 가지 출력 수준: `budget: "tiny"` (키+한 줄, 약 50토큰), `"normal"` (태그/엣지가 있는 컴팩트), `"deep"` (origin/scope/status를 포함한 모든 필드). `compact: true`와 하위 호환
|
|
103
|
+
- **원점 추적** — 각 항목이 원점(`human`, `agent`, `inferred`)을 추적. 인간의 주장은 품질 부스트를 받음
|
|
104
|
+
- **소프트 삭제** — `memory_forget`이 기본적으로 소프트 삭제(`status=obsolete` 설정). `memory_forget(key, action: "restore")`로 복원, `action: "soft"`로 숨김, `action: "hard"`로 영구 제거
|
|
105
|
+
- **향상된 건강 감사** — `context_health`가 이제 증거 부족(path_scope가 있는데 파일 없음)과 오래된 주장(같은 카테고리의 겹치는 콘텐츠)을 감지
|
|
106
|
+
- **타입이 있는 그래프 엣지** — 엣지가 유형(`superseded_by`, `supersedes`, `relates`)을 가지며 그래프에서 `type:key`로 작성됨. 명시적 `links`는 `relates:key`가 되어 항목이 어떻게 관련되어 있는지 알 수 있음
|
|
107
|
+
- **RRF 순위** — 리콜이 BM25(×3)와 그래프 중심성 순위를 Reciprocal Rank Fusion과 적응형 `k = clamp(3..60, round(sqrt(n)))`로 융합. 벤치마크(골드 쿼리 8개): nDCG 0.776, MRR 0.917 — 이전 선형 점수와 완전히 동일. 폴백하려면 `rrf: false` 전달
|
|
108
|
+
- **메모리 반성** — `memory_reflect`가 오래됨, 품질, 과도한 연결로 항목을 순위 매겨 주의나 정리가 필요한 항목을 표면화. 결정론적, LLM 불필요
|
|
109
|
+
- **메모리 대체** — `memory_forget(key, action: "supersede", new_key)`가 항목을 더 새 항목으로 대체된 것으로 표시(`superseded_by` 링크 + `supersededOn` 날짜). `memory_recall({ as_of })`는 대체 이전의 시점 쿼리를 위해 이전 항목을 다시 포함
|
|
110
|
+
- **자동 승격** — `memory_promote`가 저신뢰도 초안을 결정론적으로 활성 항목으로 승격(임계값 0.65, Jaccard 중복제거), 기본적으로 `dryRun`
|
|
111
|
+
- **Explain WHY** — `memory_recall`/`memory_smart_recall`이 `explain: true`를 받아 모든 반환 항목에 결정론적 이유 줄을 추가(`↳ 100% 관련성 · 14회 사용 · 오늘 사용됨 · 중요도 HIGH`) — 왜 가져왔는지, LLM 불필요
|
|
112
|
+
- **토큰 예산** — `budget_tokens`가 예상 토큰 수로 리콜 출력을 제한. 항목이 탐욕적으로 누적되고 예산을 초과할 꼬리는 버려짐(`0` = 제한 없음)
|
|
113
|
+
- **버전 대체** — `memory_consolidate(mode: "versions")`가 다른 라이브러리 버전에서 같은 주제를 설명하는 항목(예: "React 18 사용" vs "React 19 사용")을 감지하고 이전 항목을 최신 항목 대신 은퇴시킴
|
|
114
|
+
- **부정적 메모리** — "하지 마세요" 사실을 위한 `warning` 카테고리. `warning` 항목은 리콜 부스트를 받아 에이전트가 지뢰를 반복하기 전에 먼저 볼 수 있음
|
|
115
|
+
- **언어 + 폴더 순위** — 리콜이 같은 문자 체계(latin/CJK/cyrillic/…)로 작성된 항목과 `path_scope`가 현재 파일과 일치하는 항목을 부스트
|
|
116
|
+
- **명시적 중요도** — `memory_remember({ importance })`로 `critical`, `high`, `medium`, `low`를 설정합니다. 중요한 결정이 먼저 표시되고(+0.3), 낮은 메모는 방해하지 않습니다(−0.1). 비워 두면 자동(최신성 + 빈도). 다시 저장하면 더 높은 수준을 유지합니다
|
|
93
117
|
|
|
94
118
|
---
|
|
95
119
|
|
|
@@ -134,6 +158,53 @@ memory_remember # 중요한 결정 저장
|
|
|
134
158
|
|
|
135
159
|
> **팁:** 세션 시작 시 항상 `memory_recall`을 실행하세요. 이전 세션의 컨텍스트를 즉시 확보할 수 있습니다.
|
|
136
160
|
|
|
161
|
+
### MCP 클라이언트 빠른 설정
|
|
162
|
+
|
|
163
|
+
#### Cursor
|
|
164
|
+
|
|
165
|
+
`.cursor/mcp.json`에 추가:
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"mcpServers": {
|
|
170
|
+
"toon-memory": {
|
|
171
|
+
"command": "npx",
|
|
172
|
+
"args": ["-y", "toon-memory", "mcp"]
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Claude Desktop
|
|
179
|
+
|
|
180
|
+
`claude_desktop_config.json`에 추가:
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"mcpServers": {
|
|
185
|
+
"toon-memory": {
|
|
186
|
+
"command": "npx",
|
|
187
|
+
"args": ["-y", "toon-memory", "mcp"]
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### Windsurf
|
|
194
|
+
|
|
195
|
+
`~/.codeium/windsurf/mcp_config.json`에 추가:
|
|
196
|
+
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"mcpServers": {
|
|
200
|
+
"toon-memory": {
|
|
201
|
+
"command": "npx",
|
|
202
|
+
"args": ["-y", "toon-memory", "mcp"]
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
137
208
|
---
|
|
138
209
|
|
|
139
210
|
## 지원하는 에이전트
|
|
@@ -164,11 +235,11 @@ memory_remember # 중요한 결정 저장
|
|
|
164
235
|
|
|
165
236
|
| 도구 | 설명 |
|
|
166
237
|
|------|-------------|
|
|
167
|
-
| `memory_remember` | 결정, 패턴, 버그, 또는
|
|
168
|
-
| `memory_recall` | 메모리 검색 (파일 읽기 전 사용, 만료된 TTL 필터링). `mode: "graph"`는 더
|
|
169
|
-
| `memory_smart_recall` | **통합 리콜**: BM25 + 그래프 + 감쇠 + 품질을 하나의 호출로 결합.
|
|
170
|
-
| `memory_forget` | 키 또는 ID로
|
|
171
|
-
| `memory_stats` | 메모리 상태 확인 (TTL
|
|
238
|
+
| `memory_remember` | 결정, 패턴, 버그, 지식, 또는 **warning** (부정적인 "하지 마세요" 메모리, 부스트와 함께 리콜됨) 저장 — 선택적 TTL, 자동 태그 추론, 메모리 그래프 구축을 위한 `links`, 같은 키에서 병합-중복제거, 자동 품질 점수 및 신뢰도 |
|
|
239
|
+
| `memory_recall` | 메모리 검색 (파일 읽기 전 사용, 만료된 TTL 필터링). `mode: "graph"`는 더 높은 정확도를 위해 관계 인식 서브그래프를 확장. `budget: "tiny"|"normal"|"deep"`는 출력 상세도를 제어(`compact: true`와 하위 호환). `path_scope`는 glob 패턴으로 필터링. `sessionBias`는 현재 git 브랜치의 항목 부스트. `explain: true`는 항목별 이유 줄(왜 가져왔는지)을 추가. `budget_tokens`는 예상 토큰으로 출력 제한(`0` = 제한 없음). 품질 가중 순위 |
|
|
240
|
+
| `memory_smart_recall` | **통합 리콜**: BM25 + 그래프 + 감쇠 + 품질을 하나의 호출로 결합. `sessionBias`는 현재 git 브랜치의 항목 부스트. `explain: true`는 항목별 이유를 추가하고, `budget_tokens`는 예상 토큰으로 출력 제한. 모든 작업 시작 시 사용. 컴팩트하고 토큰 효율적인 출력 |
|
|
241
|
+
| `memory_forget` | 키 또는 ID로 **라이프사이클 작업**: `action: "soft"`(기본)는 폐기 표시, `"hard"`는 영구 제거, `"restore"`는 활성으로 복원, `"supersede"`는 `new_key`에 대한 `superseded_by` 링크와 함께 은퇴 |
|
|
242
|
+
| `memory_stats` | 메모리 상태 확인 (TTL 통계, 품질 분포, origin/status 구분, 품질/액세스 임계값 미만의 콜드 메모리, 그리고 **적중률 / 중복 / 폐기** 지표 포함) |
|
|
172
243
|
| `memory_summary` | 파일 요약 저장/조회 |
|
|
173
244
|
| `memory_archive` | 오래된 항목(30일 초과) 및 만료된 TTL 항목 아카이브 |
|
|
174
245
|
| `memory_diff` | 특정 날짜 이후 변경사항 표시 (24h, 7d, 또는 정확한 날짜) |
|
|
@@ -178,14 +249,14 @@ memory_remember # 중요한 결정 저장
|
|
|
178
249
|
| `memory_backup` | 메모리 파일의 타임스탬프 백업 생성 (최근 10개로 자동 정리) |
|
|
179
250
|
| `memory_captured` | 훅에 의해 자동 캡처된 활동 목록 (선택적) 또는 로그 지우기 |
|
|
180
251
|
| `memory_checkpoint` | **세션 체크포인트**: 7d TTL로 현재 메모리 상태의 스냅샷 생성. 긴 세션 중 롤백 참조에 유용 |
|
|
181
|
-
| `memory_consolidate` | **정리
|
|
252
|
+
| `memory_consolidate` | **정리 작업**, 결정론적(LLM 불필요): `mode: "identical"`(기본) 동일 콘텐츠 항목 중복 제거, `"similar"` 근사 중복(Jaccard >50%) 병합, `"low-quality"` 저품질 항목 일괄 제거(`minQuality`, `dryRun`), `"versions"`는 이전 라이브러리 버전 항목을 최신 항목 대신 은퇴 |
|
|
182
253
|
| `memory_sessions` | 활성 에이전트 세션(브랜치, 파일, 마지막 확인) 및 병렬 작업 시 소프트 충돌 표시 |
|
|
183
|
-
| `memory_compress` | LLM 기반 2단계 압축: 요약 + 덮어쓰기.
|
|
254
|
+
| `memory_compress` | LLM 기반 2단계 압축: 요약 + 덮어쓰기. `anthropic`/`openai` CLI 사용 가능 시 사용, 없으면 수동 압축용 프롬프트 반환 |
|
|
184
255
|
| `memory_primer` | 원 호출 컨텍스트 프라이머: 주요 메모리 + 카테고리 + 세션 파일 변경. 세션 시작 시 자동 주입 |
|
|
185
256
|
| `memory_merge_sessions` | 파일의 병렬 세션 간 관찰 병합. 중복 제거 및 자동 승격 |
|
|
186
257
|
| `memory_export_gist` | 항목을 GitHub Gist(공개/비공개)로 내보내기. GITHUB_TOKEN 또는 gh CLI 사용 |
|
|
187
258
|
| `memory_import_gist` | GitHub Gist에서 항목 가져오기. 기존 항목과 병합(태그 합집합, 최대 신뢰도) |
|
|
188
|
-
| `memory_graph_path` | 지식 그래프에서 두 항목 간의 BFS 최단
|
|
259
|
+
| `memory_graph_path` | 지식 그래프에서 두 항목 간의 BFS 최단 경로. 개념이 어떻게 연결되는지 보여줌 |
|
|
189
260
|
| `context_brief` | **원 호출 컨텍스트 브리핑**: 컴팩트 마크다운에 메모리 + 세션 + 건강 상태. 별도의 5-6개 memory_* 호출 대신 사용. LLM 불필요, 순수 결정론적 집계 |
|
|
190
261
|
| `context_generate` | **전체 프로젝트 브리핑**: 프로젝트 구조, git 상태, 메모리 항목, 활성 세션을 하나의 호출로 결합. 5-6개의 수동 도구 호출 대체 |
|
|
191
262
|
| `context_diff` | **증분 브리핑**: git 커밋 + 수정된 파일 + 신규/업데이트된 메모리 + 이전 세션 이후 활성 세션 |
|
|
@@ -194,7 +265,7 @@ memory_remember # 중요한 결정 저장
|
|
|
194
265
|
| `context_export` | **메모리를 마크다운으로 내보내기**: 시스템 프롬프트용 주입 가능한 컨텍스트 (전체 또는 컴팩트) |
|
|
195
266
|
| `memory_pin` | **우선순위 1-5로 항목 핀 고정**: 핀 고정된 항목은 키워드 일치가 없어도 항상 리콜 결과에서 우선순위별로 정렬되어 먼저 표시됨 |
|
|
196
267
|
| `memory_unpin` | **항목 핀 해제**: 우선순위 플래그 제거 |
|
|
197
|
-
| `memory_search` | **필터가 있는 통합 검색**: `memory_recall`과 동일한 기능에 `category`, `tags`, `from_date`, `to_date` 필터 추가. 태그 필터는 AND 논리 사용 — 지정된 모든 태그가 일치해야 함. `sessionBias
|
|
268
|
+
| `memory_search` | **필터가 있는 통합 검색**: `memory_recall`과 동일한 기능에 `category`, `tags`, `from_date`, `to_date` 필터 추가. 태그 필터는 AND 논리 사용 — 지정된 모든 태그가 일치해야 함. `budget`은 출력 상세도 제어. `path_scope`는 glob 패턴으로 필터링. `sessionBias`는 현재 git 브랜치의 항목 부스트 |
|
|
198
269
|
| `memory_tag` | **일괄 태그 작업**: 키 또는 ID로 하나 이상의 항목에 태그 추가, 제거 또는 설정 |
|
|
199
270
|
|
|
200
271
|
### MCP 리소스
|
|
@@ -204,9 +275,16 @@ memory_remember # 중요한 결정 저장
|
|
|
204
275
|
| 리소스 | URI | 설명 |
|
|
205
276
|
|----------|-----|-------------|
|
|
206
277
|
| 메모리 항목 | `toon://memory/entries` | 전체 메모리 덤프 |
|
|
278
|
+
| 현재 메모리 | `toon://memory/current` | 최근 항목이 있는 현재 메모리 상태 |
|
|
207
279
|
| 메모리 통계 | `toon://memory/stats` | 카테고리별 개수 및 TTL 정보 |
|
|
208
280
|
| 시스템 프라이머 | `toon://memory/summaries` | 자동 생성 지식 맵 (상위 항목, 카테고리, 패턴) |
|
|
209
281
|
|
|
282
|
+
### MCP 프롬프트
|
|
283
|
+
|
|
284
|
+
| 프롬프트 | 설명 |
|
|
285
|
+
|--------|-------------|
|
|
286
|
+
| `summarize_project_context` | 현재 TOON 메모리를 분석하고 컴팩트한 프로젝트 요약을 생성. 특정 영역에 집중하기 위한 선택적 `intent` 매개변수 |
|
|
287
|
+
|
|
210
288
|
### 예시
|
|
211
289
|
|
|
212
290
|
#### 결정 저장
|
|
@@ -243,6 +321,21 @@ memory_remember({
|
|
|
243
321
|
|
|
244
322
|
> **팁:** 마감일, 스프린트 정보, 시간 제한이 있는 메모와 같은 임시 컨텍스트에는 TTL을 사용하세요. 만료된 TTL 항목은 검색 결과에서 자동으로 필터링됩니다.
|
|
245
323
|
|
|
324
|
+
#### 명시적 중요도 설정
|
|
325
|
+
|
|
326
|
+
```typescript
|
|
327
|
+
memory_remember({
|
|
328
|
+
category: "decision",
|
|
329
|
+
key: "db-choice",
|
|
330
|
+
content: "We chose Postgres over MySQL — JSONB for flexible schemas, better extension ecosystem",
|
|
331
|
+
importance: "critical"
|
|
332
|
+
})
|
|
333
|
+
// 🧠 저장됨: decision/db-choice (a1b2c3d4)
|
|
334
|
+
// 🎯 중요도: critical (+0.3 부스트) — 일반 항목보다 먼저 표시
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
> **팁:** 기반이 되는 결정을 `critical`로 표시하여 항상 리콜 상단 부근에 순위가 매겨지도록 하세요. `importance`는 `critical`, `high`, `medium`, `low`를 허용합니다. 비워 두면 시스템이 최신성과 빈도로 자동 순위를 매깁니다.
|
|
338
|
+
|
|
246
339
|
#### 자동 추론 태그
|
|
247
340
|
|
|
248
341
|
```typescript
|
|
@@ -343,6 +436,28 @@ memory_smart_recall({ intent: "diseño de base de datos para backend" })
|
|
|
343
436
|
|
|
344
437
|
> **팁:** 모든 작업 시작 시 `memory_smart_recall`을 사용하세요. BM25 + 그래프 + 감쇠 + 품질을 하나의 호출로 결합 — 무엇을 검색할지 추측할 필요가 없습니다.
|
|
345
438
|
|
|
439
|
+
#### 결과가 반환된 이유(WHY) 설명
|
|
440
|
+
|
|
441
|
+
```typescript
|
|
442
|
+
memory_recall({ query: "redis", explain: true })
|
|
443
|
+
// [decision] redis-cache-config (a1b2c3d4)
|
|
444
|
+
// Redis cache layer for session storage
|
|
445
|
+
// File: src/cache.ts | Tags: redis;cache | Date: 2026-07-10
|
|
446
|
+
// ↳ 92% relevance · used 14× · used today · importance HIGH
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
`↳` 이유 줄은 결정론적입니다(관련성 %, 접근 횟수, 마지막 사용, 중요도) — LLM이 관여하지 않습니다. 에이전트에 항목이 *왜* 표시되었는지 알고 싶을 때 `explain: true`를 사용하세요.
|
|
450
|
+
|
|
451
|
+
#### `budget_tokens`로 출력 제한
|
|
452
|
+
|
|
453
|
+
```typescript
|
|
454
|
+
memory_recall({ query: "redis", budget_tokens: 300 })
|
|
455
|
+
// Entries accumulate greedily; the tail that would exceed the estimate is dropped.
|
|
456
|
+
// budget_tokens: 0 (default) = no limit.
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
> **팁:** 메모리 크기와 관계없이 하드 토큰 한도 안에 머무는 컨텍스트 윈도우를 위해 `budget_tokens`를 `budget: "deep"`과 결합하세요.
|
|
460
|
+
|
|
346
461
|
#### 전체 프로젝트 브리핑 (원 호출)
|
|
347
462
|
|
|
348
463
|
```typescript
|
|
@@ -389,7 +504,7 @@ context_health({})
|
|
|
389
504
|
// - src/legacy.ts (deleted, 2 refs)
|
|
390
505
|
```
|
|
391
506
|
|
|
392
|
-
> **팁:** 메모리가 지저분하다고 느낄 때 `context_health`를 실행하세요. 고아 링크, 중복, 만료된 TTL 항목, 깨진 파일
|
|
507
|
+
> **팁:** 메모리가 지저분하다고 느낄 때 `context_health`를 실행하세요. 고아 링크, 중복, 만료된 TTL 항목, 깨진 파일 참조, 증거 부족 항목(파일 없는 path_scope), 오래된 주장(겹치는 콘텐츠)을 표시합니다.
|
|
393
508
|
|
|
394
509
|
#### 병합-중복제거 (자동)
|
|
395
510
|
|
|
@@ -430,6 +545,7 @@ memory_remember({
|
|
|
430
545
|
| 콘텐츠 길이 | 최대 0.3 | 상세 > 모호 |
|
|
431
546
|
| 최신성 | 최대 0.1 | 최근 항목이 더 높은 점수 |
|
|
432
547
|
| 구체성 | 최대 0.1 | 고유 단어 대 반복 단어 |
|
|
548
|
+
| 원점 | +0.1/−0.05 | 인간의 주장은 부스트, 추론은 약간 감점 |
|
|
433
549
|
|
|
434
550
|
리콜 시 고품질 항목이 먼저 표시됩니다. `memory_stats`로 품질을 확인하세요:
|
|
435
551
|
|
|
@@ -609,7 +725,7 @@ memory_recall({ query: "riesgo", mode: "graph", hops: 2, compact: true })
|
|
|
609
725
|
- 품질 가중 순위가 가장 유용한 항목이 먼저 나타나도록 합니다.
|
|
610
726
|
- 저장된 `.toon` 파일은 **절대** 변경되지 않습니다 — `compact`는 응답만 재구성합니다.
|
|
611
727
|
|
|
612
|
-
> **팁:** 대규모 연결된 메모리에서 리콜할 때 가장 작은 컨텍스트 윈도우를 얻으려면 `compact: true`와 `mode: "graph"`를 결합하세요. 또는 자동으로 수행하는 `memory_smart_recall`을 사용하세요.
|
|
728
|
+
> **팁:** 대규모 연결된 메모리에서 리콜할 때 가장 작은 컨텍스트 윈도우를 얻으려면 `compact: true`와 `mode: "graph"`를 결합하세요. 사전/백그라운드 리콜에는 키 + 한 줄(~50토큰)만 반환하는 `budget: "tiny"`을 사용하세요. 또는 이를 자동으로 수행하는 `memory_smart_recall`을 사용하세요.
|
|
613
729
|
|
|
614
730
|
### 리콜이 결과를 순위 매기는 방식
|
|
615
731
|
|
|
@@ -644,6 +760,57 @@ memory_recall({ query: "riesgo", mode: "graph", hops: 2, compact: true })
|
|
|
644
760
|
|
|
645
761
|
---
|
|
646
762
|
|
|
763
|
+
## 메모리 그래프 뷰어
|
|
764
|
+
|
|
765
|
+
메모리를 인터랙티브한 힘-방향 그래프로 시각화하세요. 항목, 연결, 카테고리, 접근 패턴을 한눈에 볼 수 있습니다.
|
|
766
|
+
|
|
767
|
+
### CLI 뷰어 (독립 HTTP 서버)
|
|
768
|
+
|
|
769
|
+
```bash
|
|
770
|
+
npx toon-memory viewer # HTTP 서버 시작 + 브라우저 열기
|
|
771
|
+
npx toon-memory viewer --port 3001 # 사용자 지정 포트
|
|
772
|
+
npx toon-memory viewer --export # 정적 HTML로 저장
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
연 후 터미널에서 `r`을 눌러 디스크에서 다시 로드하거나, 브라우저에서 `r` / ↻를 눌러 페이지를 새로고침하세요.
|
|
776
|
+
|
|
777
|
+
### 인라인 뷰어 (MCP Apps)
|
|
778
|
+
|
|
779
|
+
MCP Apps 호환 호스트에서 `memory_visualize`를 호출하면 그래프가 인라인으로 렌더링됩니다 — 서버가 필요 없습니다. 뷰어가 채팅 인터페이스 안에 인터랙티브 패널로 나타납니다.
|
|
780
|
+
|
|
781
|
+
### 기능
|
|
782
|
+
|
|
783
|
+
| 상호작용 | 설명 |
|
|
784
|
+
|---|---|
|
|
785
|
+
| **노드에 마우스 오버** | 콘텐츠 미리보기, 품질, 접근 횟수가 있는 툴팁 보기 |
|
|
786
|
+
| **노드 클릭** | 선택 + 중앙 정렬 + 이웃 강조 |
|
|
787
|
+
| **노드 더블 클릭** | 상세 패널 열기 |
|
|
788
|
+
| **노드 드래그** | 수동으로 위치 조정 (마우스 오른쪽 클릭으로 고정 해제) |
|
|
789
|
+
| **검색** | 항목 필터링. 일치하는 노드가 빛나며 맥동 |
|
|
790
|
+
| **⇿ 경로 찾기** | 두 노드를 클릭하여 최단 경로 찾기 및 강조 |
|
|
791
|
+
| **확대/축소/이동** | 마우스 휠 또는 +/− 버튼 |
|
|
792
|
+
| **⚙ 물리** | 전하, 링크 거리, 중심 중력 조정 |
|
|
793
|
+
| **테마 전환** | 다크/라이트 모드 (유지됨) |
|
|
794
|
+
| **내보내기** | 그래프를 PNG 또는 SVG로 저장 |
|
|
795
|
+
|
|
796
|
+
### 스크린샷
|
|
797
|
+
|
|
798
|
+
| 그래프 보기 | 검색 강조 | 경로 찾기 | 상세 패널 |
|
|
799
|
+
|---|---|---|---|
|
|
800
|
+
|  |  |  |  |
|
|
801
|
+
|
|
802
|
+

|
|
803
|
+
|
|
804
|
+
### 직접 스크린샷 캡처하기
|
|
805
|
+
|
|
806
|
+
```bash
|
|
807
|
+
npm run capture:viewer
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
[Playwright](https://playwright.dev) (`npx playwright install chromium`)와 `ffmpeg`가 필요합니다.
|
|
811
|
+
|
|
812
|
+
---
|
|
813
|
+
|
|
647
814
|
## 팁과 모범 사례
|
|
648
815
|
|
|
649
816
|
toon-memory와 잘 작동하는 몇 가지 패턴입니다:
|
|
@@ -678,6 +845,7 @@ memory_remember({
|
|
|
678
845
|
| `pattern` | 관례, 프레임워크, 코딩 스타일 규칙 |
|
|
679
846
|
| `bug` | 수정한 문제와 수정 방법 |
|
|
680
847
|
| `knowledge` | 프로젝트 사실, 도메인 정보, 팀 컨텍스트 |
|
|
848
|
+
| `warning` | "이러지 마세요" — 안티패턴, 지뢰, 피해야 할 실수 (부스트와 함께 리콜됨) |
|
|
681
849
|
|
|
682
850
|
> **팁:** 너무 걱정하지 마세요. 미래의 자신(또는 에이전트)이 알고 싶어 할 것이라면 저장하세요. 구체적인 태그가 있는 상세한 항목은 품질 점수가 더 높습니다.
|
|
683
851
|
|
|
@@ -702,7 +870,7 @@ tags: "api;rest;versioning"
|
|
|
702
870
|
|
|
703
871
|
### 메모리를 깔끔하게 유지
|
|
704
872
|
|
|
705
|
-
`memory_archive()`를 매월 실행하여 오래된 항목을 아카이브로 이동하세요. `memory_stats()`를 실행하여 크기와 품질 분포를 확인하세요. 저품질 항목(모호한 콘텐츠, 태그 없음)은 자동으로 리콜 우선순위가 낮아집니다. 중복을 병합하려면 `memory_consolidate`를
|
|
873
|
+
`memory_archive()`를 매월 실행하여 오래된 항목을 아카이브로 이동하세요. `memory_stats()`를 실행하여 크기와 품질 분포를 확인하세요. 저품질 항목(모호한 콘텐츠, 태그 없음)은 자동으로 리콜 우선순위가 낮아집니다. 중복을 병합하려면 `memory_consolidate`를 사용하고, 더 새로운 라이브러리 버전에 대체된 메모는 `mode: "versions"`로 은퇴시키세요.
|
|
706
874
|
|
|
707
875
|
---
|
|
708
876
|
|
|
@@ -716,6 +884,9 @@ npx toon-memory status # 설치 상태 확인
|
|
|
716
884
|
npx toon-memory stats # 메모리 통계 보기
|
|
717
885
|
npx toon-memory export # 메모리를 JSON으로 내보내기
|
|
718
886
|
npx toon-memory import <file> # JSON에서 메모리 가져오기
|
|
887
|
+
npx toon-memory viewer # 메모리 그래프 뷰어 열기 (HTTP 서버)
|
|
888
|
+
npx toon-memory viewer --export # 뷰어를 정적 HTML로 저장
|
|
889
|
+
npx toon-memory viewer --port 3001 # 사용자 지정 포트
|
|
719
890
|
npx toon-memory watch [options] # 옵션과 함께 자동 백업
|
|
720
891
|
npx toon-memory upgrade # 최신 버전으로 업데이트
|
|
721
892
|
npx toon-memory uninstall # 모든 에이전트에서 제거
|
|
@@ -921,10 +1092,10 @@ args = ["-y", "toon-memory", "mcp"]
|
|
|
921
1092
|
|
|
922
1093
|
```
|
|
923
1094
|
version: 1
|
|
924
|
-
entries[3|]{id|category|key|content|file|tags|date|ttl|accessed|links|quality|confidence}:
|
|
925
|
-
a1b2c3d4|decision|use-zod|Use Zod for validation|src/types.ts|validation;types|2026-07-10||0||0.65|1.0
|
|
926
|
-
e5f6g7h8|pattern|pydantic-configs|Project uses Pydantic v2|config.py|python;patterns|2026-07-10||0||0.55|1.0
|
|
927
|
-
i9j0k1l2|bug|redis-pool-fix|Added max_connections=20 (see [[use-zod]])|redis.ts|redis;fix|2026-07-10|7d|0|use-zod|0.70|0.9
|
|
1095
|
+
entries[3|]{id|category|key|content|file|tags|date|ttl|accessed|links|quality|confidence|lastAccessed|priority|path_scope|origin|status}:
|
|
1096
|
+
a1b2c3d4|decision|use-zod|Use Zod for validation|src/types.ts|validation;types|2026-07-10||0||0.65|1.0||0||agent|active
|
|
1097
|
+
e5f6g7h8|pattern|pydantic-configs|Project uses Pydantic v2|config.py|python;patterns|2026-07-10||0||0.55|1.0||0||agent|active
|
|
1098
|
+
i9j0k1l2|bug|redis-pool-fix|Added max_connections=20 (see [[use-zod]])|redis.ts|redis;fix|2026-07-10|7d|0|use-zod|0.70|0.9||0||agent|active
|
|
928
1099
|
summaries:
|
|
929
1100
|
src/services/redis.ts: Redis connection pool with retry logic
|
|
930
1101
|
```
|
|
@@ -967,7 +1138,7 @@ TOON (Token-Oriented Object Notation)은 LLM을 위해 설계되었습니다:
|
|
|
967
1138
|
- **더 나은 LLM 이해도** — AI 소비를 위한 구조화
|
|
968
1139
|
- **품질 및 신뢰도** — 모든 항목이 구조 품질(0–1)과 신뢰성(0–1)을 자동으로 추적
|
|
969
1140
|
|
|
970
|
-
> **팁:** 적은 토큰
|
|
1141
|
+
> **팁:** 적은 토큰 = 더 빠른 응답 + 더 낮은 API 비용. 에이전트는 매 세션 시작 시 메모리 파일을 읽으므로 효율성이 중요합니다.
|
|
971
1142
|
|
|
972
1143
|
---
|
|
973
1144
|
|
|
@@ -1075,6 +1246,33 @@ context_export (주입 가능 md) 1,178 218 81.5% 3 → 1
|
|
|
1075
1246
|
|
|
1076
1247
|
> **팁:** `memory_smart_recall`은 BM25 + 그래프 + 품질을 하나의 호출로 결합하여 토큰과 도구 호출 오버헤드를 모두 절약합니다. 모든 작업 시작 시 사용하세요.
|
|
1077
1248
|
|
|
1249
|
+
### RRF 순위 벤치마크 (측정)
|
|
1250
|
+
|
|
1251
|
+
v3.7.0부터 리콜은 BM25(×3)와 그래프 중심성 순위를 **Reciprocal Rank Fusion**으로 순위를 매기며, 적응형 `k = clamp(3..60, round(sqrt(n)))`를 사용합니다. 손으로 라벨링된 관련성을 가진 골드 표준 쿼리 8개로 측정했습니다 (`scripts/bench-rrf.mjs`, `npm run bench:rrf` 참조):
|
|
1252
|
+
|
|
1253
|
+
```
|
|
1254
|
+
Metric linear (v3.6.x) RRF (v3.7.0)
|
|
1255
|
+
──────────── ───────────────── ────────────────
|
|
1256
|
+
nDCG@10 0.776 0.776 (parity)
|
|
1257
|
+
MRR 0.917 0.917 (parity)
|
|
1258
|
+
```
|
|
1259
|
+
|
|
1260
|
+
RRF는 **순위 비용 제로**로 이전 선형 가중 점수와 일치하면서 점수 파이프라인을 단순화합니다 (BM25×3 + 중심성, 중요도/최신성 노이즈 없음). 그래프 모드의 대체가 존중됩니다: 폐기된 항목은 `as_of` 시점 쿼리를 제외하고 계속 제외됩니다.
|
|
1261
|
+
|
|
1262
|
+
### 리콜 벤치마크 (LongMemEval 스타일, 측정)
|
|
1263
|
+
|
|
1264
|
+
v4.1.0부터 리콜은 **실제 프로젝트 메모리의 고정 스냅샷**에 대해 벤치마크됩니다 — 손으로 작성한 골드 쿼리가 있는 LongMemEval 스타일 테스트 세트. 코퍼스: 실제 `data.toon` 항목 187개(스냅샷 `2026-08-01`), 6개 카테고리의 골드 쿼리 42개(core-fact, temporal, knowledge-updating, multi-hop, meta/session, distractor). 측정 코드는 esbuild로 인메모리 번들링된 **프로덕션 파이프라인**(`src/lib`)입니다 — 원본 복사본이 아닙니다. 결정론적 `today` 매개변수가 최신성/감쇠를 고정하여 결과가 벽시계에 따라 흔들리지 않습니다. 실행은 읽기 전용입니다(접근 추적 없음). 데이터 파일 자체를 설명하는 우선순위 메타 항목 2개는 제외됩니다. `benchmarks/retrieval-corpus.toon`, `benchmarks/gold-queries.json`(`npm run bench:retrieval`) 참조:
|
|
1265
|
+
|
|
1266
|
+
```
|
|
1267
|
+
Mode R@5 nDCG@5 MRR@5 answerable
|
|
1268
|
+
───────────── ───── ───── ───── ──────────
|
|
1269
|
+
linear 0.643 0.654 0.776 81.0%
|
|
1270
|
+
rrf 0.861 0.764 0.788 97.6%
|
|
1271
|
+
smart (unified) 0.829 0.739 0.760 92.5%
|
|
1272
|
+
```
|
|
1273
|
+
|
|
1274
|
+
RRF가 최상위 모드입니다 (0.861 R@5, 쿼리의 97.6%가 상위 5개에서 답변 가능). `memory_smart_recall`은 단일 호출로 경쟁력을 유지합니다.
|
|
1275
|
+
|
|
1078
1276
|
---
|
|
1079
1277
|
|
|
1080
1278
|
## 문제 해결
|
|
@@ -1167,7 +1365,18 @@ toon-memory/
|
|
|
1167
1365
|
│ │ ├── setup.ts # CLI 명령어
|
|
1168
1366
|
│ │ └── toon-memory.ts # CLI 러너
|
|
1169
1367
|
│ ├── mcp/
|
|
1170
|
-
│ │
|
|
1368
|
+
│ │ ├── server.ts # MCP 서버 (도구 35개 + 리소스 4개 + 프롬프트 1개)
|
|
1369
|
+
│ │ ├── tools.ts # 도구 등록 (도구 35개)
|
|
1370
|
+
│ │ ├── resources.ts # 리소스 등록 (리소스 4개)
|
|
1371
|
+
│ │ ├── prompts.ts # 프롬프트 등록 (프롬프트 1개)
|
|
1372
|
+
│ │ ├── session-store.ts # 세션 계층 (자동 승격, 정리)
|
|
1373
|
+
│ │ ├── memory-io.ts # 메모리 파일 읽기/쓰기
|
|
1374
|
+
│ │ ├── entries.ts # 항목 파싱 및 유틸리티
|
|
1375
|
+
│ │ ├── scoring.ts # 항목 점수 및 접근 추적
|
|
1376
|
+
│ │ ├── archive.ts # 아카이브 관리
|
|
1377
|
+
│ │ ├── consolidation.ts # 중복 통합
|
|
1378
|
+
│ │ ├── config.ts # 설정 로드 및 저장
|
|
1379
|
+
│ │ └── crypto.ts # AES-256-GCM 암호화
|
|
1171
1380
|
│ ├── lib/
|
|
1172
1381
|
│ │ ├── lock.ts # 조언 파일 잠금 + 원자적 쓰기
|
|
1173
1382
|
│ │ ├── sessions.ts # 다세션 협업
|
|
@@ -1203,6 +1412,20 @@ toon-memory/
|
|
|
1203
1412
|
|
|
1204
1413
|
---
|
|
1205
1414
|
|
|
1415
|
+
## 보안 및 개인정보
|
|
1416
|
+
|
|
1417
|
+
toon-memory는 보안과 개인정보 보호를 핵심 원칙으로 설계되었습니다.
|
|
1418
|
+
|
|
1419
|
+
- **100% 로컬 저장** — 모든 메모리는 `.toon-memory/memory/`의 로컬 머신에 저장됩니다. 데이터가 외부 서버, 클라우드 서비스, 제3자에게 전송되지 않습니다.
|
|
1420
|
+
- **텔레메트리 없음** — 이 프로젝트는 어떤 종류의 텔레메트리, 분석, 추적도 없습니다. 사용 데이터가 수집되지 않습니다.
|
|
1421
|
+
- **원격 코드 실행 없음** — toon-memory는 stdio를 통한 표준 MCP 서버로 실행됩니다. 원격 코드를 다운로드, 실행, 평가하지 않습니다.
|
|
1422
|
+
- **저장 데이터 암호화** — 전체 메모리 파일에 대한 선택적 AES-256-GCM 암호화. `memory_encrypt`로 활성화(`TOON_MEMORY_KEY` 환경 변수 필요).
|
|
1423
|
+
- **암호화 키는 저장되지 않음** — 암호화 키는 환경 변수로 제공되어야 하며 toon-memory가 영구 저장하지 않습니다. 분실하면 데이터를 복구할 수 없습니다.
|
|
1424
|
+
- **프로젝트별 격리** — 각 프로젝트는 고유한 격리된 메모리 파일을 가집니다. 메모리는 프로젝트 간에 유출되지 않습니다.
|
|
1425
|
+
- **자동 `.gitignore`** — 설치기가 `.toon-memory/memory/`를 `.gitignore`에 추가하여 메모리 데이터의 우발적 커밋을 방지합니다.
|
|
1426
|
+
|
|
1427
|
+
---
|
|
1428
|
+
|
|
1206
1429
|
## 라이선스
|
|
1207
1430
|
|
|
1208
1431
|
MIT
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# toon-memory
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> Give your AI coding agent a memory that outlasts the session — decisions, patterns, and bugs remembered across every session.
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/toon-memory)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
Ever had that feeling where your AI agent forgets everything from yesterday's session? You explain the same architecture decision for the third time, and it still suggests the approach you already rejected?
|
|
42
42
|
|
|
43
|
-
**toon-memory fixes this.** It gives your AI agent a
|
|
43
|
+
**toon-memory fixes this.** It gives your AI agent continuity — a memory that survives restarts, so it actually learns from your project over time. You never re-explain the same decision twice.
|
|
44
44
|
|
|
45
45
|
📖 **[Read the documentation](https://luiggival08.github.io/toon-memory/)**
|
|
46
46
|
|
|
@@ -65,7 +65,7 @@ Read [How toon-memory Makes Your AI Agent Smarter](https://luiggival08.github.io
|
|
|
65
65
|
|
|
66
66
|
## Features
|
|
67
67
|
|
|
68
|
-
- **
|
|
68
|
+
- **A complete memory toolkit** — Full memory management via Model Context Protocol, including `memory_smart_recall` (unified recall with session bias), `memory_sessions` for multi-session coordination, `context_*` tools for one-call context generation (briefing, diff, focus, health audit, export), `memory_compress` (LLM-powered compression), `memory_consolidate` (deterministic dedup/merge/cleanup), `memory_primer` (auto-injected context), `memory_merge_sessions` (cross-session merge), `memory_pin`/`memory_unpin` (pin important entries with priority 1-5), `memory_checkpoint` (session snapshot with 7d TTL), `memory_search` (unified search with tag filters + session bias), `memory_tag` (batch tag operations), `memory_export_gist`/`memory_import_gist` (GitHub Gist sync), `memory_forget` (soft/hard delete, restore, supersede), `memory_reflect` (staleness/quality reflection), and `memory_promote` (auto-promote low-confidence drafts)
|
|
69
69
|
- **MCP Resources** — Read memory as context without tool invocations, including a System Primer (auto-generated knowledge map)
|
|
70
70
|
- **15 agents supported** — OpenCode, VS Code, Claude Code, Cursor, Windsurf, Cline, Continue, Codex CLI, Gemini CLI, Zed, Antigravity, Aider, KiloCode, OpenClaw, Kiro
|
|
71
71
|
- **Interactive installer** — Select which agents to configure from a menu
|
|
@@ -107,6 +107,12 @@ Read [How toon-memory Makes Your AI Agent Smarter](https://luiggival08.github.io
|
|
|
107
107
|
- **Memory reflect** — `memory_reflect` ranks entries by staleness, quality, and over-connection to surface what needs attention or cleanup. Deterministic, zero LLM
|
|
108
108
|
- **Memory supersede** — `memory_forget(key, action: "supersede", new_key)` marks an entry as replaced by a newer one (`superseded_by` link + `supersededOn` date). `memory_recall({ as_of })` re-includes old entries for point-in-time queries before their supersession
|
|
109
109
|
- **Auto-promote** — `memory_promote` promotes low-confidence drafts to active entries deterministically (threshold 0.65, Jaccard dedup), with `dryRun` by default
|
|
110
|
+
- **Explain WHY** — `memory_recall`/`memory_smart_recall` accept `explain: true` and append a deterministic reason line to every returned entry (`↳ 100% relevance · used 14× · used today · importance HIGH`) — *why* it was retrieved, no LLM
|
|
111
|
+
- **Token budgets** — `budget_tokens` caps the recall output by estimated token count; entries accumulate greedily and the tail that would exceed the budget is dropped (`0` = no limit)
|
|
112
|
+
- **Version supersession** — `memory_consolidate(mode: "versions")` detects entries describing the same subject at different library versions (e.g. "Use React 18" vs "Use React 19") and retires the older ones in favor of the newest
|
|
113
|
+
- **Negative memories** — a `warning` category for "do NOT do this" facts; `warning` entries get a recall boost so the agent sees the landmines before repeating them
|
|
114
|
+
- **Language + folder ranking** — recall boosts entries written in the same script family (latin/CJK/cyrillic/…) and entries whose `path_scope` matches the current file
|
|
115
|
+
- **Explicit importance** — `memory_remember({ importance })` sets `critical`, `high`, `medium`, or `low`. Critical decisions surface first (+0.3), low notes stay out of the way (−0.1); empty = auto (recency + frequency). Re-saving keeps the higher level
|
|
110
116
|
|
|
111
117
|
---
|
|
112
118
|
|
|
@@ -228,11 +234,11 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
|
228
234
|
|
|
229
235
|
| Tool | Description |
|
|
230
236
|
|------|-------------|
|
|
231
|
-
| `memory_remember` | Save a decision, pattern, bug, or
|
|
232
|
-
| `memory_recall` | Search memory (use BEFORE reading files, filters expired TTL). `mode: "graph"` expands a relationship-aware subgraph for higher precision. `budget: "tiny"|"normal"|"deep"` controls output verbosity (backward compat with `compact: true`). `path_scope` filters by glob pattern. `sessionBias` boosts entries from the current git branch. Quality-weighted ranking |
|
|
233
|
-
| `memory_smart_recall` | **Unified recall**: BM25 + graph + decay + quality in one call. `sessionBias` boosts entries from the current git branch. Use at the START of every task. Returns compact, token-efficient output |
|
|
237
|
+
| `memory_remember` | Save a decision, pattern, bug, knowledge, or **warning** (negative "do NOT do this" memory, recalled with a boost) — optional TTL, auto-tag inference, `links` to build the memory graph, merge-dedup on same key, auto quality score and confidence |
|
|
238
|
+
| `memory_recall` | Search memory (use BEFORE reading files, filters expired TTL). `mode: "graph"` expands a relationship-aware subgraph for higher precision. `budget: "tiny"|"normal"|"deep"` controls output verbosity (backward compat with `compact: true`). `path_scope` filters by glob pattern. `sessionBias` boosts entries from the current git branch. `explain: true` appends a per-entry reason line (why it was retrieved). `budget_tokens` caps output by estimated tokens (`0` = no limit). Quality-weighted ranking |
|
|
239
|
+
| `memory_smart_recall` | **Unified recall**: BM25 + graph + decay + quality in one call. `sessionBias` boosts entries from the current git branch. `explain: true` appends per-entry reasons, `budget_tokens` caps output by estimated tokens. Use at the START of every task. Returns compact, token-efficient output |
|
|
234
240
|
| `memory_forget` | **Lifecycle ops** by key or id: `action: "soft"` (default) marks obsolete, `"hard"` permanently removes, `"restore"` brings back to active, `"supersede"` retires it with a `superseded_by` link to `new_key` |
|
|
235
|
-
| `memory_stats` | View memory state (including TTL stats, quality distribution, origin/status breakdown,
|
|
241
|
+
| `memory_stats` | View memory state (including TTL stats, quality distribution, origin/status breakdown, cold memories below quality/access thresholds, and **hit rate / duplicate / obsolete** metrics) |
|
|
236
242
|
| `memory_summary` | Save/retrieve file summaries |
|
|
237
243
|
| `memory_archive` | Archive old entries (>30 days) and expired TTL entries |
|
|
238
244
|
| `memory_diff` | Show changes since a date (24h, 7d, or exact date) |
|
|
@@ -242,7 +248,7 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
|
242
248
|
| `memory_backup` | Create timestamped backup of memory file (auto-prunes to 10 most recent) |
|
|
243
249
|
| `memory_captured` | List activity auto-captured by hooks (opt-in) or clear the log |
|
|
244
250
|
| `memory_checkpoint` | **Session checkpoint**: creates a snapshot of current memory state with 7d TTL. Useful for rollback reference during long sessions |
|
|
245
|
-
| `memory_consolidate` | **Cleanup ops**, deterministic (no LLM): `mode: "identical"` (default) dedupes identical-content entries, `"similar"` merges near-duplicates (Jaccard >50%), `"low-quality"` batch-removes low-quality entries (`minQuality`, `dryRun`) |
|
|
251
|
+
| `memory_consolidate` | **Cleanup ops**, deterministic (no LLM): `mode: "identical"` (default) dedupes identical-content entries, `"similar"` merges near-duplicates (Jaccard >50%), `"low-quality"` batch-removes low-quality entries (`minQuality`, `dryRun`), `"versions"` retires older library-version entries in favor of the newest |
|
|
246
252
|
| `memory_sessions` | Show active agent sessions (branch, files, last-seen) and soft conflicts for parallel work |
|
|
247
253
|
| `memory_compress` | LLM-powered two-step compression: summarize + overwrite. Uses `anthropic`/`openai` CLI if available, otherwise returns prompt for manual compression |
|
|
248
254
|
| `memory_primer` | One-call context primer: top memories + categories + session file changes. Auto-injected at session start |
|
|
@@ -314,6 +320,21 @@ memory_remember({
|
|
|
314
320
|
|
|
315
321
|
> **Tip:** Use TTL for temporary context like deadlines, sprint info, or time-sensitive notes. Entries with expired TTL are automatically filtered from search results.
|
|
316
322
|
|
|
323
|
+
#### Set explicit importance
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
memory_remember({
|
|
327
|
+
category: "decision",
|
|
328
|
+
key: "db-choice",
|
|
329
|
+
content: "We chose Postgres over MySQL — JSONB for flexible schemas, better extension ecosystem",
|
|
330
|
+
importance: "critical"
|
|
331
|
+
})
|
|
332
|
+
// 🧠 Guardado: decision/db-choice (a1b2c3d4)
|
|
333
|
+
// 🎯 Importance: critical (+0.3 boost) — surfaces above routine entries
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
> **Tip:** Mark foundational decisions `critical` so they always rank near the top of recall. `importance` accepts `critical`, `high`, `medium`, or `low`; leave it empty to let the system rank by recency and frequency automatically.
|
|
337
|
+
|
|
317
338
|
#### Auto-inferred tags
|
|
318
339
|
|
|
319
340
|
```typescript
|
|
@@ -414,6 +435,28 @@ memory_smart_recall({ intent: "diseño de base de datos para backend" })
|
|
|
414
435
|
|
|
415
436
|
> **Tip:** Use `memory_smart_recall` at the START of every task. It combines BM25 + graph + decay + quality in one call — no need to guess what to search for.
|
|
416
437
|
|
|
438
|
+
#### Explain WHY a result was returned
|
|
439
|
+
|
|
440
|
+
```typescript
|
|
441
|
+
memory_recall({ query: "redis", explain: true })
|
|
442
|
+
// [decision] redis-cache-config (a1b2c3d4)
|
|
443
|
+
// Redis cache layer for session storage
|
|
444
|
+
// File: src/cache.ts | Tags: redis;cache | Date: 2026-07-10
|
|
445
|
+
// ↳ 92% relevance · used 14× · used today · importance HIGH
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
The `↳` reason line is deterministic (relevance %, access count, last-used, importance) — no LLM involved. Use `explain: true` when you want to know *why* the agent was shown those entries.
|
|
449
|
+
|
|
450
|
+
#### Cap output with `budget_tokens`
|
|
451
|
+
|
|
452
|
+
```typescript
|
|
453
|
+
memory_recall({ query: "redis", budget_tokens: 300 })
|
|
454
|
+
// Entries accumulate greedily; the tail that would exceed the estimate is dropped.
|
|
455
|
+
// budget_tokens: 0 (default) = no limit.
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
> **Tip:** Combine `budget_tokens` with `budget: "deep"` for a context window that stays inside a hard token ceiling regardless of memory size.
|
|
459
|
+
|
|
417
460
|
#### Full project briefing (one call)
|
|
418
461
|
|
|
419
462
|
```typescript
|
|
@@ -801,6 +844,7 @@ The entry automatically gets a quality score based on its structure (tags, conte
|
|
|
801
844
|
| `pattern` | Conventions, frameworks, code style rules |
|
|
802
845
|
| `bug` | Issues you fixed and how |
|
|
803
846
|
| `knowledge` | Project facts, domain info, team context |
|
|
847
|
+
| `warning` | "Do NOT do this" — anti-patterns, landmines, mistakes to avoid (recalled with a boost) |
|
|
804
848
|
|
|
805
849
|
> **Tip:** Don't overthink it. If it's something your future self (or agent) would want to know, save it. Detailed entries with specific tags score higher in quality.
|
|
806
850
|
|
|
@@ -825,7 +869,7 @@ tags: "api;rest;versioning"
|
|
|
825
869
|
|
|
826
870
|
### Keep memory clean
|
|
827
871
|
|
|
828
|
-
Run `memory_archive()` monthly to move old entries to the archive. Run `memory_stats()` to check the size and quality distribution. Low-quality entries (vague content, no tags) get lower recall priority automatically. Use `memory_consolidate` to merge duplicates.
|
|
872
|
+
Run `memory_archive()` monthly to move old entries to the archive. Run `memory_stats()` to check the size and quality distribution. Low-quality entries (vague content, no tags) get lower recall priority automatically. Use `memory_consolidate` to merge duplicates and `mode: "versions"` to retire notes superseded by newer library versions.
|
|
829
873
|
|
|
830
874
|
---
|
|
831
875
|
|