← Back to Leaderboard
Otickernelz

tickernelz/opencode-mem

An OpenCode plugin with embedded vector search for cross-session coding memory

Engineering Health (Methodology)
A+ · 92/100
Maintenance Activity
● Updated 4d ago
Latest Release
v2.44.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption17/25
Release Cadence20/20
License Clarity20/20
Local AISelf-Hosted
Total Stars
★ 1,917
24h Growth
+5
7d Growth
+27
Forks
199

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

tickernelz/opencode-mem Star History (2026-01-11 - 2026-12-03) ALL-TIME STAR HISTORY (2026-01 – 2026-12) +1.9k in 326d · avg +6/day 2k 1k 0 2026-01-11: ★ 12026-01-31: ★ 462026-02-21: ★ 1122026-03-14: ★ 2052026-04-04: ★ 3612026-04-25: ★ 5112026-05-16: ★ 6682026-06-06: ★ 8072026-06-27: ★ 9462026-07-18: ★ 1,1482026-08-08: ★ 1,2672026-08-29: ★ 1,5632026-09-19: ★ 1,6342026-10-10: ★ 1,7082026-10-31: ★ 1,7952026-11-20: ★ 1,8712026-12-03: ★ 1,917 ★ 1.9k 2026-01 2026-06 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

opencode-mem is a TypeScript extension loaded by OpenCode itself. When a session goes idle, a background model request extracts durable project memories from the technical work. The plugin embeds and stores those memories under storagePath; at recall time it can supply relevant records and the cross-project user profile as model context. In OpenCode v2, that context goes into the system layer rather than the authored prompt or chat transcript. The default chatMessage.injectOn: "first" retains the initial context across turns; "always" refreshes it on each authored user turn. After a restart, a resumed session rebuilds context from the current store, so it may not see exactly what it saw before.

The manifest includes @opencode-ai/plugin, @opencode-ai/sdk, @libsql/client and @tursodatabase/database. The current embedded Turso path stores vectors as F32_BLOB and uses vector_distance_cos for exact ranking; an optional hybrid ranking path adds keyword signals without FTS5. Session lookups use an indexed session_id, while src/services/turso/schema-migrations.ts applies pending PRAGMA user_version migrations to memory shards and auxiliary databases. For source checkouts, the root index.js and tui.js bridge OpenCode to the built plugin and its TUI companion.

Key Capabilities & Differentiators

Automatic capture and user-profile learning need a provider capable of structured or tool-call output. You can reuse an OpenCode-configured provider and model, or configure a separate API such as OpenAI Chat Completions, OpenAI Responses or Anthropic. Embedding is independent of that choice: the plugin offers more than a dozen CPU-capable local models, with Xenova/nomic-embed-text-v1 as the default, or an OpenAI-compatible embedding endpoint. Manual memory add, search and list still work without a capture provider, provided embeddings are available.

Memory maintenance includes deduplication, optional updates during capture and optional consolidation with recoverable trash. An optional Markdown vault and export, import and migrate operations support project portability. The web UI brings together a memory–prompt timeline, profile, skill library, vault and health statistics. Before capture requests, the plugin redacts recognizable credentials from the context sent to the configured provider, including a fallback; it sanitizes generated summaries and tags again before embedding and storage. Explicit adds use the same write boundary. Optional AES-256-GCM encryption protects local Turso shards at rest, but the key must be backed up separately to keep encrypted data recoverable.

Trade-offs & Limitations

Compared with AGENTS.md, vector recall is better suited to accumulated decisions, failed approaches and bug patterns, but it is not a reliable place for mandatory instructions: retrieval is selective, and default first-turn context is not refreshed on every user turn. Skills are the better fit for procedures loaded on demand. Compared with a separate vector service, embedding Turso removes a deployment dependency. Its exact cosine search has no approximate vector index, though, so check recall cost against the size of your actual shards rather than assuming it stays flat as history grows.

Local embeddings trade provider dependency for CPU, RAM and cache use. A remote embedding or capture provider reduces local processing for that task but sends the corresponding text outside the host; best-effort redaction can miss custom or split credentials and does not cover OpenCode’s main-model or tool traffic. Shared storage also has limits: Linux and macOS use experimental multiprocess WAL for concurrent OpenCode processes, while Windows supports one database owner at a time. Avoid a separate SQLite writer against the same store; it can invalidate Turso’s WAL index and cause a write to be silently lost. Use single-owner mode when other tools touch the database files.

