Loading...
Loading...
Universal Cross-session Memory Protocol (Universal Memory Protocol). Enable all AI programming tools to share the same memory system. Applicable to Claude Code / Cursor / Aider / Cline / Codex / Trae / OpenCode. Capabilities: Intelligent Classification / FSRS Decay / Monthly Compression / Multi-layer Retrieval. Triggers: User says "remember"; asks "previous"; sensitive information detected; session ends.
npx skill4agent add nangongwentian-fe/agent-skills persistent-memory# 首次初始化(详见 references/setup.md)
mkdir -p ~/.persistent-memory/{memories,journal,archive,.sensitive}~/.persistent-memory/
├── INDEX.md # Memory Index (read first by AI)
├── MEMORY.md # Core long-term memory (refined summary)
├── SOUL.md # User profile/preferences
├── HEARTBEAT.md # Heartbeat checklist
├── memories/
│ ├── facts.md # Facts: accounts, configurations, tech stacks
│ ├── decisions.md # Decisions: architecture selection, technical solutions
│ ├── preferences.md # Preferences: coding style, tool habits
│ └── context.md # Context: project background, business logic
├── journal/
│ └── YYYY-MM-DD.md # Daily journal
├── archive/
│ └── YYYY-MM.md # Monthly compressed archive
└── .sensitive/ # Sensitive information (gitignored)| Type | File | Writing Example |
|---|---|---|
| Facts | memories/facts.md | Accounts, configurations, tech stack versions, IP addresses |
| Decisions | memories/decisions.md | Architecture selection, technical solutions, reasons for choosing A over B |
| Preferences | memories/preferences.md | Coding style, tool habits, "always use pnpm" |
| Context | memories/context.md | Project background, business logic, team information |
| User Profile | SOUL.md | Personality, communication style, address, work style |
| Daily | journal/YYYY-MM-DD.md | Tasks completed today, problems found, temporary notes |
# 必须读取
cat ~/.persistent-memory/INDEX.md
cat ~/.persistent-memory/MEMORY.md
# 可选读取
cat ~/.persistent-memory/SOUL.md
cat ~/.persistent-memory/journal/$(date +%Y-%m-%d).md 2>/dev/null| Trigger | Action |
|---|---|
| User says "remember xxx" | Determine category → Write → Update INDEX |
| User asks "how was it before" | Three-layer retrieval (see retrieval.md) |
| API key/account detected | Prompt user whether to record to .sensitive/ |
| Important task completed | Prompt to record to journal/ |
| Session ends | Update access count → Update INDEX → Write to journal |
| First day of each month | Prompt for monthly compression (see intelligence.md) |
X-YYYYMMDD-NNN### [F-20260228-001] Title
- **Created**: 2026-02-28
- **Last Accessed**: 2026-02-28
- **Access Count**: 1
- **Importance**: high|medium|low
- **Tags**: tag1, tag2
Content...FDPC[Type]-[YYYYMMDD]-[Daily Serial Number]