Workspace Memory automatically saves important workspace knowledge โ bug postmortems, architectural decisions, and compact notes โ and injects relevant memories into future agent prompts so the agent avoids rediscovering prior context. Each workspace has an isolated memory store that persists across sessions and survives context compaction.
์ํฌ์คํ์ด์ค ๋ฉ๋ชจ๋ฆฌ๋ ์ค์ํ ์ํฌ์คํ์ด์ค ์ง์ โ ๋ฒ๊ทธ ํฌ์คํธ๋ชจํ , ์ํคํ ์ฒ ๊ฒฐ์ , ๊ฐ๊ฒฐํ ๋ฉ๋ชจ โ ์ ์๋์ผ๋ก ์ ์ฅํ๊ณ , ์ด์ ๋ฌธ๋งฅ์ ์ฌ๋ฐ๊ฒฌํ์ง ์๋๋ก ๊ด๋ จ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ํฅํ ์์ด์ ํธ ํ๋กฌํํธ์ ์ฃผ์ ํฉ๋๋ค. ๊ฐ ์ํฌ์คํ์ด์ค์๋ ์ธ์ ๊ฐ์ ์ง์๋๊ณ ์ปจํ ์คํธ ์ปดํฉ์ ์์๋ ์ ์ง๋๋ ๊ฒฉ๋ฆฌ๋ ๋ฉ๋ชจ๋ฆฌ ์ ์ฅ์๊ฐ ์์ต๋๋ค.
Memories are not instructions โ they are provided as read-only context wrapped in <workspace_memories> tags so the agent can reference past findings without re-executing them.
๋ฉ๋ชจ๋ฆฌ๋ ์ง์์ด๊ฐ ์๋๋๋ค โ <workspace_memories> ํ๊ทธ๋ก ๋ํ๋ ์ฝ๊ธฐ ์ ์ฉ ์ปจํ
์คํธ๋ก ์ ๊ณต๋์ด ์์ด์ ํธ๊ฐ ๊ณผ๊ฑฐ ๋ฐ๊ฒฌ์ ์ฌ์คํํ์ง ์๊ณ ์ฐธ์กฐํ ์ ์์ต๋๋ค.
Storage is per-workspace. The memory directory lives under the agent's data root, keyed by an encoded version of the working directory path.
์ ์ฅ์๋ ์ํฌ์คํ์ด์ค๋ณ์ ๋๋ค. ๋ฉ๋ชจ๋ฆฌ ๋๋ ํ ๋ฆฌ๋ ์์ด์ ํธ ๋ฐ์ดํฐ ๋ฃจํธ ์๋์ ์์ ๋๋ ํ ๋ฆฌ ๊ฒฝ๋ก์ ์ธ์ฝ๋ฉ๋ ๋ฒ์ ์ ํค๋ก ํ์ฌ ์์นํฉ๋๋ค.
| Fileํ์ผ | Description์ค๋ช |
|---|---|
index.json |
Lightweight index with id, file, template, summary, tags, createdAt, lastRecalledAt, recallCount, and score for each memory. Used for ranking without loading full content. ๊ฐ ๋ฉ๋ชจ๋ฆฌ์ id, file, template, summary, tags, createdAt, lastRecalledAt, recallCount, score๊ฐ ํฌํจ๋ ๊ฒฝ๋ ์ธ๋ฑ์ค. ์ ์ฒด ์ฝํ ์ธ ๋ก๋ ์์ด ๋ญํน์ ์ฌ์ฉ๋ฉ๋๋ค. |
mem-${timestamp}-${random}.json |
Individual memory file containing the full structured content, template type, and metadata. ์ ์ฒด ๊ตฌ์กฐํ๋ ์ฝํ ์ธ , ํ ํ๋ฆฟ ์ ํ ๋ฐ ๋ฉํ๋ฐ์ดํฐ๊ฐ ํฌํจ๋ ๊ฐ๋ณ ๋ฉ๋ชจ๋ฆฌ ํ์ผ. |
The recall pipeline is designed for zero-token overhead during ranking:
๋ฆฌ์ฝ ํ์ดํ๋ผ์ธ์ ๋ญํน ์ค ํ ํฐ ์ค๋ฒํค๋๊ฐ ์๋๋ก ์ค๊ณ๋์์ต๋๋ค:
Three templates define the structure of saved memories. The template is auto-detected from the content or can be specified manually.
์ธ ๊ฐ์ง ํ ํ๋ฆฟ์ด ์ ์ฅ๋ ๋ฉ๋ชจ๋ฆฌ์ ๊ตฌ์กฐ๋ฅผ ์ ์ํฉ๋๋ค. ํ ํ๋ฆฟ์ ์ฝํ ์ธ ์์ ์๋ ๊ฐ์ง๋๊ฑฐ๋ ์๋์ผ๋ก ์ง์ ํ ์ ์์ต๋๋ค.
| Templateํ ํ๋ฆฟ | Fieldsํ๋ | Use When์ฌ์ฉ ์๊ธฐ |
|---|---|---|
post-mortem |
problem, rootCause, fix, prevention
|
After resolving a bug ๋ฒ๊ทธ ํด๊ฒฐ ํ |
decision-record |
context, decision, rationale, alternativesConsidered
|
When making an architectural choice ์ํคํ ์ฒ ๊ฒฐ์ ์ ๋ด๋ฆด ๋ |
compact-note |
summary, keyPoints[]
|
Quick knowledge capture ๋น ๋ฅธ ์ง์ ์บก์ฒ |
Memories are saved via the memory_save tool or the /memory save slash command. The agent also auto-detects important moments (bug fixes, decisions, discoveries) and suggests saving them.
๋ฉ๋ชจ๋ฆฌ๋ memory_save ๋๊ตฌ ๋๋ /memory save ์ฌ๋์ ๋ช
๋ น์ ํตํด ์ ์ฅ๋ฉ๋๋ค. ์์ด์ ํธ๋ ์ค์ํ ์๊ฐ(๋ฒ๊ทธ ์์ , ๊ฒฐ์ , ๋ฐ๊ฒฌ)์ ์๋์ผ๋ก ๊ฐ์งํ์ฌ ์ ์ฅ์ ์ ์ํ๊ธฐ๋ ํฉ๋๋ค.
| Parameterํ๋ผ๋ฏธํฐ | Typeํ์ | Description์ค๋ช |
|---|---|---|
content |
string (required)(ํ์) |
Structured memory content ๊ตฌ์กฐํ๋ ๋ฉ๋ชจ๋ฆฌ ์ฝํ ์ธ |
template |
string (optional)(์ ํ) |
Auto-detected if omitted ์๋ต ์ ์๋ ๊ฐ์ง |
tags |
string[] (optional)(์ ํ) |
Tags for relevance matching ๊ด๋ จ์ฑ ๋งค์นญ์ ์ํ ํ๊ทธ |
Before each agent turn, the recall pipeline extracts keywords from recent conversation text, ranks memories by relevance, and injects the top results into the system prompt.
๊ฐ ์์ด์ ํธ ํด ์ ์ ๋ฆฌ์ฝ ํ์ดํ๋ผ์ธ์ด ์ต๊ทผ ๋ํ ํ ์คํธ์์ ํค์๋๋ฅผ ์ถ์ถํ๊ณ , ๊ด๋ จ์ฑ๋ณ๋ก ๋ฉ๋ชจ๋ฆฌ๋ฅผ ๋ญํนํ์ฌ ์์ ๊ฒฐ๊ณผ๋ฅผ ์์คํ ํ๋กฌํํธ์ ์ฃผ์ ํฉ๋๋ค.
| Parameterํ๋ผ๋ฏธํฐ | Value๊ฐ | Description์ค๋ช |
|---|---|---|
MAX_MEMORIES |
200 |
Per-workspace limit ์ํฌ์คํ์ด์ค๋น ์ต๋ ๋ฉ๋ชจ๋ฆฌ ์ |
RECENCY_HALFLIFE_DAYS |
30 |
Score decay half-life ์ ์ ๊ฐ์ ๋ฐ๊ฐ๊ธฐ |
MAX_RECALL_MEMORIES |
5 |
Injected per prompt ํ๋กฌํํธ๋น ์ฃผ์ ์ |
MAX_RECALL_CONTEXT_CHARS |
8000 |
Total recalled text budget ์ ์ฒด ๋ฆฌ์ฝ ํ ์คํธ ์์ฐ |
MAX_RECALL_MEMORY_CHARS |
2000 |
Single memory text limit ๋จ์ผ ๋ฉ๋ชจ๋ฆฌ ํ ์คํธ ์ ํ |
| Match Type๋งค์นญ ์ ํ | Score์ ์ |
|---|---|
| Exact tag match์ ํํ ํ๊ทธ ๋งค์นญ | +10 |
| Partial tag match๋ถ๋ถ ํ๊ทธ ๋งค์นญ | +5 |
| Summary keyword match์์ฝ ํค์๋ ๋งค์นญ | +3 |
| Learned score boostํ์ต๋ ์ ์ ๋ถ์คํธ | score ร 0.5 |
When the memory count exceeds MAX_MEMORIES (200), the system evicts the lowest-scoring memories. All scores are recalculated, memories are sorted by score ascending (tie-break: createdAt ascending โ oldest first), and the overflow is removed.
๋ฉ๋ชจ๋ฆฌ ์๊ฐ MAX_MEMORIES(200)์ ์ด๊ณผํ๋ฉด ์์คํ
์ ์ ์๊ฐ ๊ฐ์ฅ ๋ฎ์ ๋ฉ๋ชจ๋ฆฌ๋ฅผ ์ถ์ถํฉ๋๋ค. ๋ชจ๋ ์ ์๊ฐ ์ฌ๊ณ์ฐ๋๊ณ , ์ ์ ์ค๋ฆ์ฐจ์์ผ๋ก ์ ๋ ฌ๋๋ฉฐ(๋์ ์ createdAt ์ค๋ฆ์ฐจ์ โ ๊ฐ์ฅ ์ค๋๋ ๊ฒ ์ฐ์ ), ์ด๊ณผ๋ถ์ด ์ ๊ฑฐ๋ฉ๋๋ค.
| Command๋ช ๋ น์ด | Description์ค๋ช |
|---|---|
/memory list |
List all memories with id, template, summary, recall count, and score id, ํ ํ๋ฆฟ, ์์ฝ, ๋ฆฌ์ฝ ์, ์ ์์ ํจ๊ป ๋ชจ๋ ๋ฉ๋ชจ๋ฆฌ ๋์ด |
/memory show <id> |
Display a specific memory's full content ํน์ ๋ฉ๋ชจ๋ฆฌ์ ์ ์ฒด ๋ด์ฉ ํ์ |
/memory save <text> |
Save a manual note (auto-detects template) ์๋ ๋ฉ๋ชจ ์ ์ฅ (ํ ํ๋ฆฟ ์๋ ๊ฐ์ง) |
/memory delete <id> |
Remove a memory by id id๋ก ๋ฉ๋ชจ๋ฆฌ ์ญ์ |
/memory search <query> |
Search memories by keyword ํค์๋๋ก ๋ฉ๋ชจ๋ฆฌ ๊ฒ์ |
/memory stats |
Show memory statistics (total, by template, total recalls, top recalled) ๋ฉ๋ชจ๋ฆฌ ํต๊ณ ํ์ (์ด๊ณ, ํ ํ๋ฆฟ๋ณ, ์ด ๋ฆฌ์ฝ ์, ์ต๋ค ๋ฆฌ์ฝ) |
No environment variables or configuration files are required. Workspace Memory operates automatically with per-workspace isolation โ each working directory gets its own independent memory store under the agent's data directory.
ํ๊ฒฝ ๋ณ์๋ ๊ตฌ์ฑ ํ์ผ์ด ํ์ํ์ง ์์ต๋๋ค. ์ํฌ์คํ์ด์ค ๋ฉ๋ชจ๋ฆฌ๋ ์๋์ผ๋ก ์๋ํ๋ฉฐ ์ํฌ์คํ์ด์ค๋ณ ๊ฒฉ๋ฆฌ๋ฅผ ์ ๊ณตํฉ๋๋ค โ ๊ฐ ์์ ๋๋ ํ ๋ฆฌ๋ ์์ด์ ํธ ๋ฐ์ดํฐ ๋๋ ํ ๋ฆฌ ์๋์ ์์ฒด ๋ ๋ฆฝ์ ์ธ ๋ฉ๋ชจ๋ฆฌ ์ ์ฅ์๋ฅผ ๊ฐ์ต๋๋ค.
Large memories: Individual memories are truncated at MAX_RECALL_MEMORY_CHARS (2000 chars). Total recalled context is bounded by MAX_RECALL_CONTEXT_CHARS (8000 chars). Truncated memories include a [Memory truncated to fit prompt budget] marker.
ํฐ ๋ฉ๋ชจ๋ฆฌ: ๊ฐ๋ณ ๋ฉ๋ชจ๋ฆฌ๋ MAX_RECALL_MEMORY_CHARS(2000์)์์ ์๋ฆฝ๋๋ค. ์ ์ฒด ๋ฆฌ์ฝ ์ปจํ
์คํธ๋ MAX_RECALL_CONTEXT_CHARS(8000์)๋ก ์ ํ๋ฉ๋๋ค. ์๋ฆฐ ๋ฉ๋ชจ๋ฆฌ์๋ [Memory truncated to fit prompt budget] ๋ง์ปค๊ฐ ํฌํจ๋ฉ๋๋ค.
Cross-workspace isolation: Each workspace is isolated by its encoded cwd path. Memories saved in one project are never visible in another.
์ํฌ์คํ์ด์ค ๊ฐ ๊ฒฉ๋ฆฌ: ๊ฐ ์ํฌ์คํ์ด์ค๋ ์ธ์ฝ๋ฉ๋ cwd ๊ฒฝ๋ก๋ก ๊ฒฉ๋ฆฌ๋ฉ๋๋ค. ํ ํ๋ก์ ํธ์ ์ ์ฅ๋ ๋ฉ๋ชจ๋ฆฌ๋ ๋ค๋ฅธ ํ๋ก์ ํธ์ ํ์๋์ง ์์ต๋๋ค.
Compaction survival: Memories persist across context compaction. They are stored on disk as separate JSON files, independent of the conversation context window.
์ปดํฉ์ ์์กด: ๋ฉ๋ชจ๋ฆฌ๋ ์ปจํ ์คํธ ์ปดํฉ์ ์ ๋ฐ์ ๊ฑธ์ณ ์ง์๋ฉ๋๋ค. ๋ํ ์ปจํ ์คํธ ์๋์ฐ์ ๋ ๋ฆฝ์ ์ผ๋ก ๋ณ๋์ JSON ํ์ผ๋ก ๋์คํฌ์ ์ ์ฅ๋ฉ๋๋ค.
Orphan cleanup: If a memory file is missing or corrupted, the recall pipeline automatically removes the orphaned index entry.
๊ณ ์ ์ ๋ฆฌ: ๋ฉ๋ชจ๋ฆฌ ํ์ผ์ด ๋๋ฝ๋๊ฑฐ๋ ์์๋ ๊ฒฝ์ฐ, ๋ฆฌ์ฝ ํ์ดํ๋ผ์ธ์ด ์๋์ผ๋ก ๊ณ ์ ์ธ๋ฑ์ค ํญ๋ชฉ์ ์ ๊ฑฐํฉ๋๋ค.
Index caching: The index is cached in memory per session. File changes from external processes are not reflected until cache invalidation (session restart).
์ธ๋ฑ์ค ์บ์ฑ: ์ธ๋ฑ์ค๋ ์ธ์ ๋น ๋ฉ๋ชจ๋ฆฌ์ ์บ์๋ฉ๋๋ค. ์ธ๋ถ ํ๋ก์ธ์ค์ ํ์ผ ๋ณ๊ฒฝ์ ์บ์ ๋ฌดํจํ(์ธ์ ์ฌ์์)๊น์ง ๋ฐ์๋์ง ์์ต๋๋ค.