Mem0 OpenCode Plugin (v0.1.3)
Added
- File-context injection (
tool.execute.before/ Read): Before the agent reads a file, the plugin searches mem0 for memories referencing that file path and injects prior work as system context. Gates on file size (>= 1,500 bytes). Gives the agent "I've worked on this file before" awareness automatically. - Stop hook session summary (
experimental.session.compacting): Enhanced session compaction to store a structuredsession_summarymemory withinfer=True, letting the mem0 backend AI extract key facts (request, decisions, learnings, next steps). Previously only stored a raw stats string. - SessionStart activity timeline: The initial memory loading now formats recent memories with type icons (⚖️ decision, 🔴 bug_fix, 🔵 task_learning, etc.) and relative age indicators (2h ago, 1d ago) instead of bare text. Provides a visual "Recent Activity" timeline on first message.
- PostHog telemetry (
telemetry.ts): Anonymous, fire-and-forget usage events. Opt out withMEM0_TELEMETRY=false. Only fires when an API key is present; never sends memory content, prompts, or the API key — only an anonymizedsha256(apiKey)[:32]identity plus event type, platform, and plugin version. Emits the same schema as the Mem0 editor plugin (plugin.*events,source: "plugin",platform: "opencode") so OpenCode appears as aplatformin the shared plugin dashboard. Events:plugin.session_start(with memory count) andplugin.tool_use(add/search/update/delete).
Changed
experimental.session.compactinghandler: Now storesmetadata.type=session_summarywithmetadata.source=opencode-stopinstead ofmetadata.type=session_statewithmetadata.source=pre-compaction. Includes a structured prompt that instructs mem0's AI to extract request, decisions, learnings, and next steps.- Initial context formatting: Memories shown on first message now include type icons and age labels for quick scanning.