Mental Model
Memory is for information with recurring value across conversations. If you'll need it tomorrow/next week, save it. If it's ephemeral (today's weather, casual greeting), don't.
What to Remember (DO)
| Category |
Examples |
File |
| Identity |
Name, age, location, occupation |
facts/people.jsonl |
| Preferences |
Languages, frameworks, work style |
facts/preferences.jsonl |
| Relationships |
Colleagues, family, team members |
facts/people.jsonl |
| Decisions |
Conclusions from discussions |
facts/projects.jsonl |
| Context |
Project details, work environment |
facts/projects.jsonl |
What NOT to Remember (NEVER)
- Ephemeral greetings ("你好", "hi")
- Temporary states ("今天很忙", "现在在外面")
- One-time questions without context
- Duplicate information already stored
- Credentials (passwords, API keys, tokens - even if user shares)
Action Pattern
When user shares memorable info:
- Immediately call
fs_write - don't acknowledge first, don't batch
- Extract structured fields from casual speech
- Use importance score: 0.9-1.0 (identity), 0.7-0.8 (preferences), 0.5-0.6 (context)
Example:
User: "我叫张三,在深圳做后端开发"
→ fs_write path=".memory/facts/people.jsonl" content='{"id":"mem_1704628800000","ts":"2026-01-07T12:00:00.000Z","type":"fact","category":"person","content":"张三,深圳,后端开发","tags":["name","location","occupation"],"importance":0.95}'
Storage Map
.memory/
├── profile.json # Read on session start for context
├── facts/
│ ├── people.jsonl # Identity, relationships
│ ├── preferences.jsonl # Tech stack, work style
│ └── projects.jsonl # Work context, decisions
└── conversations/
└── YYYY-MM-DD.jsonl # Session summaries
Entry Schema
{"id":"mem_{{timestamp}}","ts":"{{ISO8601}}","type":"fact","category":"{{person|preference|project}}","content":"{{concise content in user's language}}","tags":["{{retrieval keywords}}"],"importance":{{0.5-1.0}}
Retrieval
Session start: fs_read profile.json
Search: fs_grep pattern="{{keyword}}" path=".memory/"
1---2name: memory3description: Persistent memory for cross-session personalization. Trigger when user shares identity, preferences, relationships, or facts worth remembering.4---56## Mental Model78Memory is for **information with recurring value across conversations**. If you'll need it tomorrow/next week, save it. If it's ephemeral (today's weather, casual greeting), don't.910## What to Remember (DO)1112| Category | Examples | File |13|----------|----------|------|14| Identity | Name, age, location, occupation | `facts/people.jsonl` |15| Preferences | Languages, frameworks, work style | `facts/preferences.jsonl` |16| Relationships | Colleagues, family, team members | `facts/people.jsonl` |17| Decisions | Conclusions from discussions | `facts/projects.jsonl` |18| Context | Project details, work environment | `facts/projects.jsonl` |1920## What NOT to Remember (NEVER)2122- Ephemeral greetings ("你好", "hi")23- Temporary states ("今天很忙", "现在在外面")24- One-time questions without context25- Duplicate information already stored26- **Credentials** (passwords, API keys, tokens - even if user shares)2728## Action Pattern2930When user shares memorable info:31321. **Immediately** call `fs_write` - don't acknowledge first, don't batch332. Extract structured fields from casual speech343. Use importance score: 0.9-1.0 (identity), 0.7-0.8 (preferences), 0.5-0.6 (context)3536Example:37```38User: "我叫张三,在深圳做后端开发"39→ fs_write path=".memory/facts/people.jsonl" content='{"id":"mem_1704628800000","ts":"2026-01-07T12:00:00.000Z","type":"fact","category":"person","content":"张三,深圳,后端开发","tags":["name","location","occupation"],"importance":0.95}'40```4142## Storage Map4344```45.memory/46├── profile.json # Read on session start for context47├── facts/48│ ├── people.jsonl # Identity, relationships49│ ├── preferences.jsonl # Tech stack, work style50│ └── projects.jsonl # Work context, decisions51└── conversations/52 └── YYYY-MM-DD.jsonl # Session summaries53```5455## Entry Schema5657```json58{"id":"mem_{{timestamp}}","ts":"{{ISO8601}}","type":"fact","category":"{{person|preference|project}}","content":"{{concise content in user's language}}","tags":["{{retrieval keywords}}"],"importance":{{0.5-1.0}}59```6061## Retrieval6263Session start: `fs_read` `profile.json`64Search: `fs_grep` pattern="{{keyword}}" path=".memory/"65