@crewx/memory 0.1.2 → 0.1.3
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/SKILL.md +556 -0
- package/package.json +3 -3
package/SKILL.md
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-v2
|
|
3
|
+
description: 마크다운 + 프론트매터 기반 장기 기억 스킬. 드릴다운 구조로 확장성 있는 기억 관리.
|
|
4
|
+
version: 0.10.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Memory V2 Skill
|
|
8
|
+
|
|
9
|
+
마크다운 + 프론트매터 기반의 장기 기억 관리 스킬입니다.
|
|
10
|
+
|
|
11
|
+
## 설치
|
|
12
|
+
|
|
13
|
+
`packages/built-in/memory`에 포함되어 있으며, `npx memory` 명령으로 사용합니다.
|
|
14
|
+
|
|
15
|
+
## 특징
|
|
16
|
+
|
|
17
|
+
- **프론트매터**: 메타데이터 분리 (날짜, 카테고리, 태그, 토픽)
|
|
18
|
+
- **드릴다운**: index.md → entries/ 구조
|
|
19
|
+
- **가독성**: 사람이 직접 읽고 편집 가능
|
|
20
|
+
- **Git 친화적**: 개별 파일로 버전 관리
|
|
21
|
+
|
|
22
|
+
## 커맨드 Alias
|
|
23
|
+
|
|
24
|
+
자주 쓰는 커맨드의 단축 별칭입니다. 기존 커맨드와 동일하게 동작합니다.
|
|
25
|
+
|
|
26
|
+
| Alias | 실제 커맨드 | 설명 |
|
|
27
|
+
|-------|-----------|------|
|
|
28
|
+
| `read` | `get` | 기억 상세 조회 |
|
|
29
|
+
| `list` | `index` | 전체 인덱스 보기 |
|
|
30
|
+
| `rm` | `delete` | 기억 삭제 |
|
|
31
|
+
| `ls` | `recent` | 최근 기억 보기 |
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# 아래 두 명령은 동일
|
|
35
|
+
npx memory get agent_id ABC123
|
|
36
|
+
npx memory read agent_id ABC123
|
|
37
|
+
|
|
38
|
+
npx memory index agent_id
|
|
39
|
+
npx memory list agent_id
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 디렉토리 구조
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
memory/
|
|
46
|
+
└── {agent_id}/
|
|
47
|
+
├── summary.md # 전체 요약 (토픽별 섹션 + entries/ 링크)
|
|
48
|
+
├── graph.json # 그래프 데이터
|
|
49
|
+
└── entries/ # 개별 기억들
|
|
50
|
+
└── {id}.md # 파일명 = nanoid (예: QOSIOs.md)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> **파일명 규칙**: `{id}.md` (예: `QOSIOs.md`). 날짜·제목 등 메타데이터는 프론트매터에 있으므로 파일명에 중복하지 않습니다. 토큰 절약 + 파일명 충돌 방지.
|
|
54
|
+
|
|
55
|
+
## 명령어
|
|
56
|
+
|
|
57
|
+
### 저장
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx memory save <agent_id> "<summary>" [category] [--topic=xxx] [--tags=a,b,c] [--body="상세 내용"]
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**옵션:**
|
|
64
|
+
| 옵션 | 설명 | 예시 |
|
|
65
|
+
|------|------|------|
|
|
66
|
+
| `category` | 기억 분류 | decision, task, project, schedule, context, preference, general |
|
|
67
|
+
| `--topic` | 토픽 그룹 | `--topic=crewx-strategy` |
|
|
68
|
+
| `--tags` | 태그 (쉼표 구분) | `--tags=gemini,pricing` |
|
|
69
|
+
| `--body` | **상세 내용 (권장!)** | `--body="배경, 근거, 결정사항 등"` |
|
|
70
|
+
|
|
71
|
+
**⚠️ 중요: `--body` 옵션을 반드시 사용하세요!**
|
|
72
|
+
- `--body` 없으면 플레이스홀더만 저장됨
|
|
73
|
+
- 나중에 맥락 파악이 어려워짐
|
|
74
|
+
- 최소 1-2문장 이상 상세 내용 권장
|
|
75
|
+
|
|
76
|
+
**예시:**
|
|
77
|
+
```bash
|
|
78
|
+
# ❌ 나쁜 예 - 상세 없음
|
|
79
|
+
npx memory save cto "Gemini 3.0 Flash 모먼트" decision --topic=crewx-strategy
|
|
80
|
+
|
|
81
|
+
# ✅ 좋은 예 - 상세 포함
|
|
82
|
+
npx memory save cto "Gemini 3.0 Flash 모먼트 - 전략적 분기점" decision --topic=crewx-strategy --tags=gemini,pricing --body="SWE-bench 78%로 Claude 3.5 Sonnet(49%) 압도. 가격은 1/6. CrewX 전략 검증됨 - 오케스트레이션이 핵심 해자."
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 인덱스 조회
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx memory index <agent_id> # 중기기억 (토픽 요약만)
|
|
89
|
+
npx memory index <agent_id> --recent # 최근 엔트리 목록
|
|
90
|
+
npx memory index <agent_id> --full # 전체 보기
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**드릴다운 패턴:** `index` → 필요한 토픽만 `topic` → 필요한 엔트리만 `get`
|
|
94
|
+
|
|
95
|
+
### 토픽 드릴다운
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx memory topic <agent_id> <topic_name>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 최근 기억
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx memory recent <agent_id> [days=30]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### 키워드 검색 (빠름)
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx memory find <agent_id> "<keyword>"
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
grep 기반 문자열 매칭. 빠르고 무료.
|
|
114
|
+
|
|
115
|
+
### 시맨틱 검색 (AI)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npx memory search <agent_id> "<질문>"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Gemini 2.0 Flash** 기반 시맨틱 검색. 유사어/맥락 이해.
|
|
122
|
+
|
|
123
|
+
- 스킬 내부 `@memory_searcher` 에이전트 사용 (crewx.yaml)
|
|
124
|
+
- 비용: ~$0.015/1M tokens (거의 무료)
|
|
125
|
+
|
|
126
|
+
**예시:**
|
|
127
|
+
```bash
|
|
128
|
+
# 키워드 검색 (빠름)
|
|
129
|
+
npx memory find crewx_dev_lead "에이전트"
|
|
130
|
+
|
|
131
|
+
# 시맨틱 검색 (AI)
|
|
132
|
+
npx memory search crewx_dev_lead "작업 배정할 때 주의할 점"
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 상세 조회 (드릴다운)
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npx memory get <agent_id> <memory_id>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 기억 수정 (update)
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
npx memory update <agent_id> <memory_id> [옵션]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**옵션:**
|
|
148
|
+
| 옵션 | 설명 |
|
|
149
|
+
|------|------|
|
|
150
|
+
| `--summary` | 요약 수정 |
|
|
151
|
+
| `--body` | 상세 내용 수정 |
|
|
152
|
+
| `--topic` | 토픽 변경 |
|
|
153
|
+
| `--category` | 카테고리 변경 |
|
|
154
|
+
| `--tags` | 태그 변경 (쉼표 구분) |
|
|
155
|
+
|
|
156
|
+
**예시:**
|
|
157
|
+
```bash
|
|
158
|
+
# 요약과 상세 내용 수정
|
|
159
|
+
npx memory update cto VkY9X6 --summary="수정된 요약" --body="수정된 상세 내용"
|
|
160
|
+
|
|
161
|
+
# 토픽만 변경
|
|
162
|
+
npx memory update cto VkY9X6 --topic=new-topic
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
### 기억 삭제 (delete)
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npx memory delete <agent_id> <memory_id> [--force]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
- `--force` 없으면 확인 메시지만 출력
|
|
172
|
+
- `--force` 있으면 실제 삭제
|
|
173
|
+
|
|
174
|
+
**예시:**
|
|
175
|
+
```bash
|
|
176
|
+
# 삭제 확인
|
|
177
|
+
npx memory delete cto VkY9X6
|
|
178
|
+
|
|
179
|
+
# 실제 삭제
|
|
180
|
+
npx memory delete cto VkY9X6 --force
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 기억 병합 (merge)
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
npx memory merge <agent_id> <memory_id1> <memory_id2> [--summary="병합 요약"]
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
- 두 기억을 하나로 병합
|
|
190
|
+
- 원본 두 기억은 삭제됨
|
|
191
|
+
- 태그는 합쳐짐 (중복 제거)
|
|
192
|
+
- 병합된 파일에 `merged_from` 메타데이터 추가
|
|
193
|
+
|
|
194
|
+
**예시:**
|
|
195
|
+
```bash
|
|
196
|
+
# 두 기억 병합
|
|
197
|
+
npx memory merge cto abc123 def456
|
|
198
|
+
|
|
199
|
+
# 커스텀 요약으로 병합
|
|
200
|
+
npx memory merge cto abc123 def456 --summary="VLM 파인튜닝 종합 정리"
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 요약 생성 (summarize)
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npx memory summarize <agent_id> [--force]
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
MemGAS 증분 요약 방식을 적용한 기억 요약 기능입니다.
|
|
210
|
+
|
|
211
|
+
**구조:**
|
|
212
|
+
- `summary.md` 1개에 토픽별 요약 + entries/ 상대경로 링크
|
|
213
|
+
- `save`/`delete` 실행 시 자동으로 summary.md 갱신
|
|
214
|
+
- `summarize`는 수동 트리거용 (자동 갱신 실패 시 또는 `--force`로 전체 재생성)
|
|
215
|
+
|
|
216
|
+
**증분 추적:**
|
|
217
|
+
- 프론트매터에 `last_entry_id` 저장
|
|
218
|
+
- 다음 실행 시 해당 ID 이후 엔트리만 추출하여 요약에 반영
|
|
219
|
+
- `@memory_summarizer` (Haiku) 에이전트가 요약 생성
|
|
220
|
+
- AI 호출 실패 시 bullet-point 폴백
|
|
221
|
+
|
|
222
|
+
**옵션:**
|
|
223
|
+
| 옵션 | 설명 |
|
|
224
|
+
|------|------|
|
|
225
|
+
| `--force` | 전체 재생성 (증분 무시) |
|
|
226
|
+
|
|
227
|
+
**예시:**
|
|
228
|
+
```bash
|
|
229
|
+
# 증분 요약 (새 엔트리만 반영)
|
|
230
|
+
npx memory summarize ui_devlead
|
|
231
|
+
|
|
232
|
+
# 강제 전체 재생성
|
|
233
|
+
npx memory summarize ui_devlead --force
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### 요약 생성 (summarize-dirty)
|
|
237
|
+
|
|
238
|
+
`save`/`delete`는 동기 summarize 대신 **dirty flag**만 생성하며, cron과 연동해 dirty가 있는 에이전트만 비동기로 summary를 갱신합니다.
|
|
239
|
+
cron이 매 1분마다 체크하여 실행합니다.
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
npx memory summarize-dirty
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**cron 등록 예시:**
|
|
246
|
+
```bash
|
|
247
|
+
npx cron add "*/1 * * * *" "npx memory summarize-dirty" --mode command --name "memory-debounce"
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**summary.md 포맷:**
|
|
251
|
+
```markdown
|
|
252
|
+
---
|
|
253
|
+
last_entry_id: QOSIOs
|
|
254
|
+
last_updated: 2026-02-16
|
|
255
|
+
entry_count: 48
|
|
256
|
+
summarizer: haiku
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## mcp-http (4건)
|
|
260
|
+
MCP HTTP 엔드포인트 구현 완료...
|
|
261
|
+
→ [entries/HYpwPP.md](entries/HYpwPP.md)
|
|
262
|
+
→ [entries/ImH-56.md](entries/ImH-56.md)
|
|
263
|
+
|
|
264
|
+
## cli-service (3건)
|
|
265
|
+
CLI 쉘환경 감지 성능 개선...
|
|
266
|
+
→ [entries/a3cOL8.md](entries/a3cOL8.md)
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### 파일명 마이그레이션 (migrate)
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
npx memory migrate <agent_id>
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
기존 한글 slug 파일명(`2026-02-16-한글slug.md`)을 ID 기반(`QOSIOs.md`)으로 일괄 변환합니다.
|
|
276
|
+
|
|
277
|
+
- 각 .md 파일의 프론트매터에서 `id` 읽고 → `{id}.md`로 리네이밍
|
|
278
|
+
- 완료 후 summary.md 자동 재생성 + 그래프 갱신
|
|
279
|
+
- 이미 ID 파일명인 파일은 스킵
|
|
280
|
+
|
|
281
|
+
**예시:**
|
|
282
|
+
```bash
|
|
283
|
+
npx memory migrate ui_devlead
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## 프론트매터 스키마
|
|
287
|
+
|
|
288
|
+
```yaml
|
|
289
|
+
---
|
|
290
|
+
id: yLC8Iv # nanoid 6자리
|
|
291
|
+
date: 2025-12-23
|
|
292
|
+
category: decision
|
|
293
|
+
tags: ["strategy", "gemini"]
|
|
294
|
+
topic: crewx-strategy
|
|
295
|
+
summary: "한 줄 요약"
|
|
296
|
+
---
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## 에이전트 프롬프트 가이드
|
|
300
|
+
|
|
301
|
+
```markdown
|
|
302
|
+
<memory-v2-guide agent_id="{{agent_id}}">
|
|
303
|
+
# Memory V2 사용 가이드
|
|
304
|
+
|
|
305
|
+
## 대화 시작 시 (필수!)
|
|
306
|
+
```bash
|
|
307
|
+
# 중기기억 로드 (토픽 요약 + 드릴다운 안내)
|
|
308
|
+
npx memory index {{agent_id}}
|
|
309
|
+
|
|
310
|
+
# 필요시 드릴다운
|
|
311
|
+
npx memory index {{agent_id}} --recent # 최근 목록
|
|
312
|
+
npx memory topic {{agent_id}} <topic> # 토픽 상세
|
|
313
|
+
npx memory get {{agent_id}} <id> # 개별 기억
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
## 기억 저장 트리거
|
|
317
|
+
- "기억해둬", "저장해", "메모해" 요청 시
|
|
318
|
+
- 중요한 결정사항 발생 시
|
|
319
|
+
- CEO 지침 수령 시
|
|
320
|
+
|
|
321
|
+
## 토픽 선택 가이드 ⭐
|
|
322
|
+
|
|
323
|
+
**저장 시 반드시 적절한 토픽을 지정하세요!**
|
|
324
|
+
|
|
325
|
+
1. **기존 토픽 확인**: `index` 명령으로 기존 토픽 목록 확인
|
|
326
|
+
2. **기존 토픽 선택**: 관련 토픽이 있으면 그 토픽 사용
|
|
327
|
+
3. **새 토픽 생성**: 없으면 새 토픽명 생성 (kebab-case, 예: `new-feature`)
|
|
328
|
+
|
|
329
|
+
**토픽 네이밍 규칙:**
|
|
330
|
+
- kebab-case 사용 (예: `vlm-finetuning`, `crewx-strategy`)
|
|
331
|
+
- 프로젝트/기능/주제 단위로 묶기
|
|
332
|
+
- 너무 세분화하지 말 것 (5개 미만이면 병합 고려)
|
|
333
|
+
|
|
334
|
+
**예시:**
|
|
335
|
+
```bash
|
|
336
|
+
# 기존 토픽에 추가
|
|
337
|
+
npx memory save {{agent_id}} "VLM 학습률 조정" decision --topic=vlm-finetuning
|
|
338
|
+
|
|
339
|
+
# 새 토픽 생성
|
|
340
|
+
npx memory save {{agent_id}} "신규 기능 기획" decision --topic=new-feature-x
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
## 저장 명령 (--body 필수!)
|
|
344
|
+
```bash
|
|
345
|
+
# ⚠️ 항상 --body 포함해서 저장!
|
|
346
|
+
npx memory save {{agent_id}} "<요약>" <category> --topic=<topic> --body="<상세 내용>"
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**--body 작성 가이드:**
|
|
350
|
+
- 왜 이 결정을 했는지 (배경/근거)
|
|
351
|
+
- 핵심 수치나 데이터
|
|
352
|
+
- 관련 파일/문서 경로
|
|
353
|
+
- 후속 액션이 있으면 포함
|
|
354
|
+
|
|
355
|
+
## 카테고리 선택
|
|
356
|
+
- **decision**: 의사결정, CEO 지침
|
|
357
|
+
- **task**: 할 일, 작업 계획
|
|
358
|
+
- **project**: 프로젝트 정보
|
|
359
|
+
- **schedule**: 일정, 미팅
|
|
360
|
+
- **context**: 배경 정보, 상황
|
|
361
|
+
- **preference**: 선호도, 규칙
|
|
362
|
+
- **general**: 기타
|
|
363
|
+
|
|
364
|
+
</memory-v2-guide>
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
## 기존 memory 스킬과 차이점
|
|
368
|
+
|
|
369
|
+
| 항목 | memory (v1) | memory-v2 |
|
|
370
|
+
|------|-------------|-----------|
|
|
371
|
+
| 저장 형식 | JSON 배열 | 마크다운 파일 |
|
|
372
|
+
| 메타데이터 | content 내 혼합 | 프론트매터 분리 |
|
|
373
|
+
| 조회 | 전체 로드 | 인덱스 → 드릴다운 |
|
|
374
|
+
| 토픽 지원 | 없음 | 있음 |
|
|
375
|
+
| 가독성 | 낮음 | 높음 |
|
|
376
|
+
|
|
377
|
+
## 기억 연결 그래프
|
|
378
|
+
|
|
379
|
+
기억 간 연관성을 그래프로 관리합니다.
|
|
380
|
+
|
|
381
|
+
### 그래프 빌드
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
npx memory mindmap build <agent_id>
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
규칙 기반으로 연결 생성:
|
|
388
|
+
- **같은 topic**: weight 0.7 (⚠️ `general` 제외)
|
|
389
|
+
- **공통 tags**: weight 0.4~0.8 (1개=0.4, 2개=0.6, 3개+=0.8)
|
|
390
|
+
- **같은 날짜**: weight 0.3 (기본 OFF)
|
|
391
|
+
- **같은 category**: weight 0.2 (⚠️ `general` 제외)
|
|
392
|
+
|
|
393
|
+
> **edgeThreshold = 0.3** → 총 weight가 0.3 이상이어야 연결됨
|
|
394
|
+
|
|
395
|
+
### ⭐ 연결성 높이는 저장 팁
|
|
396
|
+
|
|
397
|
+
**핵심: `general`을 피하고 구체적으로!**
|
|
398
|
+
|
|
399
|
+
| 방법 | Weight | 효과 |
|
|
400
|
+
|------|--------|------|
|
|
401
|
+
| topic 지정 | +0.7 | 같은 토픽 기억들 자동 연결 |
|
|
402
|
+
| 태그 2개+ | +0.6 | 토픽 달라도 태그로 연결 |
|
|
403
|
+
| 태그 3개+ | +0.8 | 최대 연결 강도 |
|
|
404
|
+
| category | +0.2 | decision/task 등 구체적으로 |
|
|
405
|
+
|
|
406
|
+
**❌ 나쁜 예 (연결 안 됨)**
|
|
407
|
+
```bash
|
|
408
|
+
# topic=general, category=general → 연결 0
|
|
409
|
+
npx memory save agent "Discord 설정 제거" general
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
**✅ 좋은 예 (강한 연결)**
|
|
413
|
+
```bash
|
|
414
|
+
# topic + category + tags → 최대 연결
|
|
415
|
+
npx memory save agent "Discord 설정 제거 결정" decision \
|
|
416
|
+
--topic=discord \
|
|
417
|
+
--tags=settings,cpo-decision,oauth \
|
|
418
|
+
--body="CPO 회의 결과..."
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
**태그 활용 전략:**
|
|
422
|
+
- 관련 기능/모듈명: `discord`, `oauth`, `settings`
|
|
423
|
+
- 회의/결정자: `cpo-decision`, `dev-meeting`
|
|
424
|
+
- 상태: `completed`, `blocked`, `wip`
|
|
425
|
+
|
|
426
|
+
### 그래프 요약 보기
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
npx memory mindmap show <agent_id>
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
토픽별 클러스터, 허브 노드(연결 많은 기억) 등 표시.
|
|
433
|
+
기본 출력은 **Mermaid 포맷**이며, VS Code 마크다운 프리뷰에서 그래프로 시각화됩니다.
|
|
434
|
+
`--format=mermaid`가 기본값이고, `--format=text`로 텍스트 출력도 가능합니다.
|
|
435
|
+
|
|
436
|
+
**기간 필터 옵션:**
|
|
437
|
+
```bash
|
|
438
|
+
npx memory mindmap show <agent_id> --period=stm # 24h
|
|
439
|
+
npx memory mindmap show <agent_id> --period=mtm # 7d
|
|
440
|
+
npx memory mindmap show <agent_id> --period=ltm # 30d
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
### PNG 이미지 내보내기
|
|
444
|
+
|
|
445
|
+
Mermaid 출력을 PNG 이미지로 변환하여 시각적으로 확인할 수 있습니다.
|
|
446
|
+
|
|
447
|
+
```bash
|
|
448
|
+
# 1. mermaid 코드를 파일로 저장
|
|
449
|
+
npx memory mindmap show <agent_id> | sed 's/^```mermaid$//' | sed 's/^```$//' > /tmp/graph.mmd
|
|
450
|
+
|
|
451
|
+
# 2. PNG 변환 (npx로 설치 없이 실행)
|
|
452
|
+
npx @mermaid-js/mermaid-cli -i /tmp/graph.mmd -o graph.png -w 2400 -H 1600 -b white
|
|
453
|
+
|
|
454
|
+
# 기간 필터 + PNG (예: 최근 24시간만)
|
|
455
|
+
npx memory mindmap show <agent_id> --period=stm | sed 's/^```mermaid$//' | sed 's/^```$//' | grep -v '^(' > /tmp/graph-stm.mmd
|
|
456
|
+
npx @mermaid-js/mermaid-cli -i /tmp/graph-stm.mmd -o graph-stm.png -w 1600 -H 900 -b white
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
> **팁**: 전체 그래프(58+ 노드)는 복잡하므로 `--period=stm`(24h)이나 `--period=mtm`(7d)으로 축소해서 보는 걸 권장합니다.
|
|
460
|
+
|
|
461
|
+
### 연결된 기억 조회
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
npx memory mindmap related <agent_id> <memory_id>
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
특정 기억과 연결된 기억들을 weight 순으로 표시.
|
|
468
|
+
|
|
469
|
+
### 수동 연결 관리
|
|
470
|
+
|
|
471
|
+
```bash
|
|
472
|
+
# 연결 추가
|
|
473
|
+
npx memory mindmap add <agent_id> <from_id> <to_id> [type]
|
|
474
|
+
|
|
475
|
+
# 연결 제거
|
|
476
|
+
npx memory mindmap remove <agent_id> <from_id> <to_id>
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### 시각화 (HTML) - 공용 그래프
|
|
480
|
+
|
|
481
|
+
```bash
|
|
482
|
+
npx memory mindmap html
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
**모든 에이전트의 연결 그래프를 한 곳에 통합한 공용 시각화**를 생성합니다.
|
|
486
|
+
|
|
487
|
+
**특징:**
|
|
488
|
+
- 모든 에이전트의 graph.json 데이터를 하나의 HTML에 임베드
|
|
489
|
+
- 드롭다운으로 에이전트 선택 → 해당 그래프로 실시간 전환
|
|
490
|
+
- D3.js force-directed 그래프
|
|
491
|
+
- 토픽별 색상 구분
|
|
492
|
+
- 줌 & 드래그 지원
|
|
493
|
+
- 호버 시 상세 정보 툴팁
|
|
494
|
+
- 노드 크기 = 연결 수
|
|
495
|
+
- 서버 없이 file:// 프로토콜로 바로 열기 가능
|
|
496
|
+
|
|
497
|
+
**사용법:**
|
|
498
|
+
```bash
|
|
499
|
+
# 1. 공용 HTML 생성 (agent_id 필요 없음)
|
|
500
|
+
npx memory mindmap html
|
|
501
|
+
|
|
502
|
+
# 2. 브라우저에서 열기
|
|
503
|
+
npx memory mindmap open
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
**예시:**
|
|
507
|
+
```bash
|
|
508
|
+
# 전체 에이전트 그래프 통합 시각화
|
|
509
|
+
npx memory mindmap html
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### 브라우저에서 열기
|
|
513
|
+
|
|
514
|
+
```bash
|
|
515
|
+
npx memory mindmap open [agent_id]
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
특정 에이전트의 그래프를 브라우저에서 바로 엽니다.
|
|
519
|
+
|
|
520
|
+
**예시:**
|
|
521
|
+
```bash
|
|
522
|
+
# CTO 그래프 열기
|
|
523
|
+
npx memory mindmap open cto
|
|
524
|
+
|
|
525
|
+
# 전체 (기본 에이전트) 열기
|
|
526
|
+
npx memory mindmap open
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### 저장 위치
|
|
530
|
+
|
|
531
|
+
```
|
|
532
|
+
memory/{agent_id}/graph.json # 그래프 데이터
|
|
533
|
+
memory/mindmap.html # 공용 시각화 HTML (npx memory mindmap html로 생성)
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
---
|
|
537
|
+
|
|
538
|
+
## 기억 계층 구조
|
|
539
|
+
|
|
540
|
+
`index` 명령은 인지심리학(Ebbinghaus, Atkinson-Shiffrin)과 AI 에이전트 메모리 연구(MemoryOS, A-Mem)에 기반한 3계층 출력을 제공합니다.
|
|
541
|
+
|
|
542
|
+
| 계층 | 시간 | 출력 |
|
|
543
|
+
|------|------|------|
|
|
544
|
+
| 단기 (STM) | 24h | `## 🔥 최근 작업` |
|
|
545
|
+
| 중기 (MTM) | 7일 | 토픽별 요약 (summary.md) |
|
|
546
|
+
| 장기 (LTM) | 30일 | `--recent` 또는 `--full` |
|
|
547
|
+
|
|
548
|
+
상세 설계 근거: [README.md](./README.md#설계-근거-계층적-기억-아키텍처)
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
## v1 → v2 마이그레이션
|
|
553
|
+
|
|
554
|
+
```bash
|
|
555
|
+
npx memory migrate <agent_id>
|
|
556
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crewx/memory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Memory engine for CrewX - markdown + frontmatter based long-term memory",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "dist/src/engine.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"bin": {
|
|
15
15
|
"memory": "./dist/cli.js"
|
|
16
16
|
},
|
|
17
|
-
"files": ["dist"],
|
|
17
|
+
"files": ["dist", "SKILL.md"],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsc",
|
|
20
20
|
"dev": "ts-node cli.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"keywords": ["crewx", "memory", "markdown", "frontmatter"],
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@crewx/knowledge-core": "^0.1.
|
|
26
|
+
"@crewx/knowledge-core": "^0.1.3",
|
|
27
27
|
"gray-matter": "^4.0.3",
|
|
28
28
|
"nanoid": "^3.3.11"
|
|
29
29
|
},
|