True Memory
Local-first, long-term developer memory for VS Code. Capture decisions, bugfixes, and design rationale directly in your editor and recall them semantically at any time — no cloud, no account, no data leaves your machine.
Features
| Feature |
Detail |
| Hybrid recall |
50 % semantic (cosine) + 30 % BM25 lexical + 20 % recency, all tunable |
| Local embeddings |
Xenova/all-MiniLM-L6-v2 runs entirely on-device; weights downloaded once (~22 MB) |
| SQLite persistence |
All records stored in VS Code's global storage; survives restarts and updates |
| Embedding backfill |
Records saved before the model first loaded are automatically backfilled on next model-ready event |
| Score breakdown |
Recall webview shows a per-result bar chart for semantic / lexical / recency scores |
| Remember Selection |
Saves the active editor selection as a typed memory record |
| Remember Note |
Saves a free-form typed note as a memory record |
| Recall |
Hybrid-ranked recall with a score breakdown webview |
| Show Recent |
Lists the 20 most recently updated records |
| Edit Memory |
In-place edit of title, note, and type |
| Delete (Forget) |
Delete any single record with confirmation |
| Export |
Exports all records as Markdown |
| Status bar |
Shows live record count; animates during first model download |
| Workspace snapshot |
Writes a lightweight .memory-index/true-memory-snapshot.json for Copilot/agent context |
Commands
| Command |
Default Keybinding |
Description |
True Memory: Remember Selection |
Ctrl+Shift+M |
Save the current editor selection |
True Memory: Remember Note |
— |
Save a typed note |
True Memory: Recall |
Ctrl+Shift+R |
Search and recall memories |
True Memory: Show Recent |
— |
Browse the 20 most recent entries |
True Memory: Forget (Delete Entry) |
— |
Delete a memory |
True Memory: Edit Memory |
— |
Edit title, text, or type of a memory |
True Memory: Export All Memories |
— |
Export as Markdown |
Memory Types
decision · bugfix · design · failed_attempt · preference · note
Configuration
| Setting |
Default |
Description |
trueMemory.maxRecallResults |
5 |
Maximum recall results shown (1–20) |
trueMemory.writeWorkspaceSnapshot |
true |
Write .memory-index/ snapshot on every change |
trueMemory.semanticWeight |
0.5 |
Blend weight for semantic (cosine) score |
trueMemory.lexicalWeight |
0.3 |
Blend weight for BM25 lexical score |
trueMemory.recencyWeight |
0.2 |
Blend weight for recency decay score |
trueMemory.maxRecords |
500 |
Rolling cap; oldest entries evicted when exceeded (10–5000) |
Tip: semanticWeight + lexicalWeight + recencyWeight should sum to 1.0. If they don't,
the extension normalises recency as max(0, 1 − sem − lex) so scores stay bounded.
How Recall Works
- Your query is embedded locally into a 384-dimensional vector.
- All stored records are scored with BM25 against the query tokens.
- Cosine similarity is computed between the query vector and each record's stored embedding.
- A recency decay factor (30-day half-life) is applied.
- The three scores are blended at the configured weights and the top-N results are shown in a side panel with a visual score breakdown.
When the embedding model has not yet loaded (first launch), recall falls back to BM25 + recency only and shows an informational notice.
Workspace Snapshot
When trueMemory.writeWorkspaceSnapshot is true, every add / edit / delete writes:
.memory-index/true-memory-snapshot.json
This file contains a lightweight version of all records (no raw source text) and can be referenced by Copilot agents or other tools for project context.
Development
# Install (external-drive safe: no symlinks)
npm install --no-bin-links
# Build
npm run build
# Lint
npm run lint
# Typecheck
npm run typecheck
# Tests (34 tests across 4 suites)
npm test
# Package
printf "y\ny\n" | node ./node_modules/@vscode/vsce/vsce package --no-dependencies
--no-bin-links is required when the workspace lives on an external drive that blocks symlink creation.
CI runs on a standard filesystem and uses plain npm install.
Architecture
See ARCHITECTURE.md for the full design. Key points:
src/db.ts — sql.js (WASM) SQLite wrapper, schema v2, configurable eviction
src/embedder.ts — lazy @xenova/transformers pipeline, lifecycle events, test seam
src/retriever.ts — BM25 + cosine hybrid ranking, configurable blend weights
src/memoryStore.ts — public API over db + embedder, backfill on model ready
src/extension.ts — VS Code command registration, status bar, recall webview