OpenCode Memory Plugin

2.13.0 · active · verified Wed Apr 22

OpenCode Memory is a persistent memory system for AI coding agents, providing long-term context retention across sessions using local vector database technology. The package, currently at version 2.13.0, receives frequent minor and patch releases, indicating active development. Key differentiators include its local-first approach using SQLite and USearch (with ExactScan fallback), automated user profile learning, a unified memory-prompt timeline, and a full-featured web UI for management. It supports multi-provider AI (OpenAI, Anthropic) and integrates with over 12 local embedding models, offering intelligent prompt-based memory extraction, smart deduplication, and built-in privacy protection. It acts as an OpenCode plugin, meaning its core functionality is exposed to the AI agent runtime, rather than being directly imported into typical application code.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to enable the opencode-mem plugin within OpenCode and provides examples of how an AI agent interacts with its memory functions.

{
  "plugin": [
    "opencode-mem"
  ]
}
// Save the above JSON to ~/.config/opencode/opencode.json to enable the plugin.
// After OpenCode restarts, your AI agent can interact with memory.

// Example agent interactions (within an OpenCode session):
// memory({ mode: "add", content: "Project uses microservices architecture" });
// memory({ mode: "search", query: "architecture decisions" });
// memory({ mode: "profile" });
// memory({ mode: "list", limit: 10 });

// You can also configure the plugin in ~/.config/opencode/opencode-mem.jsonc
// For example, to set an embedding model:
// {
//   "embeddingModel": "Xenova/nomic-embed-text-v1"
// }

view raw JSON →