delete-mcp-memory
Local MCP server compatible with any studio-based AI client. Provides persistent structured memory, semantic search and reindexing using local embeddings and LanceDB.
Install / Use
claude mcp add nla-agent -- npx -y github:nla-agent/delete-mcp-memoryIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Tags
Skill content
View source on GitHub⚠️ Active Development — APIs and tools may change without prior notice. Use tagged releases (
vX.Y.Z) for stability.
Local MCP server compatible with any stdio-based AI client. Provides persistent structured memory, semantic search, version tracking and reindexing using local embeddings and LanceDB.
Stack
- Vector DB: LanceDB (local, stored in
./vectorial/) - Embeddings:
nomic-embed-textvia Ollama - Protocol: MCP over stdio
- Runtime: Node.js + TypeScript (
tsx)
Architecture
src/
├── types/ # Zod schemas + TypeScript types
├── functions/ # Business logic (pure functions)
└── tools/ # Tool registration (glue code)
All tools use the data_* prefix for a unified API.
Memory System
1. Structured Memory (memories table)
CRUD entries with semantic embeddings, FTS indexing, automatic version tracking, and priority weights (1-10). Persists across sessions.
Each memory has:
- Embedding (
embeddings): Semantic embedding of the full body text (768-dim via nomic-embed-text) - Full-text search: BM25 index on body for keyword-based search
- Weight (1-10): Prioritizes critical memories in search results
- Weight 8-10: Full body returned in search results
- Weight 5-7: Full body or excerpt depending on mode
- Weight 1-4: Excerpt only
| Type | Purpose |
|------|---------|
| soul | Agent identity, values and personality |
| user | User profile: role, expertise, preferences |
| feedback | Learned rules: corrections and confirmed approaches |
| project | Active work, decisions, project state |
| reference | Pointers to external systems, tools, docs |
| pending | Open tasks and follow-ups |
2. Indexed Sources (5 tables)
| Table | Source | Description |
|-------|--------|-------------|
| memories | ./memories/ | Structured entries with types |
| codebase | ./coding/ | Source code (.ts, .tsx, .js, .jsx) |
| docs | ./coding/ | Documentation (.md, .sql, .json) |
| reference | ./reference/ | User-provided code examples, guides, and learning materials |
| chatlogs | ./chatlogs/ | Conversation history |
Default directories are relative to the project root. Configure via environment variables or use defaults.
Default Paths
If no .env is configured, the following defaults are used:
vectorial/— LanceDB storagememories/— Markdown memory vaultcoding/— Code to index (you need to place your project here or configureCODING_DIR)reference/— User-provided code examples and learning materialschatlogs/— Conversation history
3. Version History (memory_versions table)
Automatic snapshot saved every time a memory is updated. Query with data_versions(name).
Unified API (14 tools)
All tools use the data_* prefix for consistency.
Search
| Tool | Description |
|------|-------------|
| data_search | ⭐ Unified search. Use source param: memories, codebase, docs, chatlogs, or all for global search across all 4 sources. Supports mode: critical, condensed, full, lite |
CRUD
| Tool | Description |
|------|-------------|
| data_create | Create new memory with auto-embedding. Params: type, name, body, tags, weight |
| data_update | Update memory by ID. Auto re-embeds body. Params: id, body, tags, weight, name |
| data_delete | Delete memory by ID. Params: id |
| data_list | List memories. Params: type (optional), tag (optional filter) |
| data_count | Count memories. Params: type (optional) |
| data_get | Get memory by exact name. Params: name |
Context
| Tool | Description |
|------|-------------|
| data_context | ⭐ RECOMMENDED Session bootstrap. Params: mode (minimal/compact/full) OR task for smart context loading |
| data_recent | Recent memories by date. Params: days, limit |
| data_stats | Statistics: total count, breakdown by type, oldest/newest, avg body length |
| data_versions | Version history of a memory by name. Params: name |
Files
| Tool | Description |
|------|-------------|
| data_files | List markdown files in vault. Params: type (optional) |
| data_sync | Sync vault files to vector DB. Params: type, dry_run, import_missing |
| data_export | Export memories to markdown files. Params: type, overwrite |
Agent Usage Protocol
SESSION START (RECOMMENDED):
1. data_context() ← minimal mode, ~50 tokens
OR
1. data_context(mode: "compact") ← ~1.5k tokens with previews
OR (smart)
1. data_context(task: "what I'm doing") ← semantic smart loading
DURING WORK — when you learn something new:
→ data_create(type, name, body, tags, weight)
FETCHING A KNOWN MEMORY:
→ data_get(name: "exact_name") ← O(1), no embedding cost
FETCHING CRITICAL RULES:
→ data_list(tag: "CRITICAL")
SEARCHING:
→ data_search(source: "memories", query: "...")
→ data_search(source: "all", query: "...") ← global search across all sources
HOUSEKEEPING:
→ data_stats() ← check totals
→ data_versions(name: "memory_name") ← view history
Setup
cp .env.example .env # fill in your paths
pnpm install
pnpm test # diagnostic: verify all connections and counts
pnpm index:all # initial indexing
pnpm start # start MCP server
Indexing
Upload (Markdown → Vector DB)
pnpm index # code + docs + reference + chatlogs (all sources)
pnpm index:code # source code only
pnpm index:docs # documentation only
pnpm index:reference # user-provided guides and examples
pnpm index:chatlogs # conversation history only
Download (Vector DB → Markdown)
pnpm download # export all memories to markdown
pnpm download:memories # export memories only
Indexers are incremental — only new or modified files are processed.
To reindex from scratch:
rm -rf ./vectorial/
pnpm index
Environment Variables
| Variable | Description |
|----------|-------------|
| OLLAMA_HOST | Ollama server URL (default: http://localhost:11434) |
| CODING_DIR | Path to code repository to index (default: ../coding) |
| CHATLOG_DIR | Path to chatlogs folder (default: ../_memory/chatlogs) |
| REFERENCE_DIR | Path to user-provided guides and examples (default: ../_memory/reference) |
| LANCEDB_DIR | Path to LanceDB storage (default: ../_memory/vectorial) |
| MEMORIES_DIR | Path to memories vault (default: ../_memory/memories) |
| MEMORIES_WRITE_ENABLED | Enable writing to vault (default: true) |
| IGNORE_PREFIXES | Comma-separated prefixes to skip during indexing (default: _) |
| BATCH_SIZE | Chunks per batch for embedding and parallel file reads (default: 20) |
Community
See INSTALL.md for setup. Contributions are subject to natuleadan review policies and terms.
Thanks to all contributors:
<p align="left"> <a href="https://github.com/natuleadan"><img src="https://avatars.githubusercontent.com/u/210283438?v=4&s=48" width="48" height="48" alt="natuleadan" title="natuleadan"/></a> <a href="https://github.com/leojara95"><img src="https://avatars.githubusercontent.com/u/268038834?v=4&s=48" width="48" height="48" alt="leojara95" title="leojara95"/></a> </p>Star History
<a href="https://www.star-history.com/?repos=leojara95%2Fmcp-memory&type=date&legend=top-left"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/image?repos=natuleadan/mcp-memory&type=date&theme=dark&legend=top-left" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/image?repos=natuleadan/mcp-memory&type=date&theme=light&legend=top-left" /> <img alt="Star History Chart" src="https://api.star-history.com/image?repos=natuleadan/mcp-memory&type=date&legend=top-left" /> </picture> </a>License
MIT © Leonardo Jara
Related Skills
caveman
106.4k🪨 why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.
claude-mem
94.1kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Understand-Anything
83.2kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
Agent-Reach
82.9kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
