Memory
CLI-JAW has a 3-tier memory system: structured file storage, episode-based conversation summaries, and semantic search with FTS5 indexing. Memory persists across sessions and is injected into the agent's system prompt.
Three Tiers
| Tier | Purpose | Storage |
|---|---|---|
| Structured | Profile, preferences, decisions, soul/identity | ~/.cli-jaw/memory/structured/ |
| Episodes | Conversation summaries from memory flush | ~/.cli-jaw/memory/structured/episodes/live/ |
| Semantic | Imported and categorized knowledge | ~/.cli-jaw/memory/structured/semantic/ |
Memory Directory Structure
~/.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
How Memory Works
1. History Block (Conversation Context)
On new sessions, the most recent conversation history (up to 8000 chars, 10 sessions) is prepended to the user prompt as [Recent Context]. This is scoped to the current workingDir.
2. Memory Flush (Conversation to Storage)
After every N assistant responses (default: 10, configurable via settings.memory.flushEvery), a separate agent extracts key information and appends it to the daily episode file.
## 15:30
User discussed refactoring the auth module. Decided to use JWT tokens.
Prefers ES Module only, no CommonJS.
3. Advanced Prompt Injection
When the FTS5 index is ready, the system prompt includes:
- Profile Context -- from
profile.md(800 chars) - Soul & Identity -- from
shared/soul.md(1000 chars) - Task Snapshot -- FTS5 search results relevant to the current prompt (up to 4 hits, 2800 chars)
CLI Commands
# 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
Slash Commands
| Command | Description |
|---|---|
/memory or /memory list | List memory files |
/memory <query> | Search memory |
/memory status | Show runtime status |
/memory bootstrap | Import legacy memory sources |
/memory reindex | Rebuild FTS5 index |
/memory flush | Trigger immediate flush |
/memory embed status | Show embedding state |
/memory embed estimate | Estimate embedding cost |
L1 / L2 Memory Boundary
| Layer | Command | Scope | Access |
|---|---|---|---|
| L1 (Instance-local) | jaw memory | Current JAW_HOME | Read/Write |
| L2 (Dashboard federation) | jaw dashboard memory | All ~/.cli-jaw* instances | Read-only |
jaw memory) for normal operations. L2 (jaw dashboard memory) is for explicit cross-instance searches when you need context from other instances.Dashboard Embedding (Optional)
The dashboard supports optional vector embedding on top of FTS5 search. This is an add-on layer that is off by default. Supported providers: 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 Settings
{
"memory": {
"enabled": true,
"flushEvery": 10,
"cli": "claude",
"model": "haiku"
}
}
- 이거 기억해줘
- 지난번에 뭘 했는지 찾아줘
- 메모리 검색해줘