Repository navigation
v1.5.0
Local-first persistent memory for OpenCode — decay fix, provenance, contradiction lifecycle, memory tiers, hybrid retrieval, per-fact privacy and an evaluation suite.
What's new in 1.5.0
- Decay fix: time-based decay now applies exactly once in
score()(fromlastSeen);weightis a static importance baseline, so forgetting no longer depends on how often pruning runs. - Provenance: dreamed facts record their source session, messages, extraction time and confidence; new
memory_whytool audits where a memory comes from and why it ranks where it does. - Contradiction lifecycle: conflicting explicit facts are flagged CONFLICTED (never silently overwritten) and resolved via
memory_update/memory_write; replaced dreamed facts become SUPERSEDED tombstones. - Memory tiers:
core(always surfaced) /archival(on relevance) /temporary(auto-expiry) /pinned(never decays), with automatic v1 → v2 store migration. - Hybrid retrieval: lexical pipeline (scope filter + bilingual keyword expansion + time score) with optional semantic reranking stage (
OPENCODE_MEMORY_RERANK=1); off-topic queries surface only the core slot. - Retrieval feedback:
memory_useful/memory_irrelevanttune ranking from real usage. - Per-memory privacy:
sensitivity: "local-only"facts never leave the machine — not surfaced to providers, not sent during consolidation. - Memory Inspector:
/memorywith stats, conflicts, project scope and "why was this surfaced" breakdown. - Evaluation suite:
bun run bench— 90 scenarios across 13 failure modes (paraphrase, IT/EN cross-language, synonyms, distractors, contradictions, duplicates, isolation, obsolete, false positives, none, feedback, multi-expected).
Benchmark (lexical pipeline, suite of 90)
Recall@5: 100.0%
MRR (first hit): 95.0%
False-surface rate: 0.0%
Context overhead: 13.8 tokens/query
Install: add @cioffi_ai/opencode-memory to plugin in ~/.config/opencode/opencode.json(c) (or update your cached version to 1.5.0).