Opencode Mem
このコンテンツはまだ日本語訳がありません。
Opencode Mem is a persistent memory system for AI coding agents enabling long-term context retention across sessions, built on local vector database technology.
Key features
| Feature | Description |
|---|---|
| Local vector database | Embedded Turso/libSQL with native vector indexes (F32_BLOB, vector_top_k) — no separate DB or custom SQLite build |
| Persistent memories | Project memories survive across sessions with dual scopes |
| User profile learning | Automatically learns a user profile over time |
| Unified timeline | Memory and prompt events in one timeline |
| Web UI | Full-featured web interface, including migration tooling |
| Local embeddings | 12+ local embedding models via @huggingface/transformers; multi-provider AI support (OpenAI, Anthropic) |
| Smart deduplication | Avoids duplicate memories; built-in privacy protection |
Prerequisites
- Recommended runtime: Bun and the standard OpenCode plugin environment
- Internet access on first use with the default local embedding model (downloaded by
@huggingface/transformers) - Auto-capture and user-profile learning require an AI provider that can return structured/tool-call output; memory search/add/list work without it
Installation
Add to ~/.config/opencode/opencode.json:
{
"plugin": ["opencode-mem"],
}
Windows: use %USERPROFILE%\.config\opencode\opencode.json — this plugin does not read %APPDATA% or %LOCALAPPDATA% for the plugin entry. The plugin downloads automatically on next startup.
Platform support
CI-tested on Linux, Windows, and macOS 15/26 on both Intel and Apple Silicon. Intel Mac users: the plugin pins [email protected] to avoid a crash in OpenCode’s embedded Bun during process exit — after upgrading, clear OpenCode’s nested plugin cache (~/.cache/opencode/packages/opencode-mem@*) and reinstall, or use a remote embedding endpoint.