Enhanced Knowledge Graph Memory Server
The Enhanced Knowledge Graph Memory Server is an enterprise-grade MCP server with 106 tools for structured knowledge storage, search, and management across sessions.
Core Knowledge Graph Operations
Create, read, update, and delete entities, relations, and observations
Read the full graph or open specific nodes; normalize observations (coreference resolution, temporal anchoring)
Search & Discovery
Basic, date-range, TF-IDF ranked, boolean, fuzzy, and auto-select search
Semantic (embedding-based), hybrid multi-layer, and smart reflection-based search
Query analysis, search suggestions, and saved/reusable named queries
Hierarchical Organization
Set parent-child relationships; navigate children, parents, ancestors, descendants, and subtrees
Move entities, get root entities, and determine entity depth
Tag & Importance Management
Add, remove, replace, merge, and bulk-apply tags; set importance scores (0–10)
Create tag aliases (synonyms) and resolve tags to canonical forms
Graph Algorithms & Analytics
Find shortest or all paths between entities; detect connected components
Calculate centrality metrics (degree, betweenness, PageRank); get graph statistics and validate integrity
Memory Compression & Archiving
Detect and merge duplicate entities; compress the graph (with dry-run preview)
Archive entities by age, importance, or tags
Import & Export
Export to 7 formats: JSON, CSV, GraphML, GEXF, DOT, Markdown, Mermaid (with optional Brotli compression and streaming)
Import from JSON, CSV, or GraphML with configurable merge strategies
Temporal Features
Search by time window; invalidate relations with end dates; time-travel queries; relation timelines
Governance & Audit
Governed transactions with full audit trail; query audit log; roll back operations
Freshness Tracking
Check, refresh, and report on entity freshness; list stale or expired entities
Memory Lifecycle
Version entities and retrieve version chains; semantic forget (exact or similarity-based deletion)
Configurable observation distillation pipelines; background memory consolidation
Agent & Collaboration Features
Per-agent diary (write/read journal entries) and role profiles
User/agent profile management; collaborative multi-agent context synthesis
Cognitive load analysis and adaptive memory reduction
Ingestion & LLM Query
Ingest conversations, documents, or free-form text into the graph
Answer natural-language questions over the graph
Utilities
Symbolic reference index for cross-session consistency
Named versioned content artifacts attached to entities
Entropy-based noise filtering and information-density scoring
Salience-budget-aware context formatting; project scoping; session failure handling
Storage Backends: JSONL or SQLite (SQLite offers 3–10× faster performance with FTS5 full-text search). Semantic search supports OpenAI or local embedding models.
Enables export of knowledge graph data to Markdown format for documentation and reporting purposes.
Provides export capability to Mermaid format for visualizing knowledge graph relationships and hierarchies as diagrams.
Supports semantic search capabilities using OpenAI embedding models for similarity-based entity matching and intelligent knowledge graph queries.
Offers SQLite backend storage with better-sqlite3 for 3-10x faster performance and FTS5 full-text search capabilities compared to JSONL storage.
Provides TypeScript-based API interfaces and type definitions for entity, relation, and observation management within the knowledge graph system.
Utilizes Zod schemas for input validation and type safety across all API operations and data structures.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Enhanced Knowledge Graph Memory Serverfind all project notes tagged 'research' from last month"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Memory MCP Server
An enhanced fork of the official Model Context Protocol memory server with advanced features for hierarchical nesting, intelligent compression, semantic search, graph algorithms, archiving, advanced search, and multi-format import/export.
Enterprise-grade knowledge graph with 213 tools including hierarchical organization, semantic search with embeddings, graph traversal algorithms, duplicate detection, smart archiving, project scoping, temporal knowledge graph, semantic forget, agent diary, entity bitemporal validity (η.4.4), optimistic concurrency control (η.5.5.c), role-based access control (η.6.1), W3C Linked Data exports (Turtle / JSON-LD / RDF/XML — η.5.4), PII redaction on export (η.6.3), procedural memory (3B.4), active retrieval (3B.5), causal reasoning (3B.6), world model (3B.7),
do_not_rememberexclusions, decision rationale (ADR memory + markdown dual-write), structured project context (facts / conventions / commands / glossary), heuristic guidelines, tool affordance + ToolCallObserver pipeline (with MCP shim), observation dedup, and spell correction (memoryjs v2.1.0 — Phase 16) for long-term memory management.
Table of Contents
Features
Core Memory Capabilities
Knowledge Graph Storage: Entity-Relation-Observation model for structured memory
Persistent Memory: Information persists across chat sessions with JSONL or SQLite storage
Dual Storage Backends: JSONL (human-readable) or SQLite with better-sqlite3 (3-10x faster, FTS5 search)
Full CRUD Operations: Create, read, update, delete entities and relations
Flexible Search: Text-based, fuzzy, boolean, semantic, and TF-IDF ranked search
Advanced Features
Category | Tools | Description |
Hierarchical Nesting | 9 | Parent-child relationships for organizing tree structures |
Graph Algorithms | 4 | Path finding, connected components, centrality metrics |
Intelligent Search | 3 | Hybrid multi-layer search with query analysis and reflection |
Semantic Search | 3 | Embedding-based similarity search with OpenAI or local models |
Memory Compression | 4 | Intelligent duplicate detection and merging with similarity scoring |
Advanced Search | 7 | TF-IDF ranking, boolean queries, fuzzy matching, auto-select |
Observation Normalization | 1 | Coreference resolution and temporal anchoring |
Tag Management | 6 | Tags, bulk operations, importance scores |
Tag Aliases | 5 | Tag synonym/alias management |
Saved Searches | 5 | Store and execute frequent queries |
Import/Export | 2 | 7 export formats (incl. W3C Linked Data: Turtle / JSON-LD / RDF/XML) with brotli + PII redaction; 3 import formats |
Graph Analytics | 2 | Statistics, validation, integrity checks |
Ref Index | 4 | Cross-session symbolic reference registration and resolution |
Artifacts | 3 | Named versioned content blobs attached to entities |
Temporal Search | 1 | Time-window filtered search across the knowledge graph |
Distillation | 1 | Configure automated observation distillation pipelines |
Freshness | 5 | Staleness tracking, expiry detection, and freshness reporting |
LLM Query | 1 | Natural-language question answering over the graph |
Governance | 4 | Transactional audit trail, history, and rollback |
Role Profiles | 2 | Per-agent role assignment and profile listing |
Entropy | 2 | Entropy-based noise filtering and information density scoring |
Consolidation | 3 | Background memory consolidation scheduling and control |
Formatter | 1 | Salience-budget-aware context formatting |
Collaborative | 1 | Multi-agent context synthesis |
Failure Handling | 2 | Session failure distillation and graceful session end |
Cognitive Load | 2 | Working-memory load analysis and adaptive reduction |
Dream Engine | 3 | Background memory maintenance: 8-phase sleep-cycle consolidation |
Project Scoping | 1 | List and filter entities by project |
Memory Versioning | 2 | Entity version chains and per-entity version history |
Semantic Forget | 1 | Two-tier deletion: exact match → semantic similarity fallback |
Profiles | 2 | User/agent profile get and update |
Temporal KG | 3 | Temporal relation invalidation, time-travel queries, relation timeline |
Ingestion | 1 | Format-agnostic conversation/document ingestion pipeline |
Agent Diary | 2 | Per-agent persistent journal write and read |
Session & Working Memory | 9 | Session lifecycle, working memory CRUD, TTL, promotion, context wake-up (Phase 14) |
Auto-Enhancement | 3 | Auto-link entity mentions, fact extraction, contradiction detection (Phase 14) |
Context Compression | 1 | N-gram text abbreviation with legend for token savings (Phase 14) |
Consolidation Pipeline | 3 | Session consolidation, pattern detection, entity summarization (Phase 14) |
Decay & Salience | 5 | Time-based decay, importance scoring, weak memory cleanup, reinforcement (Phase 14) |
Multi-Agent | 5 | Agent registration, cross-agent search, visibility, conflict resolution (Phase 14) |
Observability | 4 | D3.js graph visualization, transcript splitting, query cost estimation (Phase 14) |
Dedup | 1 | Priority-based smart deduplication (Phase 14) |
Entity Bitemporal | 5 | Time-travel queries: invalidate entities/observations, entity_as_of, timelines (Phase 15 / η.4.4) |
Optimistic Concurrency | 1 |
|
RBAC | 4 | Role-based access control: assign/revoke/check/list reader/writer/admin/owner permissions (Phase 15 / η.6.1) |
Procedural Memory | 5 | Executable how-to sequences with EWMA-refined success rate (Phase 15 / 3B.4) |
Active Retrieval | 1 | Iterative query rewriting until coverage threshold met (Phase 15 / 3B.5) |
Causal Reasoning | 4 | Chain discovery, counterfactual queries, cycle detection (Phase 15 / 3B.6) |
World Model | 3 | Graph snapshots, fact validation, outcome prediction (Phase 15 / 3B.7) |
Comparison with Official Memory Server
Feature | Official | Enhanced (This Fork) |
Entity/Relation/Observation Management | ✅ | ✅ |
Basic Search | ✅ | ✅ |
Hierarchical Nesting | ❌ | ✅ Parent-child trees |
Graph Algorithms | ❌ | ✅ Path finding, centrality |
Semantic Search | ❌ | ✅ Embedding-based similarity |
Memory Compression | ❌ | ✅ Duplicate detection |
Brotli Compression | ❌ | ✅ Backups, exports, responses |
Smart Archiving | ❌ | ✅ Criteria-based |
Advanced Search | ❌ | ✅ TF-IDF + Boolean + Fuzzy |
SQLite Backend | ❌ | ✅ better-sqlite3 (3-10x faster) |
Full-Text Search | ❌ | ✅ FTS5 with BM25 ranking |
Timestamps | ❌ | ✅ createdAt + lastModified |
Import/Export Formats | ❌ | ✅ 7 export / 3 import |
Input Validation | ❌ | ✅ Zod schemas |
Backup & Restore | ❌ | ✅ Compressed snapshots |
Intelligent Search | ❌ | ✅ Hybrid + Query Analysis + Reflection |
Observation Normalization | ❌ | ✅ Coreference resolution + temporal anchoring |
Total Tools | 11 | 160 |
Code Structure | Monolithic | Modular (5 src files in this repo; core graph in |
Quick Start
1. Install from NPM
npm install -g @danielsimonjr/memory-mcpOr use with npx (no installation required):
npx @danielsimonjr/memory-mcp2. Configure Claude Desktop
Add to claude_desktop_config.json:
Using NPM Global Install:
{
"mcpServers": {
"memory": {
"command": "mcp-server-memory"
}
}
}Using NPX:
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["-y", "@danielsimonjr/memory-mcp"]
}
}
}3. Restart Claude Desktop
Restart Claude Desktop to load the enhanced memory server.
4. Start Using
Tell Claude:
Please remember that I prefer TypeScript over JavaScript.
Tag this as "preferences" with importance 8.
Create a parent entity called "Development Preferences" and nest this under it.Installation
Local Build
# Clone repository
git clone https://github.com/danielsimonjr/memory-mcp.git
cd memory-mcp
# Install and build
npm install
npm run build
# Run tests (665 tests, >80% statement coverage)
npm test
# Type check
npm run typecheckClaude Desktop Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["<PATH_TO>/memory-mcp/dist/index.js"],
"env": {
"MEMORY_FILE_PATH": "<PATH_TO>/memory.jsonl"
}
}
}
}VS Code
Add to .vscode/mcp.json:
{
"servers": {
"memory": {
"command": "node",
"args": ["/path/to/memory-mcp/dist/index.js"]
}
}
}Core Concepts
Entities
Primary nodes in the knowledge graph.
interface Entity {
name: string; // Unique identifier
entityType: string; // Classification
observations: string[]; // Facts about the entity
parentId?: string; // Parent entity name for hierarchical nesting
tags?: string[]; // Lowercase tags for categorization
importance?: number; // 0-10 scale for prioritization
createdAt?: string; // ISO 8601 timestamp
lastModified?: string; // ISO 8601 timestamp
}Relations
Directed connections between entities.
interface Relation {
from: string; // Source entity name
to: string; // Target entity name
relationType: string; // Relationship type (active voice)
createdAt?: string; // ISO 8601 timestamp
lastModified?: string; // ISO 8601 timestamp
}Observations
Discrete facts about entities. Each observation should be atomic and independently manageable.
API Reference
Complete Tool List (160 Tools)
Tool count: 160 tools across 51 categories. The 23 newest tools (Phase 15 / memoryjs v1.14+) are documented at the end under Phase 15 sections. For full per-tool schemas see docs/architecture/API.md.
Entity Operations (4 tools)
Tool | Description |
| Create multiple new entities |
| Remove entities and their relations |
| Read entire knowledge graph |
| Retrieve specific nodes by name |
Relation Operations (2 tools)
Tool | Description |
| Create relations between entities |
| Remove specific relations |
Observation Management (3 tools)
Tool | Description |
| Add observations to entities |
| Remove specific observations |
| Normalize observations (resolve pronouns, anchor dates) |
Search (7 tools)
Tool | Description |
| Search with filters (tags, importance) |
| Filter by date range |
| TF-IDF relevance ranking |
| Boolean queries (AND/OR/NOT) |
| Typo-tolerant search |
| "Did you mean?" suggestions |
| Auto-select best search method |
Intelligent Search (3 tools)
Tool | Description |
| Multi-layer search combining semantic, lexical, and symbolic signals |
| Extract entities, temporal references, and classify query complexity |
| Reflection-based iterative search until results meet adequacy threshold |
Semantic Search (3 tools)
Tool | Description |
| Search by semantic similarity using embeddings |
| Find entities similar to a reference entity |
| Build or rebuild the semantic search index |
Saved Searches (5 tools)
Tool | Description |
| Save search query for reuse |
| Execute a saved search |
| List all saved searches |
| Delete a saved search |
| Update saved search parameters |
Tag Management (6 tools)
Tool | Description |
| Add tags to an entity |
| Remove tags from an entity |
| Set entity importance (0-10) |
| Bulk tag operation |
| Replace tag globally |
| Merge two tags into one |
Tag Aliases (5 tools)
Tool | Description |
| Create tag synonym |
| List all aliases |
| Remove an alias |
| Get aliases for canonical tag |
| Resolve alias to canonical form |
Hierarchical Nesting (9 tools)
Tool | Description |
| Set/remove parent relationship |
| Get immediate children |
| Get parent entity |
| Get all ancestors (parent chain) |
| Get all descendants (recursive) |
| Get entity + descendants with relations |
| Get entities with no parent |
| Get depth in hierarchy |
| Move entity to new parent |
Graph Algorithms (4 tools)
Tool | Description |
| Shortest path between entities (BFS) |
| All paths with max depth limit |
| Detect isolated subgraphs |
| Calculate centrality metrics (degree, betweenness, PageRank) |
Graph Analytics (2 tools)
Tool | Description |
| Comprehensive graph statistics |
| Validate graph integrity |
Compression & Archiving (4 tools)
Tool | Description |
| Find similar entities by threshold |
| Merge multiple entities into one |
| Auto compression with dry-run |
| Archive by age, importance, or tags |
Import & Export (2 tools)
Tool | Description |
| Export in 7 formats (JSON, CSV, GraphML, GEXF, DOT, Markdown, Mermaid) with compression |
| Import from JSON/CSV/GraphML with merge strategies |
Ref Index (4 tools)
Tool | Description |
| Register a symbolic reference pointing to an entity |
| Resolve a symbolic reference to its target entity |
| Remove a registered symbolic reference |
| List all registered symbolic references |
Artifacts (3 tools)
Tool | Description |
| Create a named versioned content blob attached to an entity |
| Retrieve an artifact by name and optional version |
| List all artifacts, optionally filtered by entity |
Temporal Search (1 tool)
Tool | Description |
| Search entities and observations within a time window |
Distillation (1 tool)
Tool | Description |
| Configure automated observation distillation pipelines |
Freshness (5 tools)
Tool | Description |
| Check freshness status of a specific entity |
| List entities that have exceeded their staleness threshold |
| List entities past their explicit expiry date |
| Reset the freshness timestamp on an entity |
| Generate a full freshness report across the graph |
LLM Query (1 tool)
Tool | Description |
| Answer natural-language questions over the knowledge graph |
Governance (4 tools)
Tool | Description |
| Execute a governed, audited graph transaction |
| Query the audit log with filters |
| Retrieve full audit history for an entity |
| Roll back a previously recorded operation |
Role Profiles (2 tools)
Tool | Description |
| Assign a role profile to the current agent context |
| List all available agent role profiles |
Entropy (2 tools)
Tool | Description |
| Enable entropy-based noise filtering for search results |
| Compute information-density entropy score for an entity |
Consolidation (3 tools)
Tool | Description |
| Start the background memory consolidation service |
| Stop the background memory consolidation service |
| Trigger an immediate consolidation pass |
Formatter (1 tool)
Tool | Description |
| Format context output respecting a token salience budget |
Collaborative (1 tool)
Tool | Description |
| Synthesize a unified context view from multiple agent memory spaces |
Failure Handling (2 tools)
Tool | Description |
| Distill and store key observations from a failed session |
| Gracefully end a session and persist in-flight state |
Cognitive Load (2 tools)
Tool | Description |
| Analyze working-memory load in the current context |
| Adaptively reduce memory set to fit cognitive load target |
Project Scoping (1 tool)
Tool | Description |
| List all project IDs present in the graph and filter entities by project |
Memory Versioning (2 tools)
Tool | Description |
| Retrieve all versions of a versioned entity by name |
| Get the full version chain from root to latest for an entity |
Semantic Forget (1 tool)
Tool | Description |
| Delete an entity by exact name, falling back to semantic similarity if no exact match found |
Profiles (2 tools)
Tool | Description |
| Retrieve a user or agent profile entity |
| Update observations and metadata on a profile entity |
Temporal KG (3 tools)
Tool | Description |
| Mark a relation as ended by setting its temporal validity end date |
| Retrieve all relations for an entity that were valid at a given point in time |
| Return a chronological list of relation events for an entity |
Ingestion (1 tool)
Tool | Description |
| Ingest a conversation, document, or free-form text into the knowledge graph |
Agent Diary (2 tools)
Tool | Description |
| Append an entry to the agent's persistent diary |
| Read diary entries for an agent, optionally filtered by date range |
Entity Bitemporal Validity (5 tools) — Phase 15 / memoryjs η.4.4
Tool | Description |
| Stamp |
| Time-travel query: returns entity state at a given ISO 8601 timestamp, or |
| All temporal versions of an entity in chronological order; integrates the v1.8 supersession chain |
| Per-observation invalidation via parallel |
| Filter observations valid at a given timestamp; observations without meta are treated as unbounded |
Optimistic Concurrency Control (1 tool) — Phase 15 / memoryjs η.5.5.c
Tool | Description |
| Update an entity with optional |
RBAC (4 tools) — Phase 15 / memoryjs η.6.1
Tool | Description |
| Grant |
| Remove a specific role assignment matched by |
| Check whether an agent can perform |
| List all role assignments for an agent; optional |
Procedural Memory (5 tools) — Phase 15 / memoryjs 3B.4
Tool | Description |
| Persist an executable how-to sequence: 1-indexed steps with optional fallback chains and free-form trigger phrases |
| Load a procedure by id |
| Token-overlap match a context description against stored procedures; returns ranked Jaccard-like scores |
| Apply caller feedback after execution; updates |
| Load step by 1-indexed |
Active Retrieval (1 tool) — Phase 15 / memoryjs 3B.5
Tool | Description |
| Iterative query-rewriting retrieval (search → score coverage → rewrite); stops early when |
Causal Reasoning (4 tools) — Phase 15 / memoryjs 3B.6
Tool | Description |
| Causal chains ending at the named effect; sorted by product-of-edge causalStrength |
| Symmetric counterpart starting at the named cause |
| "If we remove edge (removeFrom → removeTo), is |
| Detect cycles in the causal subgraph rooted at |
World Model (3 tools) — Phase 15 / memoryjs 3B.7
Tool | Description |
| Capture a fresh snapshot of the live graph (capped at 1000 entities; over-cap prefers high-importance) |
| Validate a candidate observation against a target entity via |
| Predict downstream effects of an action by walking the causal subgraph (delegates to |
Phase 15 enhancements to existing tools
export_graph— Now acceptsformat: 'turtle' | 'rdf-xml' | 'json-ld'for W3C Linked Data exports (memoryjs η.5.4) andredactPii: trueto scrub PII (email / SSN / credit-card / phone / IPv4) from observations using the η.6.3PiiRedactor.create_entities— Now accepts v1.6 freshness fields (ttl,confidence), v1.8 project scope (projectId), and η.4.4 bitemporal fields (validFrom,validUntil,observationMeta) per entity.set_memory_visibility— Auto-promotes plain entities toAgentEntity(stampsagentId/memoryType/confidence) instead of silently returningnull. Supports η.5.5.b extensions (allowedRoles,visibleFrom,visibleUntil).
Configuration
Environment Variables
Variable | Description | Default |
| Path to storage file |
|
| Storage backend: |
|
| Embedding provider: |
|
| OpenAI API key (required if provider is | - |
| Embedding model to use |
|
| Auto-index entities on creation |
|
Storage Backends
Feature | JSONL (Default) | SQLite (better-sqlite3) |
Format | Human-readable text | Native binary database |
Transactions | Basic | Full ACID with WAL mode |
Full-Text Search | Basic | FTS5 with BM25 ranking |
Performance | Good | 3-10x faster |
Concurrency | Single-threaded | Thread-safe with async-mutex |
Best For | Small graphs, debugging | Large graphs (10k+ entities) |
Using SQLite:
{
"mcpServers": {
"memory": {
"command": "node",
"args": ["/path/to/memory-mcp/dist/index.js"],
"env": {
"MEMORY_STORAGE_TYPE": "sqlite",
"MEMORY_FILE_PATH": "/path/to/data/memory.db"
}
}
}
}Storage Files
When you set MEMORY_FILE_PATH, the server automatically creates related files:
/your/data/directory/
├── memory.jsonl # Main knowledge graph
├── memory-saved-searches.jsonl # Saved search queries
├── memory-tag-aliases.jsonl # Tag synonym mappings
└── .backups/ # Timestamped backups
├── backup_2026-01-08_10-30-00-123.jsonl
└── backup_2026-01-08_10-30-00-123.jsonl.meta.jsonMigration Tool
Convert between JSONL and SQLite formats:
cd tools/migrate-from-jsonl-to-sqlite
npm install && npm run build
# JSONL to SQLite
node dist/migrate-from-jsonl-to-sqlite.js --from memory.jsonl --to memory.db
# SQLite to JSONL
node dist/migrate-from-jsonl-to-sqlite.js --from memory.db --to memory.jsonlDevelopment
Prerequisites
Node.js 18+
npm 9+
TypeScript 5.6+
Build Commands
npm install # Install dependencies
npm run build # Build TypeScript
npm test # Run tests (665 tests across 26 files; >80% coverage)
npm run typecheck # Strict type checking
npm run watch # Development watch mode
npm run clean # Remove dist/ directory
npm run docs:deps # Generate dependency graphArchitecture
After the Phase 13 extraction, this repo is a thin MCP wrapper. All graph logic, managers, and storage live in @danielsimonjr/memoryjs (currently ^1.15.0).
memory-mcp (this repo) @danielsimonjr/memoryjs (npm dep)
┌──────────────────────────┐ ┌──────────────────────────────────┐
│ src/index.ts │ │ ManagerContext (lazy init) │
│ src/server/MCPServer.ts │───────▶│ EntityManager, RelationManager │
│ src/server/toolDefs.ts │imports │ SearchManager, IOManager, etc. │
│ src/server/toolHandlers │ │ GraphStorage / SQLiteStorage │
│ src/server/responseComp.│ │ StorageFactory + 100+ modules │
└──────────────────────────┘ └──────────────────────────────────┘
5 source files 77+ source files (extracted)
MCP protocol + dispatch All graph + search + storageLayer | Lives in | Files |
MCP protocol (stdio transport, tool registration, dispatch) |
| 5 |
Tool schemas (160 tools across 51 categories) |
| 1 |
Handler registry + Zod validation + response compression |
| 2 |
Managers (Entity / Relation / Search / IO / Tag / Hierarchy / Analytics / Compression / Archive / GraphTraversal / SemanticSearch / RankedSearch / etc.) |
| 100+ |
Storage (JSONL + SQLite with FTS5 + StorageFactory + TransactionManager) |
| — |
Embedding providers (OpenAI / local / none) + VectorStore |
| — |
Project Structure
memory-mcp/
├── src/ # Source (5 TypeScript files)
│ ├── index.ts # Entry point: ManagerContext + start MCPServer; re-exports memoryjs types
│ └── server/
│ ├── MCPServer.ts # MCP Server setup, stdio transport, request handlers
│ ├── toolDefinitions.ts # 160 tool schemas (name, description, inputSchema)
│ ├── toolHandlers.ts # Handler registry: validate args → call manager → format response
│ └── responseCompressor.ts # Brotli + base64 wrapper for >256KB payloads
├── tests/ # Test suite (26 files, 665 tests, >80% statement coverage)
│ ├── unit/ # Unit tests (response compressor, tool defs, validate-fact handler)
│ ├── integration/ # MCP server lifecycle
│ ├── e2e/tools/ # Per-category tool tests + handler-smoke broad coverage
│ ├── knowledge-graph.test.ts # Core graph operations (smoke against memoryjs)
│ └── file-path.test.ts # Storage path resolution
├── dist/ # Compiled output (rebuilt on `npm install` via `prepare`)
├── docs/ # Documentation
│ ├── architecture/ # API.md, ARCHITECTURE.md, COMPONENTS.md, OVERVIEW.md, TEST_COVERAGE.md
│ ├── guides/ # HIERARCHY.md, COMPRESSION.md, ARCHIVING.md, QUERY_LANGUAGE.md
│ ├── development/ # WORKFLOW.md
│ ├── roadmap/ # FUTURE_FEATURES.md, PERFORMANCE_AND_CAPABILITIES.md
│ └── reports/ # Historical sprint reports
├── tools/ # Standalone utilities (each builds independently)
│ ├── chunking-for-files/ # File splitting
│ ├── compress-for-context/ # CTON compression
│ ├── create-dependency-graph/ # Dependency analyzer
│ └── migrate-from-jsonl-to-sqlite/ # Storage backend converter
├── CHANGELOG.md # Version history
└── README.md # This fileDependencies
Production (3 direct deps — everything else is transitive via memoryjs):
@danielsimonjr/memoryjs: ^1.15.0 — knowledge graph engine (storage, managers, search, embeddings, RBAC, OCC, bitemporal, causal, etc.)@modelcontextprotocol/sdk: ^1.21.1 — MCP protocol implementationzod: ^3.24.1 — runtime input validation (schemas re-exported from memoryjs)
Development:
typescript: ^5.6.2vitest: ^4.0.13@vitest/coverage-v8: ^4.0.13shx: ^0.4.0 — cross-platform shell commands forcleanscript@types/node: ^22
Note:
better-sqlite3,async-mutex,@danielsimonjr/workerpool, and the embedding providers (OpenAI /@xenova/transformers) are transitive deps via@danielsimonjr/memoryjssince the Phase 13 extraction. They are not listed in this repo'spackage.json.
Documentation
Comprehensive documentation in docs/:
Architecture
API.md - Complete API documentation for all 160 tools
ARCHITECTURE.md - Technical architecture and system design
COMPONENTS.md - Component breakdown and responsibilities
OVERVIEW.md - High-level project overview
DEPENDENCY_GRAPH.md - Module dependencies
User Guides
HIERARCHY.md - Parent-child relationships (9 tools)
COMPRESSION.md - Duplicate detection and merging
ARCHIVING.md - Memory lifecycle and archiving
QUERY_LANGUAGE.md - Boolean search syntax
Development
WORKFLOW.md - Development procedures
MIGRATION.md - Version upgrade guide
Contributing
We welcome contributions!
See:
CONTRIBUTING.md - Contribution guidelines
CODE_OF_CONDUCT.md - Community standards
Ways to Help:
Report bugs
Request features
Submit pull requests
Improve documentation
Add tests
Changelog
All notable changes are documented in CHANGELOG.md.
Current version: v12.3.0 - View full changelog
Recent highlights:
v12.3.0 (213 tools): Phase 16 — 53 new tools surfacing memoryjs v2.1.0 across seven new manager surfaces:
do_not_rememberexclusion rules (5), decision rationale + ADR markdown dual-write (10), structured project context (12), heuristic guidelines (10), tool affordance +ToolCallObserverproducer pipeline (11), observation dedup (2), spell correction (3). Bumped@danielsimonjr/memoryjsdep^1.15.0→^2.1.0.v12.2.3: Publishability — switched
@danielsimonjr/memoryjsdep from localfile:link to published^1.15.0(npm rejectsfile:deps for published packages).v12.2.2: Doc-only — roadmap completion audit grading Phase 6-15 status against current code.
v12.2.1: Doc-only — comprehensive consistency pass across 68 markdown documents to align with v12.2.0's 160-tool surface.
v12.2.0 (160 tools): 23 new tools — entity bitemporal validity (η.4.4), OCC update (η.5.5.c), RBAC (η.6.1), procedural memory (3B.4), active retrieval (3B.5), causal reasoning (3B.6), world model (3B.7), plus W3C Linked Data exports (η.5.4) and PII redaction (η.6.3) wired into existing
export_graph. Plus four pre-publish fixes from end-to-end MCP smoke testing (memoryjs v1.14+).v12.1.0 (106 tools): 12 new tools — Project Scoping, Memory Versioning, Semantic Forget, Profiles, Temporal KG, Ingestion, Agent Diary (memoryjs v1.8.0/v1.9.0)
v12.0.0 (94 tools): 32 new tools — Ref Index, Artifacts, Temporal Search, Distillation, Freshness, LLM Query, Governance, Role Profiles, Entropy, Consolidation, Formatter, Collaborative, Failure Handling, Cognitive Load
v11.1.1: npm tarball cleanup, excluded data files from published package
v11.1.0: MCP error framing, dynamic server version, handler smoke tests, response compressor tests
License
MIT License - see LICENSE
Acknowledgments
Original Project
Enhanced fork of Model Context Protocol memory server by Anthropic.
Developer
Major Enhancements
Hierarchical nesting with parent-child relationships
Graph algorithms: path finding, centrality, connected components
Semantic search with embedding-based similarity
Brotli compression for backups, exports, and responses
Memory compression with intelligent duplicate detection
Smart archiving with criteria-based filtering
Advanced search: TF-IDF, boolean, and fuzzy matching
Multi-format import/export with merge strategies
SQLite backend with better-sqlite3 (3-10x faster)
Transaction support with ACID guarantees
Comprehensive test suite (665 tests, 26 test files in this wrapper repo; full-coverage core graph tests live in
@danielsimonjr/memoryjs)
Repository: https://github.com/danielsimonjr/memory-mcp NPM: https://www.npmjs.com/package/@danielsimonjr/memory-mcp Issues: https://github.com/danielsimonjr/memory-mcp/issues
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielsimonjr/memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server