Hardware & Deployment Guide

Use a standard OpenCode environment; Bun is the recommended runtime. OpenCode v2 registers opencode-mem@latest in plugins, while v1 uses plugin. For a local v2 checkout, run bun install && bun run build and point the plugin list at the package root, not dist/ or an individual file. The default embedding model needs internet access for the initial download and then runs on the CPU. Whether capture can stay offline is a separate provider decision. Native Turso bindings cover glibc Linux x64 and arm64, Apple Silicon macOS, and x64 Windows. Alpine/musl and Intel Macs lack compatible bindings; selecting remote embeddings does not remove that requirement.

Test upgrades against a backed-up store: startup converts legacy libSQL DiskANN storage and applies shard migrations, backing up databases and preserving vectors during engine conversion without re-embedding. Keep all processes sharing a store on the same WAL mode and restart them together after an upgrade. For controlled rollouts, pin the npm version; with an eligible version range and autoUpdate enabled, the plugin can clear the cached package and prompt a restart. Recent changes include a Standard Compute provider preset in v2.42.0, French web UI and documentation in v2.43.0, and a v2.44.0 fix that keeps the configured provider connected when a directory becomes unavailable.

Storage: Embedded Turso stores F32_BLOB vectors and ranks them with vector_distance_cos; no separate vector service is required.
Capture: Idle-session extraction uses a structured-output provider; manual add, search and list do not require a capture provider.
Recall: OpenCode v2 supplies memory through system context, with first-turn injection by default or refresh on every authored user turn.
Embeddings: CPU inference uses Transformers and ONNX, with OpenAI-compatible embedding endpoints as an alternative.
Portability: An optional Markdown vault and memory export, import and migrate operations support moved or copied projects.
Operations: The web UI combines the memory–prompt timeline, profile, skills and health views; HTTP Basic Auth is optional.
Best For

OpenCode users who repeatedly revisit the same projects and want selective recall of decisions, debugging history and working preferences without operating a separate vector database.

Skip If

You mainly need always-on instructions, need a shared store across multiple OpenCode processes on Windows, run on Alpine or an Intel Mac, or cannot approve the data paths required by your chosen providers.

Reviewed on 2026-12-02 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

Local AISelf-Hosted
memory({ mode: "add", content: "Project uses microservices architecture" });
memory({ mode: "search", query: "architecture decisions" });
memory({ mode: "search", query: "architecture decisions", scope: "all-projects" });
memory({ mode: "profile" });
memory({ mode: "list", limit: 10 });
memory({ mode: "list-shards" });
memory({ mode: "migrate", fromPath: "/old/path/to/project" });
memory({ mode: "export", outputPath: "./memories.json" });
memory({ mode: "import", inputPath: "./memories.json" });

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/tickernelz/opencode-mem.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

tickernelz/opencode-mem Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about opencode-mem

How does it integrate with OpenCode, and where does recalled memory appear?

It is a native OpenCode plugin, not a separately deployed MCP server. On OpenCode v2, register it in plugins; the package’s TUI companion normally loads automatically. Recall is passed to the model as system context, not appended to the authored user prompt or chat transcript. A CLI-only TUI connected to a remote OpenCode server must register opencode-mem/tui separately on the client to receive toasts.

Does it require a GPU, and how much RAM and disk should I budget?

No GPU or extra VRAM is required. Local embedding inference runs on the CPU through Transformers and ONNX, typically using about 0.5–2 GB of RAM while the chosen model is loaded. The first run downloads the model; its cache can range from hundreds of MB to roughly 1–2 GB per model. Remote embeddings remove most local inference overhead but still require the embedded Turso database.

Can we use it commercially and meet a local-data policy?

The MIT license permits commercial use and self-hosting, with its copyright and license notices retained when distributing copies or substantial portions. That permission does not settle data-handling requirements: review where capture and embedding requests go, what the main OpenCode provider receives, and how the database key, backups and optional web UI are protected. Redaction is best effort and does not cover OpenCode’s original traffic.

When is it a better fit than AGENTS.md, Skills, or hand-maintained notes?

Use AGENTS.md for rules that must always apply, Skills for reusable procedures loaded on demand, and this plugin for project history that grows across sessions and needs selective recall. If deterministic context selection and simple file review matter more than automatic capture, start with ordinary project files. Add the plugin when maintaining and finding that history becomes a recurring burden.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining tickernelz/opencode-mem? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature tickernelz/opencode-mem on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare