@danielsimonjr/memory-mcp 11.1.1 → 12.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +302 -107
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/server/toolDefinitions.d.ts +1 -1
- package/dist/server/toolDefinitions.d.ts.map +1 -1
- package/dist/server/toolDefinitions.js +2323 -6
- package/dist/server/toolHandlers.d.ts +2 -10
- package/dist/server/toolHandlers.d.ts.map +1 -1
- package/dist/server/toolHandlers.js +2097 -7
- package/package.json +9 -6
- package/dist/core/EntityManager.d.ts +0 -263
- package/dist/core/EntityManager.d.ts.map +0 -1
- package/dist/core/EntityManager.js +0 -478
- package/dist/core/GraphStorage.d.ts +0 -344
- package/dist/core/GraphStorage.d.ts.map +0 -1
- package/dist/core/GraphStorage.js +0 -708
- package/dist/core/GraphTraversal.d.ts +0 -136
- package/dist/core/GraphTraversal.d.ts.map +0 -1
- package/dist/core/GraphTraversal.js +0 -556
- package/dist/core/HierarchyManager.d.ts +0 -111
- package/dist/core/HierarchyManager.d.ts.map +0 -1
- package/dist/core/HierarchyManager.js +0 -224
- package/dist/core/ManagerContext.d.ts +0 -72
- package/dist/core/ManagerContext.d.ts.map +0 -1
- package/dist/core/ManagerContext.js +0 -118
- package/dist/core/ObservationManager.d.ts +0 -85
- package/dist/core/ObservationManager.d.ts.map +0 -1
- package/dist/core/ObservationManager.js +0 -123
- package/dist/core/RelationManager.d.ts +0 -131
- package/dist/core/RelationManager.d.ts.map +0 -1
- package/dist/core/RelationManager.js +0 -210
- package/dist/core/SQLiteStorage.d.ts +0 -354
- package/dist/core/SQLiteStorage.d.ts.map +0 -1
- package/dist/core/SQLiteStorage.js +0 -917
- package/dist/core/StorageFactory.d.ts +0 -45
- package/dist/core/StorageFactory.d.ts.map +0 -1
- package/dist/core/StorageFactory.js +0 -64
- package/dist/core/TransactionManager.d.ts +0 -259
- package/dist/core/TransactionManager.d.ts.map +0 -1
- package/dist/core/TransactionManager.js +0 -392
- package/dist/core/index.d.ts +0 -16
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js +0 -17
- package/dist/features/AnalyticsManager.d.ts +0 -44
- package/dist/features/AnalyticsManager.d.ts.map +0 -1
- package/dist/features/AnalyticsManager.js +0 -223
- package/dist/features/ArchiveManager.d.ts +0 -121
- package/dist/features/ArchiveManager.d.ts.map +0 -1
- package/dist/features/ArchiveManager.js +0 -240
- package/dist/features/CompressionManager.d.ts +0 -109
- package/dist/features/CompressionManager.d.ts.map +0 -1
- package/dist/features/CompressionManager.js +0 -404
- package/dist/features/IOManager.d.ts +0 -221
- package/dist/features/IOManager.d.ts.map +0 -1
- package/dist/features/IOManager.js +0 -997
- package/dist/features/StreamingExporter.d.ts +0 -105
- package/dist/features/StreamingExporter.d.ts.map +0 -1
- package/dist/features/StreamingExporter.js +0 -150
- package/dist/features/TagManager.d.ts +0 -147
- package/dist/features/TagManager.d.ts.map +0 -1
- package/dist/features/TagManager.js +0 -210
- package/dist/features/index.d.ts +0 -12
- package/dist/features/index.d.ts.map +0 -1
- package/dist/features/index.js +0 -11
- package/dist/search/BasicSearch.d.ts +0 -51
- package/dist/search/BasicSearch.d.ts.map +0 -1
- package/dist/search/BasicSearch.js +0 -137
- package/dist/search/BooleanSearch.d.ts +0 -98
- package/dist/search/BooleanSearch.d.ts.map +0 -1
- package/dist/search/BooleanSearch.js +0 -430
- package/dist/search/EmbeddingService.d.ts +0 -178
- package/dist/search/EmbeddingService.d.ts.map +0 -1
- package/dist/search/EmbeddingService.js +0 -358
- package/dist/search/FuzzySearch.d.ts +0 -118
- package/dist/search/FuzzySearch.d.ts.map +0 -1
- package/dist/search/FuzzySearch.js +0 -312
- package/dist/search/RankedSearch.d.ts +0 -71
- package/dist/search/RankedSearch.d.ts.map +0 -1
- package/dist/search/RankedSearch.js +0 -238
- package/dist/search/SavedSearchManager.d.ts +0 -79
- package/dist/search/SavedSearchManager.d.ts.map +0 -1
- package/dist/search/SavedSearchManager.js +0 -145
- package/dist/search/SearchFilterChain.d.ts +0 -120
- package/dist/search/SearchFilterChain.d.ts.map +0 -1
- package/dist/search/SearchFilterChain.js +0 -185
- package/dist/search/SearchManager.d.ts +0 -285
- package/dist/search/SearchManager.d.ts.map +0 -1
- package/dist/search/SearchManager.js +0 -338
- package/dist/search/SearchSuggestions.d.ts +0 -27
- package/dist/search/SearchSuggestions.d.ts.map +0 -1
- package/dist/search/SearchSuggestions.js +0 -57
- package/dist/search/SemanticSearch.d.ts +0 -146
- package/dist/search/SemanticSearch.d.ts.map +0 -1
- package/dist/search/SemanticSearch.js +0 -313
- package/dist/search/TFIDFIndexManager.d.ts +0 -63
- package/dist/search/TFIDFIndexManager.d.ts.map +0 -1
- package/dist/search/TFIDFIndexManager.js +0 -215
- package/dist/search/VectorStore.d.ts +0 -235
- package/dist/search/VectorStore.d.ts.map +0 -1
- package/dist/search/VectorStore.js +0 -311
- package/dist/search/index.d.ts +0 -18
- package/dist/search/index.d.ts.map +0 -1
- package/dist/search/index.js +0 -21
- package/dist/types/index.d.ts +0 -13
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -12
- package/dist/types/types.d.ts +0 -1234
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/types.js +0 -9
- package/dist/utils/compressedCache.d.ts +0 -192
- package/dist/utils/compressedCache.d.ts.map +0 -1
- package/dist/utils/compressedCache.js +0 -309
- package/dist/utils/compressionUtil.d.ts +0 -214
- package/dist/utils/compressionUtil.d.ts.map +0 -1
- package/dist/utils/compressionUtil.js +0 -247
- package/dist/utils/constants.d.ts +0 -245
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/constants.js +0 -252
- package/dist/utils/entityUtils.d.ts +0 -321
- package/dist/utils/entityUtils.d.ts.map +0 -1
- package/dist/utils/entityUtils.js +0 -538
- package/dist/utils/errors.d.ts +0 -77
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -121
- package/dist/utils/formatters.d.ts +0 -145
- package/dist/utils/formatters.d.ts.map +0 -1
- package/dist/utils/formatters.js +0 -132
- package/dist/utils/index.d.ts +0 -22
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -75
- package/dist/utils/indexes.d.ts +0 -270
- package/dist/utils/indexes.d.ts.map +0 -1
- package/dist/utils/indexes.js +0 -526
- package/dist/utils/logger.d.ts +0 -24
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -33
- package/dist/utils/parallelUtils.d.ts +0 -72
- package/dist/utils/parallelUtils.d.ts.map +0 -1
- package/dist/utils/parallelUtils.js +0 -169
- package/dist/utils/schemas.d.ts +0 -374
- package/dist/utils/schemas.d.ts.map +0 -1
- package/dist/utils/schemas.js +0 -484
- package/dist/utils/searchAlgorithms.d.ts +0 -99
- package/dist/utils/searchAlgorithms.d.ts.map +0 -1
- package/dist/utils/searchAlgorithms.js +0 -167
- package/dist/utils/searchCache.d.ts +0 -108
- package/dist/utils/searchCache.d.ts.map +0 -1
- package/dist/utils/searchCache.js +0 -209
- package/dist/utils/taskScheduler.d.ts +0 -290
- package/dist/utils/taskScheduler.d.ts.map +0 -1
- package/dist/utils/taskScheduler.js +0 -466
- package/dist/workers/WorkerPool.d.ts +0 -81
- package/dist/workers/WorkerPool.d.ts.map +0 -1
- package/dist/workers/WorkerPool.js +0 -121
- package/dist/workers/index.d.ts +0 -12
- package/dist/workers/index.d.ts.map +0 -1
- package/dist/workers/index.js +0 -9
- package/dist/workers/levenshteinWorker.d.ts +0 -60
- package/dist/workers/levenshteinWorker.d.ts.map +0 -1
- package/dist/workers/levenshteinWorker.js +0 -98
package/README.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# Memory MCP Server
|
|
2
2
|
|
|
3
|
-
[](https://github.com/danielsimonjr/memory-mcp)
|
|
4
4
|
[](https://www.npmjs.com/package/@danielsimonjr/memory-mcp)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://modelcontextprotocol.io)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
|
-
[](docs/architecture/TEST_COVERAGE.md)
|
|
9
9
|
|
|
10
10
|
An **enhanced fork** of the official [Model Context Protocol](https://modelcontextprotocol.io) memory server with advanced features for **hierarchical nesting**, **intelligent compression**, **semantic search**, **graph algorithms**, **archiving**, **advanced search**, and **multi-format import/export**.
|
|
11
11
|
|
|
12
|
-
> **Enterprise-grade knowledge graph** with
|
|
12
|
+
> **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_remember` exclusions**, **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.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -46,10 +46,48 @@ An **enhanced fork** of the official [Model Context Protocol](https://modelconte
|
|
|
46
46
|
| **Memory Compression** | 4 | Intelligent duplicate detection and merging with similarity scoring |
|
|
47
47
|
| **Advanced Search** | 7 | TF-IDF ranking, boolean queries, fuzzy matching, auto-select |
|
|
48
48
|
| **Observation Normalization** | 1 | Coreference resolution and temporal anchoring |
|
|
49
|
-
| **Tag Management** |
|
|
49
|
+
| **Tag Management** | 6 | Tags, bulk operations, importance scores |
|
|
50
|
+
| **Tag Aliases** | 5 | Tag synonym/alias management |
|
|
50
51
|
| **Saved Searches** | 5 | Store and execute frequent queries |
|
|
51
|
-
| **Import/Export** | 2 | 7 export formats with brotli
|
|
52
|
+
| **Import/Export** | 2 | 7 export formats (incl. W3C Linked Data: Turtle / JSON-LD / RDF/XML) with brotli + PII redaction; 3 import formats |
|
|
52
53
|
| **Graph Analytics** | 2 | Statistics, validation, integrity checks |
|
|
54
|
+
| **Ref Index** | 4 | Cross-session symbolic reference registration and resolution |
|
|
55
|
+
| **Artifacts** | 3 | Named versioned content blobs attached to entities |
|
|
56
|
+
| **Temporal Search** | 1 | Time-window filtered search across the knowledge graph |
|
|
57
|
+
| **Distillation** | 1 | Configure automated observation distillation pipelines |
|
|
58
|
+
| **Freshness** | 5 | Staleness tracking, expiry detection, and freshness reporting |
|
|
59
|
+
| **LLM Query** | 1 | Natural-language question answering over the graph |
|
|
60
|
+
| **Governance** | 4 | Transactional audit trail, history, and rollback |
|
|
61
|
+
| **Role Profiles** | 2 | Per-agent role assignment and profile listing |
|
|
62
|
+
| **Entropy** | 2 | Entropy-based noise filtering and information density scoring |
|
|
63
|
+
| **Consolidation** | 3 | Background memory consolidation scheduling and control |
|
|
64
|
+
| **Formatter** | 1 | Salience-budget-aware context formatting |
|
|
65
|
+
| **Collaborative** | 1 | Multi-agent context synthesis |
|
|
66
|
+
| **Failure Handling** | 2 | Session failure distillation and graceful session end |
|
|
67
|
+
| **Cognitive Load** | 2 | Working-memory load analysis and adaptive reduction |
|
|
68
|
+
| **Dream Engine** | 3 | Background memory maintenance: 8-phase sleep-cycle consolidation |
|
|
69
|
+
| **Project Scoping** | 1 | List and filter entities by project |
|
|
70
|
+
| **Memory Versioning** | 2 | Entity version chains and per-entity version history |
|
|
71
|
+
| **Semantic Forget** | 1 | Two-tier deletion: exact match → semantic similarity fallback |
|
|
72
|
+
| **Profiles** | 2 | User/agent profile get and update |
|
|
73
|
+
| **Temporal KG** | 3 | Temporal relation invalidation, time-travel queries, relation timeline |
|
|
74
|
+
| **Ingestion** | 1 | Format-agnostic conversation/document ingestion pipeline |
|
|
75
|
+
| **Agent Diary** | 2 | Per-agent persistent journal write and read |
|
|
76
|
+
| **Session & Working Memory** | 9 | Session lifecycle, working memory CRUD, TTL, promotion, context wake-up *(Phase 14)* |
|
|
77
|
+
| **Auto-Enhancement** | 3 | Auto-link entity mentions, fact extraction, contradiction detection *(Phase 14)* |
|
|
78
|
+
| **Context Compression** | 1 | N-gram text abbreviation with legend for token savings *(Phase 14)* |
|
|
79
|
+
| **Consolidation Pipeline** | 3 | Session consolidation, pattern detection, entity summarization *(Phase 14)* |
|
|
80
|
+
| **Decay & Salience** | 5 | Time-based decay, importance scoring, weak memory cleanup, reinforcement *(Phase 14)* |
|
|
81
|
+
| **Multi-Agent** | 5 | Agent registration, cross-agent search, visibility, conflict resolution *(Phase 14)* |
|
|
82
|
+
| **Observability** | 4 | D3.js graph visualization, transcript splitting, query cost estimation *(Phase 14)* |
|
|
83
|
+
| **Dedup** | 1 | Priority-based smart deduplication *(Phase 14)* |
|
|
84
|
+
| **Entity Bitemporal** | 5 | Time-travel queries: invalidate entities/observations, entity_as_of, timelines *(Phase 15 / η.4.4)* |
|
|
85
|
+
| **Optimistic Concurrency** | 1 | `update_entity` with `expectedVersion` → `VersionConflictError` on stale *(Phase 15 / η.5.5.c)* |
|
|
86
|
+
| **RBAC** | 4 | Role-based access control: assign/revoke/check/list reader/writer/admin/owner permissions *(Phase 15 / η.6.1)* |
|
|
87
|
+
| **Procedural Memory** | 5 | Executable how-to sequences with EWMA-refined success rate *(Phase 15 / 3B.4)* |
|
|
88
|
+
| **Active Retrieval** | 1 | Iterative query rewriting until coverage threshold met *(Phase 15 / 3B.5)* |
|
|
89
|
+
| **Causal Reasoning** | 4 | Chain discovery, counterfactual queries, cycle detection *(Phase 15 / 3B.6)* |
|
|
90
|
+
| **World Model** | 3 | Graph snapshots, fact validation, outcome prediction *(Phase 15 / 3B.7)* |
|
|
53
91
|
|
|
54
92
|
### Comparison with Official Memory Server
|
|
55
93
|
|
|
@@ -72,8 +110,8 @@ An **enhanced fork** of the official [Model Context Protocol](https://modelconte
|
|
|
72
110
|
| **Backup & Restore** | ❌ | ✅ Compressed snapshots |
|
|
73
111
|
| **Intelligent Search** | ❌ | ✅ Hybrid + Query Analysis + Reflection |
|
|
74
112
|
| **Observation Normalization** | ❌ | ✅ Coreference resolution + temporal anchoring |
|
|
75
|
-
| **Total Tools** | 11 | **
|
|
76
|
-
| **Code Structure** | Monolithic | **Modular** (
|
|
113
|
+
| **Total Tools** | 11 | **160** |
|
|
114
|
+
| **Code Structure** | Monolithic | **Modular** (5 src files in this repo; core graph in [`@danielsimonjr/memoryjs`](https://www.npmjs.com/package/@danielsimonjr/memoryjs)) |
|
|
77
115
|
|
|
78
116
|
## Quick Start
|
|
79
117
|
|
|
@@ -142,7 +180,7 @@ cd memory-mcp
|
|
|
142
180
|
npm install
|
|
143
181
|
npm run build
|
|
144
182
|
|
|
145
|
-
# Run tests (
|
|
183
|
+
# Run tests (665 tests, >80% statement coverage)
|
|
146
184
|
npm test
|
|
147
185
|
|
|
148
186
|
# Type check
|
|
@@ -221,7 +259,9 @@ Discrete facts about entities. Each observation should be atomic and independent
|
|
|
221
259
|
|
|
222
260
|
## API Reference
|
|
223
261
|
|
|
224
|
-
### Complete Tool List (
|
|
262
|
+
### Complete Tool List (160 Tools)
|
|
263
|
+
|
|
264
|
+
> 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](docs/architecture/API.md).
|
|
225
265
|
|
|
226
266
|
#### Entity Operations (4 tools)
|
|
227
267
|
| Tool | Description |
|
|
@@ -338,6 +378,190 @@ Discrete facts about entities. Each observation should be atomic and independent
|
|
|
338
378
|
| `export_graph` | Export in 7 formats (JSON, CSV, GraphML, GEXF, DOT, Markdown, Mermaid) with compression |
|
|
339
379
|
| `import_graph` | Import from JSON/CSV/GraphML with merge strategies |
|
|
340
380
|
|
|
381
|
+
#### Ref Index (4 tools)
|
|
382
|
+
| Tool | Description |
|
|
383
|
+
|------|-------------|
|
|
384
|
+
| `register_ref` | Register a symbolic reference pointing to an entity |
|
|
385
|
+
| `resolve_ref` | Resolve a symbolic reference to its target entity |
|
|
386
|
+
| `deregister_ref` | Remove a registered symbolic reference |
|
|
387
|
+
| `list_refs` | List all registered symbolic references |
|
|
388
|
+
|
|
389
|
+
#### Artifacts (3 tools)
|
|
390
|
+
| Tool | Description |
|
|
391
|
+
|------|-------------|
|
|
392
|
+
| `create_artifact` | Create a named versioned content blob attached to an entity |
|
|
393
|
+
| `get_artifact` | Retrieve an artifact by name and optional version |
|
|
394
|
+
| `list_artifacts` | List all artifacts, optionally filtered by entity |
|
|
395
|
+
|
|
396
|
+
#### Temporal Search (1 tool)
|
|
397
|
+
| Tool | Description |
|
|
398
|
+
|------|-------------|
|
|
399
|
+
| `search_by_time` | Search entities and observations within a time window |
|
|
400
|
+
|
|
401
|
+
#### Distillation (1 tool)
|
|
402
|
+
| Tool | Description |
|
|
403
|
+
|------|-------------|
|
|
404
|
+
| `configure_distillation` | Configure automated observation distillation pipelines |
|
|
405
|
+
|
|
406
|
+
#### Freshness (5 tools)
|
|
407
|
+
| Tool | Description |
|
|
408
|
+
|------|-------------|
|
|
409
|
+
| `check_freshness` | Check freshness status of a specific entity |
|
|
410
|
+
| `get_stale_entities` | List entities that have exceeded their staleness threshold |
|
|
411
|
+
| `get_expired_entities` | List entities past their explicit expiry date |
|
|
412
|
+
| `refresh_entity` | Reset the freshness timestamp on an entity |
|
|
413
|
+
| `freshness_report` | Generate a full freshness report across the graph |
|
|
414
|
+
|
|
415
|
+
#### LLM Query (1 tool)
|
|
416
|
+
| Tool | Description |
|
|
417
|
+
|------|-------------|
|
|
418
|
+
| `query_natural_language` | Answer natural-language questions over the knowledge graph |
|
|
419
|
+
|
|
420
|
+
#### Governance (4 tools)
|
|
421
|
+
| Tool | Description |
|
|
422
|
+
|------|-------------|
|
|
423
|
+
| `governance_transaction` | Execute a governed, audited graph transaction |
|
|
424
|
+
| `audit_query` | Query the audit log with filters |
|
|
425
|
+
| `audit_history` | Retrieve full audit history for an entity |
|
|
426
|
+
| `rollback_operation` | Roll back a previously recorded operation |
|
|
427
|
+
|
|
428
|
+
#### Role Profiles (2 tools)
|
|
429
|
+
| Tool | Description |
|
|
430
|
+
|------|-------------|
|
|
431
|
+
| `set_agent_role` | Assign a role profile to the current agent context |
|
|
432
|
+
| `list_role_profiles` | List all available agent role profiles |
|
|
433
|
+
|
|
434
|
+
#### Entropy (2 tools)
|
|
435
|
+
| Tool | Description |
|
|
436
|
+
|------|-------------|
|
|
437
|
+
| `enable_entropy_filter` | Enable entropy-based noise filtering for search results |
|
|
438
|
+
| `compute_entropy` | Compute information-density entropy score for an entity |
|
|
439
|
+
|
|
440
|
+
#### Consolidation (3 tools)
|
|
441
|
+
| Tool | Description |
|
|
442
|
+
|------|-------------|
|
|
443
|
+
| `start_consolidation` | Start the background memory consolidation service |
|
|
444
|
+
| `stop_consolidation` | Stop the background memory consolidation service |
|
|
445
|
+
| `run_consolidation_now` | Trigger an immediate consolidation pass |
|
|
446
|
+
|
|
447
|
+
#### Formatter (1 tool)
|
|
448
|
+
| Tool | Description |
|
|
449
|
+
|------|-------------|
|
|
450
|
+
| `format_with_salience_budget` | Format context output respecting a token salience budget |
|
|
451
|
+
|
|
452
|
+
#### Collaborative (1 tool)
|
|
453
|
+
| Tool | Description |
|
|
454
|
+
|------|-------------|
|
|
455
|
+
| `synthesize_collaborative_context` | Synthesize a unified context view from multiple agent memory spaces |
|
|
456
|
+
|
|
457
|
+
#### Failure Handling (2 tools)
|
|
458
|
+
| Tool | Description |
|
|
459
|
+
|------|-------------|
|
|
460
|
+
| `distill_failure` | Distill and store key observations from a failed session |
|
|
461
|
+
| `end_session` | Gracefully end a session and persist in-flight state |
|
|
462
|
+
|
|
463
|
+
#### Cognitive Load (2 tools)
|
|
464
|
+
| Tool | Description |
|
|
465
|
+
|------|-------------|
|
|
466
|
+
| `analyze_cognitive_load` | Analyze working-memory load in the current context |
|
|
467
|
+
| `adaptive_reduce_memories` | Adaptively reduce memory set to fit cognitive load target |
|
|
468
|
+
|
|
469
|
+
#### Project Scoping (1 tool)
|
|
470
|
+
| Tool | Description |
|
|
471
|
+
|------|-------------|
|
|
472
|
+
| `list_projects` | List all project IDs present in the graph and filter entities by project |
|
|
473
|
+
|
|
474
|
+
#### Memory Versioning (2 tools)
|
|
475
|
+
| Tool | Description |
|
|
476
|
+
|------|-------------|
|
|
477
|
+
| `get_entity_versions` | Retrieve all versions of a versioned entity by name |
|
|
478
|
+
| `get_version_chain` | Get the full version chain from root to latest for an entity |
|
|
479
|
+
|
|
480
|
+
#### Semantic Forget (1 tool)
|
|
481
|
+
| Tool | Description |
|
|
482
|
+
|------|-------------|
|
|
483
|
+
| `forget_memory` | Delete an entity by exact name, falling back to semantic similarity if no exact match found |
|
|
484
|
+
|
|
485
|
+
#### Profiles (2 tools)
|
|
486
|
+
| Tool | Description |
|
|
487
|
+
|------|-------------|
|
|
488
|
+
| `get_profile` | Retrieve a user or agent profile entity |
|
|
489
|
+
| `update_profile` | Update observations and metadata on a profile entity |
|
|
490
|
+
|
|
491
|
+
#### Temporal KG (3 tools)
|
|
492
|
+
| Tool | Description |
|
|
493
|
+
|------|-------------|
|
|
494
|
+
| `invalidate_relation` | Mark a relation as ended by setting its temporal validity end date |
|
|
495
|
+
| `query_as_of` | Retrieve all relations for an entity that were valid at a given point in time |
|
|
496
|
+
| `timeline` | Return a chronological list of relation events for an entity |
|
|
497
|
+
|
|
498
|
+
#### Ingestion (1 tool)
|
|
499
|
+
| Tool | Description |
|
|
500
|
+
|------|-------------|
|
|
501
|
+
| `ingest` | Ingest a conversation, document, or free-form text into the knowledge graph |
|
|
502
|
+
|
|
503
|
+
#### Agent Diary (2 tools)
|
|
504
|
+
| Tool | Description |
|
|
505
|
+
|------|-------------|
|
|
506
|
+
| `diary_write` | Append an entry to the agent's persistent diary |
|
|
507
|
+
| `diary_read` | Read diary entries for an agent, optionally filtered by date range |
|
|
508
|
+
|
|
509
|
+
#### Entity Bitemporal Validity (5 tools) — Phase 15 / memoryjs η.4.4
|
|
510
|
+
| Tool | Description |
|
|
511
|
+
|------|-------------|
|
|
512
|
+
| `invalidate_entity` | Stamp `validUntil` on an entity (idempotent; entity remains queryable for past timestamps via `entity_as_of`) |
|
|
513
|
+
| `entity_as_of` | Time-travel query: returns entity state at a given ISO 8601 timestamp, or `null` if invalidated then |
|
|
514
|
+
| `entity_timeline` | All temporal versions of an entity in chronological order; integrates the v1.8 supersession chain |
|
|
515
|
+
| `invalidate_observation` | Per-observation invalidation via parallel `observationMeta[]` entry on the entity |
|
|
516
|
+
| `observations_as_of` | Filter observations valid at a given timestamp; observations without meta are treated as unbounded |
|
|
517
|
+
|
|
518
|
+
#### Optimistic Concurrency Control (1 tool) — Phase 15 / memoryjs η.5.5.c
|
|
519
|
+
| Tool | Description |
|
|
520
|
+
|------|-------------|
|
|
521
|
+
| `update_entity` | Update an entity with optional `expectedVersion`; throws `VersionConflictError` on stale version. OCC-guarded writes auto-increment `version`. Omit `expectedVersion` for legacy last-write-wins. |
|
|
522
|
+
|
|
523
|
+
#### RBAC (4 tools) — Phase 15 / memoryjs η.6.1
|
|
524
|
+
| Tool | Description |
|
|
525
|
+
|------|-------------|
|
|
526
|
+
| `rbac_assign_role` | Grant `reader` / `writer` / `admin` / `owner` (or custom) role to an agent; optional `resourceType`, `scope` prefix, `validFrom` / `validUntil` window |
|
|
527
|
+
| `rbac_revoke_role` | Remove a specific role assignment matched by `agentId + role + resourceType` |
|
|
528
|
+
| `rbac_check_permission` | Check whether an agent can perform `read` / `write` / `delete` / `manage` on a resource type; falls back to `defaultRole=reader` for unassigned agents |
|
|
529
|
+
| `rbac_list_assignments` | List all role assignments for an agent; optional `activeOnly` filter |
|
|
530
|
+
|
|
531
|
+
#### Procedural Memory (5 tools) — Phase 15 / memoryjs 3B.4
|
|
532
|
+
| Tool | Description |
|
|
533
|
+
|------|-------------|
|
|
534
|
+
| `add_procedure` | Persist an executable how-to sequence: 1-indexed steps with optional fallback chains and free-form trigger phrases |
|
|
535
|
+
| `get_procedure` | Load a procedure by id |
|
|
536
|
+
| `match_procedure` | Token-overlap match a context description against stored procedures; returns ranked Jaccard-like scores |
|
|
537
|
+
| `refine_procedure` | Apply caller feedback after execution; updates `successRate` via EWMA (α=0.2) |
|
|
538
|
+
| `get_procedure_step` | Load step by 1-indexed `order`, or get the next step relative to `currentOrder` |
|
|
539
|
+
|
|
540
|
+
#### Active Retrieval (1 tool) — Phase 15 / memoryjs 3B.5
|
|
541
|
+
| Tool | Description |
|
|
542
|
+
|------|-------------|
|
|
543
|
+
| `adaptive_retrieve` | Iterative query-rewriting retrieval (search → score coverage → rewrite); stops early when `coverage ≥ minCoverage`. Pure symbolic — no LLM provider required. |
|
|
544
|
+
|
|
545
|
+
#### Causal Reasoning (4 tools) — Phase 15 / memoryjs 3B.6
|
|
546
|
+
| Tool | Description |
|
|
547
|
+
|------|-------------|
|
|
548
|
+
| `find_causes` | Causal chains ending at the named effect; sorted by product-of-edge causalStrength |
|
|
549
|
+
| `find_effects` | Symmetric counterpart starting at the named cause |
|
|
550
|
+
| `counterfactual_query` | "If we remove edge (removeFrom → removeTo), is `predict` still reachable from `seed`?" Returns surviving chains. Pure: does not mutate the graph. |
|
|
551
|
+
| `detect_causal_cycles` | Detect cycles in the causal subgraph rooted at `seed` |
|
|
552
|
+
|
|
553
|
+
#### World Model (3 tools) — Phase 15 / memoryjs 3B.7
|
|
554
|
+
| Tool | Description |
|
|
555
|
+
|------|-------------|
|
|
556
|
+
| `get_world_state` | Capture a fresh snapshot of the live graph (capped at 1000 entities; over-cap prefers high-importance) |
|
|
557
|
+
| `validate_fact_against_world` | Validate a candidate observation against a target entity via `MemoryValidator.validateConsistency`. Returns `{result: null, reason: 'embedding_provider_unavailable'}` when the local embedding provider is selected without `@xenova/transformers` installed. |
|
|
558
|
+
| `predict_outcome` | Predict downstream effects of an action by walking the causal subgraph (delegates to `find_effects`) |
|
|
559
|
+
|
|
560
|
+
#### Phase 15 enhancements to existing tools
|
|
561
|
+
- **`export_graph`** — Now accepts `format: 'turtle' | 'rdf-xml' | 'json-ld'` for W3C Linked Data exports (memoryjs η.5.4) and `redactPii: true` to scrub PII (email / SSN / credit-card / phone / IPv4) from observations using the η.6.3 `PiiRedactor`.
|
|
562
|
+
- **`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.
|
|
563
|
+
- **`set_memory_visibility`** — Auto-promotes plain entities to `AgentEntity` (stamps `agentId` / `memoryType` / `confidence`) instead of silently returning `null`. Supports η.5.5.b extensions (`allowedRoles`, `visibleFrom`, `visibleUntil`).
|
|
564
|
+
|
|
341
565
|
## Configuration
|
|
342
566
|
|
|
343
567
|
### Environment Variables
|
|
@@ -421,7 +645,7 @@ node dist/migrate-from-jsonl-to-sqlite.js --from memory.db --to memory.jsonl
|
|
|
421
645
|
```bash
|
|
422
646
|
npm install # Install dependencies
|
|
423
647
|
npm run build # Build TypeScript
|
|
424
|
-
npm test # Run tests (
|
|
648
|
+
npm test # Run tests (665 tests across 26 files; >80% coverage)
|
|
425
649
|
npm run typecheck # Strict type checking
|
|
426
650
|
npm run watch # Development watch mode
|
|
427
651
|
npm run clean # Remove dist/ directory
|
|
@@ -430,120 +654,85 @@ npm run docs:deps # Generate dependency graph
|
|
|
430
654
|
|
|
431
655
|
### Architecture
|
|
432
656
|
|
|
657
|
+
After the **Phase 13 extraction**, this repo is a thin MCP wrapper. All graph logic, managers, and storage live in [`@danielsimonjr/memoryjs`](https://www.npmjs.com/package/@danielsimonjr/memoryjs) (currently `^1.15.0`).
|
|
658
|
+
|
|
433
659
|
```
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
│
|
|
437
|
-
│
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
│ • RelationManager (relation CRUD) │
|
|
445
|
-
│ • SearchManager (search + compression + stats) │
|
|
446
|
-
│ • IOManager (import + export + backup) │
|
|
447
|
-
│ • TagManager (tag aliases) │
|
|
448
|
-
│ • GraphTraversal (path finding, centrality) │
|
|
449
|
-
│ • SemanticSearch (embeddings, similarity) │
|
|
450
|
-
└──────────────────────┬──────────────────────────────┘
|
|
451
|
-
│
|
|
452
|
-
┌──────────────────────┴──────────────────────────────┐
|
|
453
|
-
│ Layer 3: Storage Layer │
|
|
454
|
-
│ core/GraphStorage.ts (JSONL + in-memory cache) │
|
|
455
|
-
│ core/SQLiteStorage.ts (better-sqlite3 + FTS5) │
|
|
456
|
-
│ core/StorageFactory.ts (backend selection) │
|
|
457
|
-
└─────────────────────────────────────────────────────┘
|
|
660
|
+
memory-mcp (this repo) @danielsimonjr/memoryjs (npm dep)
|
|
661
|
+
┌──────────────────────────┐ ┌──────────────────────────────────┐
|
|
662
|
+
│ src/index.ts │ │ ManagerContext (lazy init) │
|
|
663
|
+
│ src/server/MCPServer.ts │───────▶│ EntityManager, RelationManager │
|
|
664
|
+
│ src/server/toolDefs.ts │imports │ SearchManager, IOManager, etc. │
|
|
665
|
+
│ src/server/toolHandlers │ │ GraphStorage / SQLiteStorage │
|
|
666
|
+
│ src/server/responseComp.│ │ StorageFactory + 100+ modules │
|
|
667
|
+
└──────────────────────────┘ └──────────────────────────────────┘
|
|
668
|
+
5 source files 77+ source files (extracted)
|
|
669
|
+
MCP protocol + dispatch All graph + search + storage
|
|
458
670
|
```
|
|
459
671
|
|
|
672
|
+
| Layer | Lives in | Files |
|
|
673
|
+
|-------|----------|-------|
|
|
674
|
+
| MCP protocol (stdio transport, tool registration, dispatch) | `memory-mcp` | 5 |
|
|
675
|
+
| Tool schemas (160 tools across 51 categories) | `memory-mcp` (`toolDefinitions.ts`) | 1 |
|
|
676
|
+
| Handler registry + Zod validation + response compression | `memory-mcp` (`toolHandlers.ts` + `responseCompressor.ts`) | 2 |
|
|
677
|
+
| Managers (Entity / Relation / Search / IO / Tag / Hierarchy / Analytics / Compression / Archive / GraphTraversal / SemanticSearch / RankedSearch / etc.) | `memoryjs` | 100+ |
|
|
678
|
+
| Storage (JSONL + SQLite with FTS5 + StorageFactory + TransactionManager) | `memoryjs` | — |
|
|
679
|
+
| Embedding providers (OpenAI / local / none) + VectorStore | `memoryjs` | — |
|
|
680
|
+
|
|
460
681
|
### Project Structure
|
|
461
682
|
|
|
462
683
|
```
|
|
463
684
|
memory-mcp/
|
|
464
|
-
├── src/
|
|
465
|
-
│ ├── index.ts
|
|
466
|
-
│
|
|
467
|
-
│
|
|
468
|
-
│
|
|
469
|
-
│
|
|
470
|
-
│
|
|
471
|
-
|
|
472
|
-
│
|
|
473
|
-
│
|
|
474
|
-
│
|
|
475
|
-
│
|
|
476
|
-
│
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
│ ├──
|
|
480
|
-
│
|
|
481
|
-
│
|
|
482
|
-
│
|
|
483
|
-
│
|
|
484
|
-
|
|
485
|
-
│
|
|
486
|
-
│
|
|
487
|
-
│
|
|
488
|
-
│
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
│ │ ├── EmbeddingService.ts # Provider abstraction
|
|
492
|
-
│ │ ├── VectorStore.ts # Vector storage
|
|
493
|
-
│ │ └── ... # + 12 more
|
|
494
|
-
│ ├── features/ # Advanced capabilities (9 files)
|
|
495
|
-
│ │ ├── IOManager.ts # Import/export/backup
|
|
496
|
-
│ │ ├── TagManager.ts # Tag aliases
|
|
497
|
-
│ │ ├── AnalyticsManager.ts # Graph stats
|
|
498
|
-
│ │ ├── ArchiveManager.ts # Entity archival
|
|
499
|
-
│ │ ├── CompressionManager.ts # Duplicate detection
|
|
500
|
-
│ │ ├── StreamingExporter.ts # Large graph exports
|
|
501
|
-
│ │ ├── ObservationNormalizer.ts # Coreference resolution
|
|
502
|
-
│ │ ├── KeywordExtractor.ts # Keyword extraction
|
|
503
|
-
│ │ └── index.ts
|
|
504
|
-
│ ├── types/ # TypeScript definitions (2 files)
|
|
505
|
-
│ ├── utils/ # Shared utilities (18 files)
|
|
506
|
-
│ └── workers/ # Worker pool (2 files)
|
|
507
|
-
├── tests/ # Test suite (97 files, 2800+ tests)
|
|
508
|
-
│ ├── unit/ # Unit tests
|
|
509
|
-
│ ├── integration/ # Integration tests
|
|
510
|
-
│ ├── e2e/ # End-to-end tests
|
|
511
|
-
│ └── performance/ # Benchmarks
|
|
512
|
-
├── dist/ # Compiled output
|
|
513
|
-
├── docs/ # Documentation
|
|
514
|
-
│ ├── architecture/ # Architecture docs
|
|
515
|
-
│ ├── guides/ # User guides
|
|
516
|
-
│ └── reports/ # Sprint reports
|
|
517
|
-
├── tools/ # Standalone utilities
|
|
518
|
-
│ ├── chunking-for-files/ # File splitting
|
|
519
|
-
│ ├── compress-for-context/ # CTON compression
|
|
520
|
-
│ ├── create-dependency-graph/ # Dependency analyzer
|
|
521
|
-
│ └── migrate-from-jsonl-to-sqlite/
|
|
522
|
-
├── CHANGELOG.md # Version history
|
|
523
|
-
└── README.md # This file
|
|
685
|
+
├── src/ # Source (5 TypeScript files)
|
|
686
|
+
│ ├── index.ts # Entry point: ManagerContext + start MCPServer; re-exports memoryjs types
|
|
687
|
+
│ └── server/
|
|
688
|
+
│ ├── MCPServer.ts # MCP Server setup, stdio transport, request handlers
|
|
689
|
+
│ ├── toolDefinitions.ts # 160 tool schemas (name, description, inputSchema)
|
|
690
|
+
│ ├── toolHandlers.ts # Handler registry: validate args → call manager → format response
|
|
691
|
+
│ └── responseCompressor.ts # Brotli + base64 wrapper for >256KB payloads
|
|
692
|
+
├── tests/ # Test suite (26 files, 665 tests, >80% statement coverage)
|
|
693
|
+
│ ├── unit/ # Unit tests (response compressor, tool defs, validate-fact handler)
|
|
694
|
+
│ ├── integration/ # MCP server lifecycle
|
|
695
|
+
│ ├── e2e/tools/ # Per-category tool tests + handler-smoke broad coverage
|
|
696
|
+
│ ├── knowledge-graph.test.ts # Core graph operations (smoke against memoryjs)
|
|
697
|
+
│ └── file-path.test.ts # Storage path resolution
|
|
698
|
+
├── dist/ # Compiled output (rebuilt on `npm install` via `prepare`)
|
|
699
|
+
├── docs/ # Documentation
|
|
700
|
+
│ ├── architecture/ # API.md, ARCHITECTURE.md, COMPONENTS.md, OVERVIEW.md, TEST_COVERAGE.md
|
|
701
|
+
│ ├── guides/ # HIERARCHY.md, COMPRESSION.md, ARCHIVING.md, QUERY_LANGUAGE.md
|
|
702
|
+
│ ├── development/ # WORKFLOW.md
|
|
703
|
+
│ ├── roadmap/ # FUTURE_FEATURES.md, PERFORMANCE_AND_CAPABILITIES.md
|
|
704
|
+
│ └── reports/ # Historical sprint reports
|
|
705
|
+
├── tools/ # Standalone utilities (each builds independently)
|
|
706
|
+
│ ├── chunking-for-files/ # File splitting
|
|
707
|
+
│ ├── compress-for-context/ # CTON compression
|
|
708
|
+
│ ├── create-dependency-graph/ # Dependency analyzer
|
|
709
|
+
│ └── migrate-from-jsonl-to-sqlite/ # Storage backend converter
|
|
710
|
+
├── CHANGELOG.md # Version history
|
|
711
|
+
└── README.md # This file
|
|
524
712
|
```
|
|
525
713
|
|
|
526
714
|
### Dependencies
|
|
527
715
|
|
|
528
|
-
**Production
|
|
529
|
-
- `@
|
|
530
|
-
-
|
|
531
|
-
- `zod`: ^
|
|
532
|
-
- `async-mutex`: ^0.5.0
|
|
533
|
-
- `@danielsimonjr/workerpool`: ^10.0.1
|
|
716
|
+
**Production** (3 direct deps — everything else is transitive via memoryjs):
|
|
717
|
+
- `@danielsimonjr/memoryjs`: ^1.15.0 — knowledge graph engine (storage, managers, search, embeddings, RBAC, OCC, bitemporal, causal, etc.)
|
|
718
|
+
- `@modelcontextprotocol/sdk`: ^1.21.1 — MCP protocol implementation
|
|
719
|
+
- `zod`: ^3.24.1 — runtime input validation (schemas re-exported from memoryjs)
|
|
534
720
|
|
|
535
721
|
**Development:**
|
|
536
722
|
- `typescript`: ^5.6.2
|
|
537
723
|
- `vitest`: ^4.0.13
|
|
538
724
|
- `@vitest/coverage-v8`: ^4.0.13
|
|
539
|
-
-
|
|
725
|
+
- `shx`: ^0.4.0 — cross-platform shell commands for `clean` script
|
|
726
|
+
- `@types/node`: ^22
|
|
727
|
+
|
|
728
|
+
> Note: `better-sqlite3`, `async-mutex`, `@danielsimonjr/workerpool`, and the embedding providers (OpenAI / `@xenova/transformers`) are **transitive deps via `@danielsimonjr/memoryjs`** since the Phase 13 extraction. They are not listed in this repo's `package.json`.
|
|
540
729
|
|
|
541
730
|
## Documentation
|
|
542
731
|
|
|
543
732
|
Comprehensive documentation in `docs/`:
|
|
544
733
|
|
|
545
734
|
**Architecture**
|
|
546
|
-
- [API.md](docs/architecture/API.md) - Complete API documentation for all
|
|
735
|
+
- [API.md](docs/architecture/API.md) - Complete API documentation for all 160 tools
|
|
547
736
|
- [ARCHITECTURE.md](docs/architecture/ARCHITECTURE.md) - Technical architecture and system design
|
|
548
737
|
- [COMPONENTS.md](docs/architecture/COMPONENTS.md) - Component breakdown and responsibilities
|
|
549
738
|
- [OVERVIEW.md](docs/architecture/OVERVIEW.md) - High-level project overview
|
|
@@ -578,12 +767,18 @@ We welcome contributions!
|
|
|
578
767
|
|
|
579
768
|
All notable changes are documented in **[CHANGELOG.md](CHANGELOG.md)**.
|
|
580
769
|
|
|
581
|
-
**Current version**:
|
|
770
|
+
**Current version**: v12.3.0 - [View full changelog](CHANGELOG.md)
|
|
582
771
|
|
|
583
772
|
Recent highlights:
|
|
584
|
-
- **
|
|
585
|
-
- **
|
|
586
|
-
- **
|
|
773
|
+
- **v12.3.0** (213 tools): **Phase 16** — 53 new tools surfacing memoryjs v2.1.0 across seven new manager surfaces: `do_not_remember` exclusion rules (5), decision rationale + ADR markdown dual-write (10), structured project context (12), heuristic guidelines (10), tool affordance + `ToolCallObserver` producer pipeline (11), observation dedup (2), spell correction (3). Bumped `@danielsimonjr/memoryjs` dep `^1.15.0` → `^2.1.0`.
|
|
774
|
+
- **v12.2.3**: Publishability — switched `@danielsimonjr/memoryjs` dep from local `file:` link to published `^1.15.0` (npm rejects `file:` deps for published packages).
|
|
775
|
+
- **v12.2.2**: Doc-only — roadmap completion audit grading Phase 6-15 status against current code.
|
|
776
|
+
- **v12.2.1**: Doc-only — comprehensive consistency pass across 68 markdown documents to align with v12.2.0's 160-tool surface.
|
|
777
|
+
- **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+).
|
|
778
|
+
- **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)
|
|
779
|
+
- **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
|
|
780
|
+
- **v11.1.1**: npm tarball cleanup, excluded data files from published package
|
|
781
|
+
- **v11.1.0**: MCP error framing, dynamic server version, handler smoke tests, response compressor tests
|
|
587
782
|
|
|
588
783
|
## License
|
|
589
784
|
|
|
@@ -611,7 +806,7 @@ Enhanced fork of [Model Context Protocol memory server](https://github.com/model
|
|
|
611
806
|
- Multi-format import/export with merge strategies
|
|
612
807
|
- SQLite backend with better-sqlite3 (3-10x faster)
|
|
613
808
|
- Transaction support with ACID guarantees
|
|
614
|
-
- Comprehensive test suite (
|
|
809
|
+
- Comprehensive test suite (665 tests, 26 test files in this wrapper repo; full-coverage core graph tests live in `@danielsimonjr/memoryjs`)
|
|
615
810
|
|
|
616
811
|
---
|
|
617
812
|
|
package/dist/index.d.ts
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @module index
|
|
9
9
|
*/
|
|
10
|
-
import { defaultMemoryPath, ensureMemoryFilePath, ManagerContext, type Entity, type Relation, type KnowledgeGraph, type GraphStats, type ValidationReport, type ValidationIssue, type ValidationWarning, type SavedSearch, type TagAlias, type SearchResult, type BooleanQueryNode, type ImportResult, type CompressionResult } from '@danielsimonjr/memoryjs';
|
|
10
|
+
import { defaultMemoryPath, ensureMemoryFilePath, ManagerContext, type Entity, type Relation, type KnowledgeGraph, type GraphStats, type ValidationReport, type ValidationIssue, type ValidationWarning, type SavedSearch, type TagAlias, type SearchResult, type BooleanQueryNode, type ImportResult, type CompressionResult, type ArtifactEntity, type ArtifactType, type ArtifactFilter, type FreshnessReport, type AuditEntry, type AuditOperation, type RefEntry, type RefIndexStats, type AgentRole, type RoleProfile, type CognitiveLoadMetrics, type AdaptiveReductionResult, type SynthesisResult, type FailureDistillationResult, type DistilledLesson } from '@danielsimonjr/memoryjs';
|
|
11
11
|
export { defaultMemoryPath, ensureMemoryFilePath };
|
|
12
|
-
export type { Entity, Relation, KnowledgeGraph, GraphStats, ValidationReport, ValidationIssue, ValidationWarning, SavedSearch, TagAlias, SearchResult, BooleanQueryNode, ImportResult, CompressionResult, };
|
|
12
|
+
export type { Entity, Relation, KnowledgeGraph, GraphStats, ValidationReport, ValidationIssue, ValidationWarning, SavedSearch, TagAlias, SearchResult, BooleanQueryNode, ImportResult, CompressionResult, ArtifactEntity, ArtifactType, ArtifactFilter, FreshnessReport, AuditEntry, AuditOperation, RefEntry, RefIndexStats, AgentRole, RoleProfile, CognitiveLoadMetrics, AdaptiveReductionResult, SynthesisResult, FailureDistillationResult, DistilledLesson, };
|
|
13
13
|
export { ManagerContext };
|
|
14
14
|
export { ManagerContext as KnowledgeGraphManager };
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAEL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EAEd,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;GAOG;AAEH,OAAO,EAEL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EAEd,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEtB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EACrB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;AAGnD,YAAY,EACV,MAAM,EACN,QAAQ,EACR,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EAEjB,cAAc,EACd,YAAY,EACZ,cAAc,EACd,eAAe,EACf,UAAU,EACV,cAAc,EACd,QAAQ,EACR,aAAa,EACb,SAAS,EACT,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,yBAAyB,EACzB,eAAe,GAChB,CAAC;AAGF,OAAO,EAAE,cAAc,EAAE,CAAC;AAG1B,OAAO,EAAE,cAAc,IAAI,qBAAqB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,12 @@ export { ManagerContext };
|
|
|
16
16
|
// Backward compatibility alias
|
|
17
17
|
export { ManagerContext as KnowledgeGraphManager };
|
|
18
18
|
let managerContext;
|
|
19
|
+
// Exit cleanly when our stdio pipe closes (e.g., Claude Code's /reload-plugins
|
|
20
|
+
// tearing down the connection). Without this, other event-loop refs — file
|
|
21
|
+
// watchers, the embeddings pool, the consolidation timer — can keep the
|
|
22
|
+
// process alive as an orphan until manually killed.
|
|
23
|
+
process.stdin.on("end", () => process.exit(0));
|
|
24
|
+
process.stdin.on("close", () => process.exit(0));
|
|
19
25
|
async function main() {
|
|
20
26
|
// Initialize memory file path with backward compatibility
|
|
21
27
|
const memoryFilePath = await ensureMemoryFilePath();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* MCP Tool Definitions
|
|
3
3
|
*
|
|
4
4
|
* Extracted from MCPServer.ts to reduce file size and improve maintainability.
|
|
5
|
-
* Contains all
|
|
5
|
+
* Contains all 106 tool schemas for the Knowledge Graph MCP Server.
|
|
6
6
|
*
|
|
7
7
|
* @module server/toolDefinitions
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toolDefinitions.d.ts","sourceRoot":"","sources":["../../src/server/toolDefinitions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"toolDefinitions.d.ts","sourceRoot":"","sources":["../../src/server/toolDefinitions.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;CACH;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,cAAc,EAm0G3C,CAAC"}
|