Memory
Persistent memory layers for project and agent context.
Memory System
Memory is where Knowns stores durable context that should be recalled later.
The three layers
- working memory: short-lived, session-scoped context
- project memory: decisions, patterns, and conventions specific to one repository
- global memory: user-level preferences or reusable rules across projects
When to use memory instead of docs
Use memory when the information is:
- short enough to recall quickly
- decision-oriented rather than explanatory
- useful across many future interactions
Use docs when the information needs longer narrative explanation or structured sections.
Typical examples
- “We use repository pattern for data access”
- “Always validate before marking a task done”
- “This team prefers semantic search before manual grep for exploratory work”
Commands
bash
knowns memory add "We use repository pattern" --category decision
knowns memory list --plain
knowns memory <id> --plain
Related
Memory
Memory là nơi Knowns lưu context cần nhớ lại sau này.
Ba layer
- working memory — context ngắn hạn, chỉ sống trong một session
- project memory — decision, pattern, convention riêng của một repo
- global memory — preference hoặc rule dùng được across projects
Memory hay doc?
Dùng memory khi:
- ngắn gọn, cần recall nhanh
- thiên về decision hơn là giải thích dài
- hữu ích cho nhiều lần làm việc sau
Dùng doc khi cần giải thích dài hoặc chia thành nhiều section.
Ví dụ
"We use repository pattern for data access"
"Always validate before marking a task done"
"Prefer semantic search over manual grep for exploration"
Nội dung memory thường viết bằng tiếng Anh vì AI đọc trực tiếp.
Lệnh
bash
knowns memory add "We use repository pattern" --category decision
knowns memory list --plain
knowns memory <id> --plain