GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Coqueiro/opencode-mem: OpenCode plugin that gives coding agents persistent memory using local vector database

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

235 Commits
235 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
.husky
.husky
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
README.md
README.md
 
 
bun.lock
bun.lock
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

OpenCode Memory

npm version npm downloads license

OpenCode Memory Banner

A persistent memory system for AI coding agents that enables long-term context retention across sessions using local vector database technology.

Visual Overview

Project Memory Timeline:

Project Memory Timeline

User Profile Viewer:

User Profile Viewer

Core Features

Local vector database with SQLite + USearch-first vector indexing and ExactScan fallback, persistent project memories, automatic user profile learning, unified memory-prompt timeline, full-featured web UI, intelligent prompt-based memory extraction, multi-provider AI support (OpenAI, Anthropic), 12+ local embedding models, smart deduplication, and built-in privacy protection.

Prerequisites

This plugin uses USearch for preferred in-memory vector indexing with automatic ExactScan fallback. No custom SQLite build or browser runtime shim is required.

Recommended runtime:

  • Bun
  • Standard OpenCode plugin environment

Notes:

  • If USearch is unavailable or fails at runtime, the plugin automatically falls back to exact vector scanning.
  • SQLite remains the source of truth; search indexes are rebuilt from SQLite data when needed.

Getting Started

Add to your OpenCode configuration at ~/.config/opencode/opencode.json:

{
  "plugin": ["opencode-mem"],
}

The plugin downloads automatically on next startup.

Usage Examples

memory({ mode: "add", content: "Project uses microservices architecture" });
memory({ mode: "search", query: "architecture decisions" });
memory({ mode: "profile" });
memory({ mode: "list", limit: 10 });

Access the web interface at http://127.0.0.1:4747 for visual memory browsing and management.

Configuration Essentials

Configure at ~/.config/opencode/opencode-mem.jsonc:

{
  "storagePath": "~/.opencode-mem/data",
  "userEmailOverride": "[email protected]",
  "userNameOverride": "John Doe",
  "embeddingModel": "Xenova/nomic-embed-text-v1",
  "webServerEnabled": true,
  "webServerPort": 4747,

  "autoCaptureEnabled": true,
  "autoCaptureLanguage": "auto",

  "opencodeProvider": "anthropic",
  "opencodeModel": "claude-haiku-4-5-20251001",

  "showAutoCaptureToasts": true,
  "showUserProfileToasts": true,
  "showErrorToasts": true,

  "userProfileAnalysisInterval": 10,
  "maxMemories": 10,

  "compaction": {
    "enabled": true,
    "memoryLimit": 10,
  },
  "chatMessage": {
    "enabled": true,
    "maxMemories": 3,
    "excludeCurrentSession": true,
    "maxAgeDays": undefined,
    "injectOn": "first",
  },
}

Auto-Capture AI Provider

Recommended: Use opencode's built-in providers (no separate API key needed):

"opencodeProvider": "anthropic",
"opencodeModel": "claude-haiku-4-5-20251001",

This leverages your existing opencode authentication (OAuth or API key). Works with Claude Pro/Max plans via OAuth - no individual API keys required.

Supported providers: anthropic, openai

Fallback: Manual API configuration (if not using opencodeProvider):

"memoryProvider": "openai-chat",
"memoryModel": "gpt-4o-mini",
"memoryApiUrl": "https://api.openai.com/v1",
"memoryApiKey": "sk-...",

API Key Formats:

"memoryApiKey": "sk-..."
"memoryApiKey": "file://~/.config/opencode/api-key.txt"
"memoryApiKey": "env://OPENAI_API_KEY"

Full documentation available in this README.

Development & Contribution

Build and test locally:

bun install
bun run build
bun run typecheck
bun run format

This project is actively seeking contributions to become the definitive memory plugin for AI coding agents. Whether you are fixing bugs, adding features, improving documentation, or expanding embedding model support, your contributions are critical. The codebase is well-structured and ready for enhancement. If you hit a blocker or have improvement ideas, submit a pull request - we review and merge contributions quickly.

License & Links

MIT License - see LICENSE file

  • Repository: https://github.com/tickernelz/opencode-mem
  • Issues: https://github.com/tickernelz/opencode-mem/issues
  • OpenCode Platform: https://opencode.ai

Inspired by opencode-supermemory

About

OpenCode plugin that gives coding agents persistent memory using local vector database

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.