memory_vault
Stores and manages scoped memory cards as Markdown files in a local vault, with indexing, hybrid search, anchor verification, corrections, and atomic writes for AI coding agents.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
AnchorDex
简体中文 · Changelog: CHANGELOG.md
A pull-based, self-verifying Markdown Memory Vault for AI coding agents — built on Node.js with zero external npm dependencies.
AnchorDex keeps permanent system prompts (AGENTS.md, CLAUDE.md, GEMINI.md) lean by storing durable engineering knowledge as scoped Markdown cards in ~/.memory-vault. Agents retrieve only cards that match the active task, verify file and line anchors against disk before indexing, preserve immutable revision history, and share the same local knowledge store across Antigravity, Claude Code, Codex CLI, Cursor, and DSH.
All storage, indexing, search, anchor verification, and atomic file operations run locally on plain Markdown files inside~/.memory-vault (or $MEMORY_VAULT_DIR) without external databases or network services.
Core Mechanisms
1. Compact Index & On-Demand Retrieval
00-System/INDEX.md: Maintains a concise routing table and recent-card summary so agents inspect available topics without pre-loading full notes into every conversation.00-System/INDEX-full.md& Hash-Isolated Cache: Generates a full metadata catalog alongside a single-file JSON cache (~/.cache/memory-vault/memory-search-cache-<vault-hash>.json), checking per-cardstatSyncmetadata so direct file edits invalidate stale cache entries automatically.
2. Applicability Boundaries & Abstention
Explicit Scoping (
applies_when/not_when): Every active card declares concrete trigger conditions in YAML frontmatter. Cards missing required boundaries are excluded from active auto-recall.Layered Hybrid Search (
memory-search.mjs): Scores EN/CJK queries with BM25+IDF weighting while separating strict synonym groups (strict), unidirectional weak associations (weak), and cross-domain generic terms (generic).Abstention-First
PreInvocationHook: Injects0–3relevant cards when specificity thresholds are met, and returns{}silently on unrelated prompts to keep context clean.
3. Anchor Verification & Write Guards
Disk-Backed Checks (
memory-verify.mjs): Verifies referenced local file paths,file:lineanchors, numeric counts, andsuperseded_bylinks against the filesystem.Write Gate: Writes or corrections with failing anchors return
isError: truefrom MCP and skip updatingINDEX.mdand the search cache until resolved.Direct-Edit Guards:
PostToolUsestrips UTF-8 BOMs and stages modified paths without premature indexing;Stopvalidates staged writes and[git-delta]direct edits across both Git and non-Git vaults before rebuilding indexes.
4. Honest Metadata & Immutable History
Strict
verified_atDiscipline:memory_writerecordsverified_atonly when explicitly provided after verification;status: draftomitsverified_atautomatically.Non-Destructive Revisions (
memory_correct): Prepends a datedCORRECTIONblock above preserved original text, or retires replaced entries via--supersede <new-card>(status: superseded).Bi-Temporal States: Supports
approved,draft,pending,archived(searchable and exempt from 30-day environment staleness warnings),superseded, andreverted.
Related MCP server: projectmem
Architecture
User Prompt ─▶ PreInvocation Hook (autoRecall gate + cache) ─▶ Injects 0–3 scoped cards, or abstains
Agent Turn ─▶ MCP Server (stdio JSON-RPC 2.0) or CLI fallback resolved from SKILL_DIR
Direct Edit ─▶ PostToolUse Hook (strip UTF-8 BOM + stage touched path)
Turn End ─▶ Stop Hook (checks PostToolUse + [git-delta]; rebuilds index & commits baseline on 0 FAIL)
Shared Store ─▶ ~/.memory-vault/ (atomic rename via writeFileAtomic + per-vault SHA-1 cache)Supported Frameworks
Client | Install Path ( | MCP Registration | Vault Alignment |
Antigravity |
|
|
|
Claude Code |
|
|
|
Codex CLI |
|
|
|
Cursor |
|
|
|
DSH |
| Native Skill / CLI tools |
|
All card writes, index rebuilds, corrections, and installer config updates use writeFileAtomic() (same-directory temporary file + renameSync with transient lock retry) for safe concurrent access across clients.
Installation
Requires Node.js >= 20 (no npm install needed; Node.js >= 22.15.0 is optional if you want memory_harvest to decompress .zst/.zstd session logs via built-in zlib.zstdDecompressSync).
Auto-Detect Installed Clients
git clone https://github.com/ylx9000/anchordex.git
cd anchordex
# Install only into frameworks already present on this machine
node scripts/install.mjs --target auto
# Read-only status check: vault counts, MCP registration, and path alignment
node scripts/install.mjs --statusTarget-Specific & Custom Vault Options
node scripts/install.mjs --target antigravity
node scripts/install.mjs --target claude
node scripts/install.mjs --target codex
node scripts/install.mjs --target cursor
node scripts/install.mjs --target dsh
node scripts/install.mjs --target all
# Point all detected clients to a custom shared vault (syncs plugin-config.json)
node scripts/install.mjs --target auto --vault ~/notes/agent-memory
# Standalone Agent Skill only (no MCP config edits)
node scripts/install.mjs --target skill --skill-dir ~/.agents/skills/memory-vault --no-mcp
# Remove AnchorDex skill bundles and MCP registrations (preserves ~/.memory-vault)
node scripts/install.mjs --uninstall --target autoAgent Skills CLI (npx skills)
npx skills add ylx9000/anchordexnpx skills add installs the standalone Agent Skill and CLI fallback scripts (initializing ~/.memory-vault/ automatically on first use). Run node scripts/install.mjs --target auto if you also want automatic MCP server registration (Claude Code, Codex CLI, Cursor) and Antigravity lifecycle hooks (PreInvocation, PostToolUse, Stop).
Customization & Session Harvesting
00-System/routes.json(routes.json.example): Pin custom task-to-card routes at the top ofINDEX.md.00-System/synonyms.json(synonyms.json.example): Extendstrictalias groups,weakassociations, andgenericstop-guard terms.memory_harvest(memory-harvest.mjs): Scans recent Claude Code, Codex CLI, Antigravity (transcript_full.jsonl/transcript.jsonl), and DSH logs for user corrections and repeated tool errors.
Verification
npm test # Isolated E2E suite (MCP, hooks, atomic writes, multi-client install, cold start)
npm run test:eval # EN/CJK precision, abstention benchmark, and in-place cache invalidation
npm run check # UTF-8 no-BOM, LF line endings, version parity, and secret scan
npm run status # Read-only cross-client Vault status reportLicense
MIT © ylx9000
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Project memory, documentation and controlled secret access for AI coding agents.
Long-term, rotatable project memory and pre-write checks for AI coding agents.
Shared, scoped, reviewable team memory for AI coding agents.
Project memory for software teams: decisions, root causes, fixes, failed approaches and conventions that Claude, Claude Code, Codex, Grok and other MCP clients can search and save, shared across your agents. Memroot receives only what the agent sends in a search or a save, never your conversations; for the full experience in coding agents (automatic memory checks and session capture), run npx memroot setup.
Related MCP Servers
- AlicenseAqualityBmaintenanceProvides long-lived, cross-project technical memory for AI agents via markdown cards stored in git and indexed by SQLite, enabling search, retrieval, and human-reviewed knowledge management.51,364 npm1ISC
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to persist project memory across sessions by compiling decisions, progress, and pitfalls into git-linked, evidence-backed entries. It lets clients add, query, inject, scan for stale, check assertions on, and compute ROI of those memories over stdio.MIT
- AlicenseAqualityBmaintenanceEnables coding agents to store, search, and retrieve long-term memory as plain Markdown files with a disposable SQLite index, including note management, decision/bug tracking, and codebase symbol lookup via MCP.8MIT
- AlicenseNot gradedqualityBmaintenanceGives coding agents a persistent memory by searching a local, read-only index of existing markdown and letting them write findings back as notes that the next session can retrieve. It serves ranked, context-sized results over MCP, injects standing conventions at session start, and keeps data on your machine with secret redaction and archive-only deletion.MIT