메모리
CLI-JAW는 3계층 메모리 시스템을 갖추고 있습니다: 구조화된 파일 저장소, 에피소드 기반 대화 요약, 그리고 FTS5 인덱싱을 활용한 시맨틱 검색. 메모리는 세션 간에 유지되며 에이전트의 시스템 프롬프트에 주입됩니다.
3개의 계층
| 계층 | 용도 | 저장 위치 |
|---|---|---|
| 구조화 | 프로필, 선호 설정, 결정 사항, 소울/정체성 | ~/.cli-jaw/memory/structured/ |
| 에피소드 | 메모리 플러시로 생성된 대화 요약 | ~/.cli-jaw/memory/structured/episodes/live/ |
| 시맨틱 | 가져오기 및 분류된 지식 | ~/.cli-jaw/memory/structured/semantic/ |
메모리 디렉토리 구조
~/.cli-jaw/memory/structured/
├── profile.md # User profile and preferences
├── shared/
│ ├── preferences.md # Reflected preferences
│ ├── decisions.md # Key decisions
│ ├── projects.md # Project context
│ └── soul.md # Soul and identity
├── episodes/
│ ├── live/ # Daily conversation summaries
│ └── imported/ # Imported from legacy memory
├── semantic/ # Categorized knowledge
├── procedures/ # Runbooks and procedures
├── sessions/ # (not indexed)
└── index.sqlite # FTS5 search index
메모리 작동 방식
1. 히스토리 블록 (대화 컨텍스트)
새 세션이 시작되면 가장 최근의 대화 기록(최대 8000자, 10개 세션)이 사용자 프롬프트 앞에 [Recent Context]로 추가됩니다. 이는 현재 workingDir 범위로 한정됩니다.
2. 메모리 플러시 (대화에서 저장소로)
어시스턴트가 N회 응답할 때마다(기본값: 10, settings.memory.flushEvery로 설정 가능), 별도의 에이전트가 핵심 정보를 추출하여 일일 에피소드 파일에 추가합니다.
## 15:30
User discussed refactoring the auth module. Decided to use JWT tokens.
Prefers ES Module only, no CommonJS.
3. 고급 프롬프트 주입
FTS5 인덱스가 준비되면 시스템 프롬프트에 다음이 포함됩니다:
- 프로필 컨텍스트 --
profile.md에서 가져옴 (800자) - 소울 및 정체성 --
shared/soul.md에서 가져옴 (1000자) - 태스크 스냅샷 -- 현재 프롬프트와 관련된 FTS5 검색 결과 (최대 4건, 2800자)
CLI 명령어
# Search memory
jaw memory search "JWT authentication"
# Read a memory file
jaw memory read shared/decisions.md
# Save to memory
jaw memory save shared/notes.md "New note content"
# List memory files
jaw memory list
# Initialize memory
jaw memory init
# Reflect recent episodes into structured memory
jaw memory reflect
# Trigger memory flush
jaw memory flush
# Cleanup old entries
jaw memory cleanup --days 30
슬래시 명령어
| 명령어 | 설명 |
|---|---|
/memory 또는 /memory list | 메모리 파일 목록 보기 |
/memory <query> | 메모리 검색 |
/memory status | 런타임 상태 표시 |
/memory bootstrap | 레거시 메모리 소스 가져오기 |
/memory reindex | FTS5 인덱스 재구축 |
/memory flush | 즉시 플러시 실행 |
/memory embed status | 임베딩 상태 표시 |
/memory embed estimate | 임베딩 비용 추정 |
L1 / L2 메모리 경계
| 레이어 | 명령어 | 범위 | 접근 권한 |
|---|---|---|---|
| L1 (인스턴스 로컬) | jaw memory | 현재 JAW_HOME | 읽기/쓰기 |
| L2 (대시보드 연합) | jaw dashboard memory | 모든 ~/.cli-jaw* 인스턴스 | 읽기 전용 |
일반 작업에는 L1(
jaw memory)을 사용하세요. L2(jaw dashboard memory)는 다른 인스턴스의 컨텍스트가 필요할 때 명시적으로 크로스 인스턴스 검색을 수행하기 위한 것입니다.대시보드 임베딩 (선택 사항)
대시보드는 FTS5 검색 위에 선택적 벡터 임베딩을 지원합니다. 이는 기본적으로 비활성화된 추가 레이어입니다. 지원 프로바이더: OpenAI, Gemini, Voyage, Vertex, Local (Ollama).
# Configure via dashboard settings or CLI:
jaw dashboard memory config set --provider openai --api-key sk-...
jaw dashboard memory reindex --embedding
메모리 설정
{
"memory": {
"enabled": true,
"flushEvery": 10,
"cli": "claude",
"model": "haiku"
}
}