Menu

Give Your AI Persistent Memory: OpenCode + MemPalace in 10 Minute
πŸ–ΌοΈ

Give Your AI Persistent Memory: OpenCode + MemPalace in 10 Minute

DEV CommunityΒ·gecoΒ·5 months ago
#270omAII
#ai#opencode#mempalace#plugin#article
Reading 0:00
15s threshold

The Problem

Every OpenCode session starts from scratch. Your AI doesn't remember past conversations, decisions, or solved problems. You repeat context over and over.

The Solution

opencode-mempalace-persistence is a pure TypeScript plugin that auto-saves every conversation to MemPalace β€” a local vector database with 96.6% recall on LongMemEval. No cron, no cloud, no API keys.

Architecture

The plugin uses two OpenCode hooks:

chat.message β€” when you send a new question, the previous turn (question + answer) is saved

session.idle β€” catches the last turn before you close OpenCode

Each turn is categorized by wing type (developer, creative, emotions, family, consciousness) and fed to MemPalace's vector store. Knowledge Graph facts (decisions, milestones, problems, preferences) are extracted automatically.

The mining runs asynchronously β€” state is saved immediately, and MemPalace indexing happens in the background.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.