Overview
The memory of an AI employee accumulates duplicates, misclassifications, and outdated information over time. This skill provides guides and tools to systematically organize memory.
Core principles:
- No hardcoded retention period - the LLM judges based on context
- Profile files (users/, channels/) follow the 1 entity = 1 file principle
- If unsure, preserve rather than delete
Integration with the slack-memory-store skill:
- 이 skill은
slack-memory-storeOrganize memories stored with the skill - The folder structure, metadata schema, and type field match
- Follow the principle of distinguishing profile files vs topic files
Quick Start
# 1. 분석만 (dry-run, 변경 없음)
python scripts/cleanup_memory.py {memories_path}
# 2. 결과 확인 후 실제 정리 실행
python scripts/cleanup_memory.py {memories_path} --execute
# 3. 정리 후 인덱스 업데이트
python scripts/update_index.py {memories_path}
Scripts
This skill provides scripts to assist with cleanup work.
cleanup_memory.py - Detect duplicates/misclassifications
Scan the memory folder to detect problems. By default, it only performs analysis (dry-run).
# 전체 분석
python scripts/cleanup_memory.py {memories_path}
# 특정 폴더만 분석
python scripts/cleanup_memory.py {memories_path} --folder users
python scripts/cleanup_memory.py {memories_path} --folder channels
# 상세 디버그 출력
python scripts/cleanup_memory.py {memories_path} --verbose
# 실제 정리 실행 (오분류 파일 이동)
python scripts/cleanup_memory.py {memories_path} --execute
Example output:
============================================================
📊 메모리 정리 분석 결과
============================================================
## 🔴 중복 파일
### users/ 폴더 (동일인 중복)
email:batteryho@krafton.com:
- 전지호 (Jiho Jeon).md (✅ 프로필)
- 전지호 (Jiho Jeon) - 이메일 분석.md (📝 작업기록)
- 전지호_외부플랫폼초대_2025-12-08.md (📝 작업기록)
## 🟡 오분류 파일
전지호 (Jiho Jeon) - 이메일 분석.md
현재: users/ → 권장: tasks/
이유: 파일명에 작업 키워드
Jira 티켓 조회 성공.md
현재: channels/ → 권장: tasks/
이유: type이 'task_completed'
## 📈 요약
- 중복 그룹: 3개
- 오분류 파일: 5개
Main detection features:
- Distinguish profiles vs work records: In users/ duplicates, indicate which file is a profile and which is a work record
- Show reason for misclassification: Provide the reason why the file was judged as misclassified
- Use the type field: Check the
typefield in the metadata to detect mismatch with the folder
update_index.py - Update index
Update index.md after cleanup.
python scripts/update_index.py {memories_path}
Cleanup workflow
Step 1: Assess the current state
# 전체 메모리 구조 확인
ls -la {memories_path}/
# 각 폴더별 파일 수 확인
find {memories_path} -type f -name "*.md" | wc -l
# 폴더별 상세
ls -la {memories_path}/users/
ls -la {memories_path}/channels/
ls -la {memories_path}/tasks/
Step 2: Detect problems
Detect the following problems using scripts or manually:
- Duplicate files - The same entity is spread across multiple files
- Incorrect classification - Folder and content mismatch
- Volatile information - Old files of low importance
Step 3: Execute cleanup
Appropriate actions based on detected problems:
- Duplicates → Merge (seededuplication-rules.md )
- Misclassification → Move (seemisclassification-rules.md )
- Volatile → Delete (seecleanup-patterns.md )
Step 4: Update index
Always update the index after cleanup:
python scripts/update_index.py {memories_path}
Key cleanup targets
1. users/ folder
Normal state: 1 file per person (profile)
users/
└── 전지호 (Jiho Jeon).md ← 프로필 파일만
Problem state: One person has multiple files
users/
├── 전지호 (Jiho Jeon).md ← 프로필 (유지)
├── 전지호 (Jiho Jeon) - 이메일 분석.md ← tasks/로 이동
├── 전지호 - AI 보고서.md ← tasks/ 또는 misc/로 이동
└── Serin_Kim_김세린.md ← 기존 김세린 파일과 병합
Criteria:
emailoruser_idis the same, they are the same person- Keep only 1 profile file in users/
- Move the rest to appropriate folders based on content
2. channels/ folder
Normal state: 1 file per channel (starting with the channel ID)
channels/
└── C08G76BB8JK_my-daily-scrum.md ← 채널 프로필
Problem state: Files that are not channel information
channels/
├── C08G76BB8JK_my-daily-scrum.md ← 유지
├── Jira 티켓 조회 성공.md ← tasks/로 이동
└── 메일 조회 작업 성공.md ← tasks/로 이동
Criteria:
channel_idexists and it is channel guidelines/information, keep it- Move work results, success cases, etc. to tasks/
3. tasks/ folder
Normal state: 1 file per task
tasks/
├── KIRA 프로젝트 작업 완료 - 2025-11-25.md
└── Tableau 데이터 조회 - 2025-12-09.md
Problem state: Duplicate similar content
tasks/
├── 7개_이메일_분석_2025-12-08.md ← 삭제 (더 완전한 버전 있음)
├── 8개_이메일_분석_2025-12-08.md ← 삭제
├── 9개_이메일_분석_2025-12-08.md ← 삭제
└── 10개_이메일_분석_2025-12-08.md ← 유지 (최종 버전)
Judgment criteria:
- Intermediate results of the same task → keep only the final version
- Similar titles on the same date → keep only the most complete one
4. Other folders
| Folder | Cleanup criteria |
|---|---|
projects/ |
Completed projects → can be moved to archive/ |
decisions/ |
Important, long-term retention |
meetings/ |
Old items → can be deleted after summarizing |
misc/ |
Top cleanup priority, delete old items |
external/news/ |
Value decreases over time, can be deleted |
announcements/ |
Old announcements can be deleted |
Importance judgment (LLM criteria)
Without hardcoded retention periods, the LLM judges by considering the following.
Items to retain
- Profile information (users/, channels/)
- Decision records (decisions/)
- In-progress projects (projects/)
- Information related to recent interactions
Items that can be deleted
- Intermediate outputs (when a final version exists)
- Old everyday conversations (misc/)
- News/announcements past their timeliness
- Duplicate information
Considerations for judgment
- Last modified date (
updatedmetadata) - Related project status (in progress vs completed)
- Relationships between files (
related_to) - Importance of tags (urgent, important, etc.)
Cleanup execution examples
Example 1: Deduplicating users/
요청: "users 폴더 정리해줘"
1. 현황 파악
- 전지호 관련 파일 6개 발견
- 김세린 관련 파일 2개 발견
2. 분석
- 전지호: 프로필 1개 + 작업 기록 5개
- 김세린: 같은 사람 다른 이름 2개
3. 실행
- 전지호 작업 기록 → tasks/로 이동
- 김세린 파일 → 병합 후 1개만 유지
4. 결과 보고
"users/ 정리 완료:
- 전지호: 5개 파일 tasks/로 이동
- 김세린: 2개 파일 1개로 병합"
Example 2: Cleaning up all memory
요청: "메모리 전체 정리해줘"
1. 현황 파악
- 총 120개 파일
- users/: 47개 (중복 의심)
- tasks/: 40개 (중복 의심)
- channels/: 10개 (오분류 의심)
2. 폴더별 분석 및 정리
3. 결과 보고
"메모리 정리 완료:
- 삭제: 15개 (중복/중간결과)
- 이동: 8개 (오분류 수정)
- 병합: 5개 (동일인 중복)
- 현재 총: 97개 파일"
Safety guidelines
Confirm before deletion
- Confirm with the user before deleting important files
decisions/,projects/Especially careful when deleting- If unsure, move rather than delete
Backup recommended
- Suggest a backup before bulk cleanup
cp -r {memories_path} {memories_path}_backup_{date}
Rollback possibility
- Record the list of deleted files
- Record the original locations of moved files
Reference Documents
For detailed rules, refer to the following documents:
- cleanup-patterns.md - Cleanup patterns and LLM judgment criteria
- deduplication-rules.md - Duplicate detection and merge rules
- misclassification-rules.md - Misclassification detection and move rules