A failed compaction wiped my AI session, so I built it infinite memory
说明与用途
OpenCode 中的压缩失败导致所有对话历史被删除。解决方案是添加 opencode‑mempalace‑persistence,它会自动将每次聊天保存到本地 MemPalace 向量存储中,防止记忆丢失,并在未来会话中可用。
问题
A compaction failure erased all conversation history in an OpenCode session, leaving the agent with no memory and effectively lobotomizing it.
结果
The new persistence layer prevents total memory loss from compaction failures, ensuring that all past conversations are recoverable and available for future prompts, even across different sessions and projects.
工作流
- 1. Install MemPalace with uv tool and initialize a memory directory.
- 2. Configure OpenCode to use the opencode‑mempalace‑persistence plugin and enable the local MCP server in opencode.json.
- 3. Provide a two‑line identity file in ~/.mempalace/identity.txt and restart OpenCode.
- 4. The plugin automatically saves every 15 messages, on idle, on exit, and before each compaction, preserving memories across sessions.
证据
Result: total amnesia. Zero memories. The session was effectively lobotomized.
Every conversation is auto‑saved to a local vector palace — zero cloud — and injected back into future prompts, across compactions and across sessions.
- 记录日期: 2026-09-21T15:00:26.573Z