Skip to main content
OpenCode-Supermemory is an OpenCode plugin that gives your AI persistent memory across sessions. Your agent remembers what you worked on — across sessions, across projects.
Prefer to keep everything on your machine? This plugin works with self-hosted Supermemory — run npx supermemory local, then set apiKey / base URL in ~/.config/opencode/supermemory.jsonc and use the API key printed on first boot.

Install the Plugin

For LLM agents (non-interactive):

Authenticate

Browser login (recommended):
Check the connection any time:
Or set an API key manually from app.supermemory.ai / API Keys:
Ensure your ~/.config/opencode/opencode.jsonc contains:

How It Works

Once installed, the plugin runs automatically:
  • Context Injection — On session start, relevant memories are fetched and injected into the agent’s context (user profile, project knowledge, semantic matches).
  • Keyword Detection — Phrases like “remember” or “save this” trigger automatic storage.
  • Smart Compaction — At 80% context capacity, sessions are summarized and saved as memories.
  • Privacy Protection — Content within <private> tags never persists.

Memory Scopes

Memory Types

Commands

/supermemory-init

Explore and index your codebase structure into memory:

Tools

The agent has access to a supermemory tool with these modes:

Configuration

Create ~/.config/opencode/supermemory.jsonc:

Logging

View plugin activity:

Next Steps

GitHub Repository

Source code, issues, and detailed README.

Claude Code Plugin

Memory plugin for Claude Code.