tickernelz/opencode-mem

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

What it solves

OpenCode Memory provides a persistent, long-term memory system for AI coding agents. It prevents the loss of technical context, project-specific decisions, and user preferences across different sessions, ensuring that AI agents maintain a consistent understanding of a project's evolution and the user's working habits.

How it works

The system uses a local vector database (Turso/libSQL) to store memories as embeddings. It employs a hybrid approach to memory management:

  • Auto-capture: A background AI process automatically extracts and summarizes technical context from conversations when a session goes idle.
  • Manual Control: Users can explicitly add, search, or forget memories using a memory tool.
  • User Profile: The system learns a cross-project summary of user preferences and habits over time.
  • Context Injection: Relevant memories are automatically injected into the AI model's system context during sessions.
  • Embeddings: It supports both local embeddings via Hugging Face Transformers (running on CPU via ONNX) and remote OpenAI-compatible embedding APIs.

Who it’s for

Developers using OpenCode who want their AI coding assistants to remember project decisions, bug patterns, and personal preferences across multiple chat sessions.

Highlights

  • Local-First Persistence: Uses Turso/libSQL for native vector search without requiring a separate database server.
  • Intelligent Auto-Capture: Automatically summarizes technical work into memories without requiring manual user prompts.
  • Cross-Project Learning: Maintains a separate user profile to track habits and preferences across different projects.
  • Web Management UI: Includes a built-in web interface (at port 4747) to browse, inspect, and manage memories.
  • Privacy and Security: Supports AES-256-GCM encryption for local database shards at rest.
  • Flexible Embedding Options: Supports 12+ local embedding models or remote API-based embeddings.

Related

  • Project
  • Project
  • Project
  • Project
  • Project