spatial-memory-mcp 1.6.2__tar.gz → 1.9.0__tar.gz

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.
Files changed (152) hide show
  1. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/.env.example +10 -0
  2. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/.gitignore +11 -0
  3. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/CHANGELOG.md +82 -0
  4. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/MARKETING.md +3 -3
  5. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/PKG-INFO +14 -4
  6. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/README.md +10 -3
  7. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/docs/API.md +3 -3
  8. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/docs/BENCHMARKS.md +7 -6
  9. spatial_memory_mcp-1.9.0/docs/CONFIGURATION.md +251 -0
  10. spatial_memory_mcp-1.9.0/docs/GETTING_STARTED.md +258 -0
  11. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/pyproject.toml +34 -2
  12. spatial_memory_mcp-1.9.0/requirements.lock +271 -0
  13. spatial_memory_mcp-1.9.0/scripts/test_auto_decay.py +288 -0
  14. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/__init__.py +1 -1
  15. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/__main__.py +6 -5
  16. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/adapters/lancedb_repository.py +2 -0
  17. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/config.py +41 -0
  18. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/consolidation_strategies.py +1 -1
  19. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/database.py +4 -4
  20. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/db_idempotency.py +3 -3
  21. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/db_migrations.py +6 -1
  22. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/db_versioning.py +3 -2
  23. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/embeddings.py +2 -1
  24. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/import_security.py +5 -4
  25. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/models.py +32 -0
  26. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/response_types.py +4 -0
  27. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/spatial_ops.py +11 -7
  28. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/validation.py +16 -13
  29. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/factory.py +444 -407
  30. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/server.py +104 -35
  31. spatial_memory_mcp-1.9.0/spatial_memory/services/decay_manager.py +411 -0
  32. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/services/export_import.py +6 -0
  33. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/services/lifecycle.py +16 -0
  34. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/services/memory.py +1 -1
  35. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/services/spatial.py +3 -1
  36. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/services/utility.py +18 -0
  37. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/conftest.py +0 -1
  38. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/conftest.py +0 -1
  39. spatial_memory_mcp-1.9.0/tests/integration/test_auto_decay.py +431 -0
  40. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_backup_restore.py +3 -4
  41. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_concurrent_writes.py +0 -1
  42. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_cross_process_locking.py +9 -9
  43. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_database.py +4 -4
  44. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_database_safeguards.py +0 -1
  45. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_enterprise_features.py +5 -8
  46. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_indexing.py +3 -5
  47. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_mcp_server.py +0 -1
  48. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_namespace_ops.py +7 -11
  49. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_phase5_tools.py +8 -6
  50. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_security_edge_cases.py +7 -14
  51. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_ttl_snapshots.py +5 -5
  52. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_connection_pool.py +2 -2
  53. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_logging.py +0 -1
  54. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_metrics.py +2 -1
  55. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_validation.py +19 -8
  56. spatial_memory_mcp-1.9.0/tests/unit/test_decay_manager.py +630 -0
  57. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_export_import_service.py +3 -5
  58. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_export_ops.py +2 -4
  59. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_file_security.py +49 -46
  60. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_filesystem.py +16 -4
  61. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_hybrid_search_ops.py +1 -1
  62. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_import_ops.py +1 -3
  63. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_lifecycle_service.py +2 -1
  64. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_process_lock.py +0 -2
  65. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_spatial_service.py +2 -2
  66. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_stats_ops.py +4 -7
  67. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_utility_service.py +32 -33
  68. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_utils.py +0 -2
  69. spatial_memory_mcp-1.6.2/ISSUES-TRACKER.md +0 -303
  70. spatial_memory_mcp-1.6.2/LIFECYCLE_PHASE_PLAN.md +0 -1052
  71. spatial_memory_mcp-1.6.2/PHASE4B_PLAN.md +0 -1853
  72. spatial_memory_mcp-1.6.2/PHASE4_PLAN.md +0 -1256
  73. spatial_memory_mcp-1.6.2/PHASE5_UTILITIES_PLAN.md +0 -1595
  74. spatial_memory_mcp-1.6.2/SPATIAL-MEMORY-MCP-SERVER-PLAN (1).md +0 -3005
  75. spatial_memory_mcp-1.6.2/examples/demo_config_logging.py +0 -98
  76. spatial_memory_mcp-1.6.2/stubs/hdbscan/__init__.pyi +0 -22
  77. spatial_memory_mcp-1.6.2/stubs/lancedb/__init__.pyi +0 -27
  78. spatial_memory_mcp-1.6.2/stubs/lancedb/index.pyi +0 -21
  79. spatial_memory_mcp-1.6.2/stubs/lancedb/rerankers.pyi +0 -6
  80. spatial_memory_mcp-1.6.2/stubs/lancedb/table.pyi +0 -90
  81. spatial_memory_mcp-1.6.2/stubs/mcp/__init__.pyi +0 -4
  82. spatial_memory_mcp-1.6.2/stubs/mcp/server/__init__.pyi +0 -33
  83. spatial_memory_mcp-1.6.2/stubs/mcp/server/stdio.pyi +0 -20
  84. spatial_memory_mcp-1.6.2/stubs/mcp/types.pyi +0 -27
  85. spatial_memory_mcp-1.6.2/stubs/openai/__init__.pyi +0 -26
  86. spatial_memory_mcp-1.6.2/stubs/pyarrow/__init__.pyi +0 -24
  87. spatial_memory_mcp-1.6.2/stubs/pyarrow/parquet.pyi +0 -18
  88. spatial_memory_mcp-1.6.2/stubs/sklearn/__init__.pyi +0 -1
  89. spatial_memory_mcp-1.6.2/stubs/sklearn/metrics/__init__.pyi +0 -12
  90. spatial_memory_mcp-1.6.2/stubs/umap/__init__.pyi +0 -22
  91. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/CLAUDE.md +0 -0
  92. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/CONTRIBUTING.md +0 -0
  93. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/LICENSE +0 -0
  94. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/SECURITY.md +0 -0
  95. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/SPATIAL-MEMORY-ARCHITECTURE-DIAGRAMS.md +0 -0
  96. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/docs/MCP_SERVER_INSTRUCTIONS.md +0 -0
  97. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/docs/METRICS.md +0 -0
  98. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/docs/TECHNICAL_HIGHLIGHTS.md +0 -0
  99. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/docs/troubleshooting.md +0 -0
  100. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/scripts/benchmark.py +0 -0
  101. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/scripts/inspect_db.py +0 -0
  102. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/scripts/populate_test_data.py +0 -0
  103. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/scripts/test_all_tools.py +0 -0
  104. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/adapters/__init__.py +0 -0
  105. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/__init__.py +0 -0
  106. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/cache.py +0 -0
  107. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/circuit_breaker.py +0 -0
  108. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/connection_pool.py +0 -0
  109. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/db_indexes.py +0 -0
  110. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/db_search.py +0 -0
  111. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/errors.py +0 -0
  112. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/file_security.py +0 -0
  113. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/filesystem.py +0 -0
  114. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/health.py +0 -0
  115. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/helpers.py +0 -0
  116. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/lifecycle_ops.py +0 -0
  117. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/logging.py +0 -0
  118. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/metrics.py +0 -0
  119. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/rate_limiter.py +0 -0
  120. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/security.py +0 -0
  121. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/tracing.py +0 -0
  122. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/core/utils.py +0 -0
  123. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/migrations/__init__.py +0 -0
  124. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/ports/__init__.py +0 -0
  125. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/ports/repositories.py +0 -0
  126. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/py.typed +0 -0
  127. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/services/__init__.py +0 -0
  128. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/tools/__init__.py +0 -0
  129. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/tools/definitions.py +0 -0
  130. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/spatial_memory/verify.py +0 -0
  131. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/__init__.py +0 -0
  132. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/__init__.py +0 -0
  133. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_embeddings.py +0 -0
  134. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/integration/test_server_v153.py +0 -0
  135. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_config.py +0 -0
  136. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_health.py +0 -0
  137. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_helpers.py +0 -0
  138. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_models.py +0 -0
  139. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/test_rate_limiter.py +0 -0
  140. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/__init__.py +0 -0
  141. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_cache.py +0 -0
  142. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_circuit_breaker.py +0 -0
  143. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_config_phase5.py +0 -0
  144. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_errors_phase5.py +0 -0
  145. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_import_security.py +0 -0
  146. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_lancedb_repository_phase5.py +0 -0
  147. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_lifecycle_ops.py +0 -0
  148. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_memory_service.py +0 -0
  149. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_models_phase5.py +0 -0
  150. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_security_facade.py +0 -0
  151. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_spatial_ops.py +0 -0
  152. {spatial_memory_mcp-1.6.2 → spatial_memory_mcp-1.9.0}/tests/unit/test_tracing.py +0 -0
@@ -96,6 +96,16 @@
96
96
  # Days without access before decay starts
97
97
  # SPATIAL_MEMORY_DECAY_DAYS_THRESHOLD=30
98
98
 
99
+ # =============================================================================
100
+ # AUTO-DECAY SETTINGS
101
+ # =============================================================================
102
+
103
+ # Decay function: exponential (default), linear, or step
104
+ # - exponential: Smooth decay following 2^(-t/half_life), best for most use cases
105
+ # - linear: Constant rate decay reaching 0 at 2x half_life
106
+ # - step: Discrete drops at half_life intervals (1.0 -> 0.5 -> 0.25)
107
+ # SPATIAL_MEMORY_AUTO_DECAY_FUNCTION=exponential
108
+
99
109
  # =============================================================================
100
110
  # CLUSTERING (HDBSCAN)
101
111
  # =============================================================================
@@ -138,6 +138,7 @@ cython_debug/
138
138
  # OS
139
139
  .DS_Store
140
140
  Thumbs.db
141
+ nul
141
142
 
142
143
  # Project specific
143
144
  *.lancedb/
@@ -145,6 +146,16 @@ Thumbs.db
145
146
  data/
146
147
  memories/
147
148
  .spatial-memory/
149
+ .spatial-memory-test/
150
+ .demo-memory/
151
+ temp_test/
152
+ stubs/
153
+
154
+ # Internal development docs (not for public repo)
155
+ ISSUES-TRACKER.md
156
+ PHASE*_PLAN.md
157
+ LIFECYCLE_PHASE_PLAN.md
158
+ *-SERVER-PLAN*.md
148
159
 
149
160
  # Secrets
150
161
  .env.local
@@ -11,6 +11,88 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
  - Medium severity architectural improvements (MED-ARCH-001 through MED-ARCH-004)
12
12
  - Migration system (MED-DB-005)
13
13
 
14
+ ## [1.9.0] - 2026-02-02
15
+
16
+ ### Breaking Changes
17
+ - **Stricter Namespace Validation**: Namespaces now follow DNS label conventions
18
+ - Must start with a letter (a-z, A-Z)
19
+ - Can only contain letters, numbers, dashes, and underscores
20
+ - Maximum 63 characters (was 256)
21
+ - **Dots no longer allowed** - use underscores instead (e.g., `ns_v1` not `ns.v1`)
22
+ - **Numeric start no longer allowed** - must start with letter
23
+
24
+ ### Added
25
+ - **Getting Started Tutorial**: New `docs/GETTING_STARTED.md` with step-by-step guide
26
+ - **Dependency Lock File**: `requirements.lock` with 79 pinned packages for reproducible builds
27
+ - **PyPI Metadata**: Added Documentation, Changelog, and Bug Tracker URLs to pyproject.toml
28
+
29
+ ### Changed
30
+ - **Consolidated Namespace Validation**: Single canonical pattern across all modules
31
+ - `validation.py` now exports `NAMESPACE_PATTERN` used by `import_security.py`
32
+ - Consistent error messages with clear format requirements
33
+ - **mypy Configuration**: Replaced outdated `stubs/` directory with module overrides
34
+ - External libraries (lancedb, pyarrow, hdbscan, etc.) now use `ignore_missing_imports`
35
+ - All 49 source files pass strict mypy checks
36
+
37
+ ### Fixed
38
+ - Resolved mypy configuration issue where deleted `stubs/` directory was still referenced
39
+
40
+ ## [1.8.0] - 2026-02-02
41
+
42
+ ### Added
43
+ - **Unified Decay System**: Auto-decay and manual decay now use the same algorithm
44
+ - New `SPATIAL_MEMORY_AUTO_DECAY_FUNCTION` config option to choose decay function
45
+ - Supported functions: `exponential` (default), `linear`, `step`
46
+ - Consistent behavior regardless of code path (auto-decay vs manual `decay` tool)
47
+ - Adaptive half-life based on access count and importance
48
+ - New `decay_function` field in `AutoDecayConfig` model
49
+
50
+ ### Changed
51
+ - `DecayManager` now uses `calculate_decay_factor()` from `lifecycle_ops.py` instead of a separate implementation
52
+ - Auto-decay effective half-life now considers both access count (1.5× per access) and importance factor (1 + importance)
53
+
54
+ ### Fixed
55
+ - **Type Safety**: Resolved all mypy errors in main source code (49 source files)
56
+ - Added proper type annotations for numpy operations returning `Any`
57
+ - Fixed protocol type assignments in factory.py
58
+ - Added `__all__` exports to service modules
59
+ - Fixed type narrowing issues with optional database connections
60
+ - **Code Quality**: Resolved all ruff linting errors in test files (45 issues)
61
+ - Fixed import ordering (E402) by moving `pytestmark` after imports
62
+ - Removed unused variable assignments (F841)
63
+ - Fixed lines exceeding 100 characters (E501)
64
+
65
+ ### Documentation
66
+ - Updated `docs/CONFIGURATION.md` with `SPATIAL_MEMORY_AUTO_DECAY_FUNCTION` option
67
+ - Updated `.env.example` with decay function configuration examples
68
+
69
+ ## [1.7.0] - 2026-02-02
70
+
71
+ ### Added
72
+ - **Auto-Decay Feature**: Automatic time-based importance decay during recall operations
73
+ - Memories automatically lose importance over time if not accessed (exponential decay)
74
+ - `effective_importance` field added to `recall` and `hybrid_recall` responses
75
+ - Results re-ranked by `similarity × effective_importance` to favor recent memories
76
+ - Background persistence thread batches and saves decay updates to database
77
+ - Configurable via environment variables:
78
+ - `SPATIAL_MEMORY_AUTO_DECAY_ENABLED` (default: true)
79
+ - `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED` (default: true)
80
+ - `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_BATCH_SIZE` (default: 100)
81
+ - `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_FLUSH_INTERVAL_SECONDS` (default: 5.0)
82
+ - `SPATIAL_MEMORY_AUTO_DECAY_MIN_CHANGE_THRESHOLD` (default: 0.01)
83
+ - `SPATIAL_MEMORY_AUTO_DECAY_MAX_QUEUE_SIZE` (default: 10000)
84
+ - Access count slows decay: frequently accessed memories stay relevant longer
85
+ - Minimum importance floor prevents memories from decaying to zero
86
+ - Configuration documentation (`docs/CONFIGURATION.md`)
87
+ - Complete reference for all environment variables
88
+ - Examples for `.mcp.json`, Claude Desktop, and `.env` files
89
+ - Auto-decay configuration guide
90
+ - Test script for verifying auto-decay (`scripts/test_auto_decay.py`)
91
+
92
+ ### Changed
93
+ - `MemoryResultDict` and `HybridMemoryDict` response types now include optional `effective_importance` field
94
+ - `MemoryResult` and `HybridMemoryMatch` models now include `last_accessed` and `access_count` fields
95
+
14
96
  ## [1.6.2] - 2026-02-02
15
97
 
16
98
  ### Added
@@ -173,7 +173,7 @@ Auto-indexing triggers at 10K+ memories using IVF_PQ. Sub-linear search complexi
173
173
  | Visualization | Yes | No | No | No |
174
174
  | Enterprise Features | Full Suite | Minimal | Basic | Basic |
175
175
  | External Dependencies | None (embedded) | PostgreSQL | Varies | File-based |
176
- | Test Coverage | 1,360 tests | Minimal | Unknown | Unknown |
176
+ | Test Coverage | 1,400+ tests | Minimal | Unknown | Unknown |
177
177
 
178
178
  **mcp-mem0**: 3 tools, 4 commits, requires PostgreSQL infrastructure.
179
179
 
@@ -211,8 +211,8 @@ Navigate between concepts. Discover intermediate ideas. Visualize knowledge stru
211
211
  - **Interpolation**: SLERP (Spherical Linear Interpolation)
212
212
  - **Architecture**: Clean architecture with dependency injection
213
213
  - **Type Safety**: Full type hints, mypy strict mode
214
- - **Test Suite**: 1,360 passing tests
215
- - **Version**: 1.6.2
214
+ - **Test Suite**: 1,400+ passing tests
215
+ - **Version**: 1.7.0
216
216
 
217
217
  ---
218
218
 
@@ -1,9 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spatial-memory-mcp
3
- Version: 1.6.2
3
+ Version: 1.9.0
4
4
  Summary: Spatial bidirectional persistent memory MCP server for LLMs - vector-based semantic memory as a navigable landscape
5
5
  Project-URL: Homepage, https://github.com/arman-tech/spatial-memory-mcp
6
6
  Project-URL: Repository, https://github.com/arman-tech/spatial-memory-mcp
7
+ Project-URL: Documentation, https://github.com/arman-tech/spatial-memory-mcp#readme
8
+ Project-URL: Changelog, https://github.com/arman-tech/spatial-memory-mcp/blob/master/CHANGELOG.md
9
+ Project-URL: Bug Tracker, https://github.com/arman-tech/spatial-memory-mcp/issues
7
10
  Author: arman-tech
8
11
  License: MIT
9
12
  License-File: LICENSE
@@ -48,7 +51,7 @@ Description-Content-Type: text/markdown
48
51
 
49
52
  A vector-based spatial memory system that treats knowledge as a navigable landscape, not a filing cabinet.
50
53
 
51
- > **Version 1.6.2** — Production-ready with 1,360 tests passing.
54
+ > **Version 1.8.0** — Production-ready with 1,400+ tests passing.
52
55
 
53
56
  ## Supported Platforms
54
57
 
@@ -64,6 +67,7 @@ Spatial Memory MCP Server provides persistent, semantic memory for LLMs through
64
67
  - **Spatial Navigation**: Discover connections through `journey` and `wander` operations
65
68
  - **Auto-Clustering**: `regions` automatically groups related concepts
66
69
  - **Cognitive Dynamics**: Memories consolidate, decay, and reinforce like human cognition
70
+ - **Auto-Decay**: Memories automatically fade over time, keeping recent knowledge prominent
67
71
  - **Visual Understanding**: Generate Mermaid/SVG/JSON visualizations of your knowledge space
68
72
  - **Hybrid Search**: Combine vector similarity with full-text search
69
73
 
@@ -112,7 +116,7 @@ Connection pooling, circuit breakers, per-agent rate limiting, request tracing,
112
116
  - **ONNX Runtime** by default for 2-3x faster embeddings
113
117
  - **Enterprise features**: Connection pooling, retry logic, batch operations
114
118
  - **Comprehensive security**: Path validation, SQL injection prevention, input sanitization
115
- - **1360 tests** including security edge cases
119
+ - **1400+ tests** including security edge cases
116
120
 
117
121
  ## Roadmap
118
122
 
@@ -123,7 +127,7 @@ Connection pooling, circuit breakers, per-agent rate limiting, request tracing,
123
127
  | Phase 3: Spatial Operations | Complete | `journey`, `wander`, `regions`, `visualize` |
124
128
  | Phase 4: Lifecycle Operations | Complete | `consolidate`, `extract`, `decay`, `reinforce` |
125
129
  | Phase 5: Utilities | Complete | `stats`, `namespaces`, `export`, `import`, `hybrid_recall` |
126
- | Phase 6: Polish & Release | Complete | v1.6.0 on PyPI |
130
+ | Phase 6: Polish & Release | Complete | v1.8.0 on PyPI |
127
131
 
128
132
  ## Installation
129
133
 
@@ -248,6 +252,11 @@ cp .env.example .env
248
252
  | `SPATIAL_MEMORY_OPENAI_API_KEY` | - | Required only for OpenAI embeddings |
249
253
  | `SPATIAL_MEMORY_LOG_LEVEL` | `INFO` | Logging verbosity |
250
254
  | `SPATIAL_MEMORY_AUTO_CREATE_INDEXES` | `true` | Auto-create vector indexes |
255
+ | `SPATIAL_MEMORY_AUTO_DECAY_ENABLED` | `true` | Enable automatic importance decay |
256
+ | `SPATIAL_MEMORY_AUTO_DECAY_FUNCTION` | `exponential` | Decay function: `exponential`, `linear`, or `step` |
257
+ | `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED` | `true` | Persist decay updates to database |
258
+
259
+ See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for the complete configuration reference.
251
260
 
252
261
  ### Embedding Models
253
262
 
@@ -459,6 +468,7 @@ See [SPATIAL-MEMORY-ARCHITECTURE-DIAGRAMS.md](SPATIAL-MEMORY-ARCHITECTURE-DIAGRA
459
468
  | Document | Description |
460
469
  |----------|-------------|
461
470
  | [docs/API.md](docs/API.md) | Complete API reference for all 22 tools |
471
+ | [docs/CONFIGURATION.md](docs/CONFIGURATION.md) | Full configuration reference (env vars, .mcp.json, auto-decay) |
462
472
  | [docs/BENCHMARKS.md](docs/BENCHMARKS.md) | Performance benchmarks and test results |
463
473
  | [docs/METRICS.md](docs/METRICS.md) | Prometheus metrics documentation |
464
474
  | [docs/troubleshooting.md](docs/troubleshooting.md) | Troubleshooting guide |
@@ -6,7 +6,7 @@
6
6
 
7
7
  A vector-based spatial memory system that treats knowledge as a navigable landscape, not a filing cabinet.
8
8
 
9
- > **Version 1.6.2** — Production-ready with 1,360 tests passing.
9
+ > **Version 1.8.0** — Production-ready with 1,400+ tests passing.
10
10
 
11
11
  ## Supported Platforms
12
12
 
@@ -22,6 +22,7 @@ Spatial Memory MCP Server provides persistent, semantic memory for LLMs through
22
22
  - **Spatial Navigation**: Discover connections through `journey` and `wander` operations
23
23
  - **Auto-Clustering**: `regions` automatically groups related concepts
24
24
  - **Cognitive Dynamics**: Memories consolidate, decay, and reinforce like human cognition
25
+ - **Auto-Decay**: Memories automatically fade over time, keeping recent knowledge prominent
25
26
  - **Visual Understanding**: Generate Mermaid/SVG/JSON visualizations of your knowledge space
26
27
  - **Hybrid Search**: Combine vector similarity with full-text search
27
28
 
@@ -70,7 +71,7 @@ Connection pooling, circuit breakers, per-agent rate limiting, request tracing,
70
71
  - **ONNX Runtime** by default for 2-3x faster embeddings
71
72
  - **Enterprise features**: Connection pooling, retry logic, batch operations
72
73
  - **Comprehensive security**: Path validation, SQL injection prevention, input sanitization
73
- - **1360 tests** including security edge cases
74
+ - **1400+ tests** including security edge cases
74
75
 
75
76
  ## Roadmap
76
77
 
@@ -81,7 +82,7 @@ Connection pooling, circuit breakers, per-agent rate limiting, request tracing,
81
82
  | Phase 3: Spatial Operations | Complete | `journey`, `wander`, `regions`, `visualize` |
82
83
  | Phase 4: Lifecycle Operations | Complete | `consolidate`, `extract`, `decay`, `reinforce` |
83
84
  | Phase 5: Utilities | Complete | `stats`, `namespaces`, `export`, `import`, `hybrid_recall` |
84
- | Phase 6: Polish & Release | Complete | v1.6.0 on PyPI |
85
+ | Phase 6: Polish & Release | Complete | v1.8.0 on PyPI |
85
86
 
86
87
  ## Installation
87
88
 
@@ -206,6 +207,11 @@ cp .env.example .env
206
207
  | `SPATIAL_MEMORY_OPENAI_API_KEY` | - | Required only for OpenAI embeddings |
207
208
  | `SPATIAL_MEMORY_LOG_LEVEL` | `INFO` | Logging verbosity |
208
209
  | `SPATIAL_MEMORY_AUTO_CREATE_INDEXES` | `true` | Auto-create vector indexes |
210
+ | `SPATIAL_MEMORY_AUTO_DECAY_ENABLED` | `true` | Enable automatic importance decay |
211
+ | `SPATIAL_MEMORY_AUTO_DECAY_FUNCTION` | `exponential` | Decay function: `exponential`, `linear`, or `step` |
212
+ | `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED` | `true` | Persist decay updates to database |
213
+
214
+ See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for the complete configuration reference.
209
215
 
210
216
  ### Embedding Models
211
217
 
@@ -417,6 +423,7 @@ See [SPATIAL-MEMORY-ARCHITECTURE-DIAGRAMS.md](SPATIAL-MEMORY-ARCHITECTURE-DIAGRA
417
423
  | Document | Description |
418
424
  |----------|-------------|
419
425
  | [docs/API.md](docs/API.md) | Complete API reference for all 22 tools |
426
+ | [docs/CONFIGURATION.md](docs/CONFIGURATION.md) | Full configuration reference (env vars, .mcp.json, auto-decay) |
420
427
  | [docs/BENCHMARKS.md](docs/BENCHMARKS.md) | Performance benchmarks and test results |
421
428
  | [docs/METRICS.md](docs/METRICS.md) | Prometheus metrics documentation |
422
429
  | [docs/troubleshooting.md](docs/troubleshooting.md) | Troubleshooting guide |
@@ -1,6 +1,6 @@
1
1
  # Spatial Memory MCP Server - API Reference
2
2
 
3
- Complete reference documentation for all 21 MCP tools provided by the Spatial Memory server.
3
+ Complete reference documentation for all 22 MCP tools provided by the Spatial Memory server.
4
4
 
5
5
  ## Table of Contents
6
6
 
@@ -41,11 +41,11 @@ Complete reference documentation for all 21 MCP tools provided by the Spatial Me
41
41
 
42
42
  ### Tool Categories
43
43
 
44
- The 21 tools are organized into four categories:
44
+ The 22 tools are organized into four categories:
45
45
 
46
46
  | Category | Tools | Purpose |
47
47
  |----------|-------|---------|
48
- | **Core** | 6 | Basic CRUD operations for memories |
48
+ | **Core** | 7 | Basic CRUD operations for memories (includes health) |
49
49
  | **Spatial** | 4 | Navigation and exploration of memory space |
50
50
  | **Lifecycle** | 4 | Memory maintenance and evolution |
51
51
  | **Utility** | 7 | Administration, export/import, and hybrid search |
@@ -23,7 +23,7 @@ Benchmark results for the Spatial Memory MCP Server on Windows 11.
23
23
  | **Latency** | Remember (single) | 8.4 ms mean |
24
24
  | **Latency** | Recall (limit=5) | 57 ms mean |
25
25
  | **Latency** | Nearby | 7.4 ms mean |
26
- | **Tool Coverage** | Functional tests | 18/21 passed (85.7%) |
26
+ | **Tool Coverage** | Functional tests | 19/22 passed (86.4%) |
27
27
 
28
28
  ---
29
29
 
@@ -106,9 +106,9 @@ Benchmark results for the Spatial Memory MCP Server on Windows 11.
106
106
 
107
107
  ## Tool Functional Test Results
108
108
 
109
- All 21 tools were tested systematically. Results:
109
+ All 22 tools were tested systematically. Results:
110
110
 
111
- ### Passing Tools (18/21)
111
+ ### Passing Tools (19/22)
112
112
 
113
113
  | Category | Tool | Status | Latency |
114
114
  |----------|------|--------|---------|
@@ -124,6 +124,7 @@ All 21 tools were tested systematically. Results:
124
124
  | Lifecycle | reinforce | PASS | 12.5 ms |
125
125
  | Lifecycle | extract | PASS | 39.2 ms |
126
126
  | Lifecycle | consolidate | PASS | 8.1 ms |
127
+ | Lifecycle | decay | PASS | ~10 ms |
127
128
  | Utility | stats | PASS | 8.3 ms |
128
129
  | Utility | namespaces | PASS | 6.5 ms |
129
130
  | Utility | delete_namespace | PASS | 1.1 ms |
@@ -131,15 +132,15 @@ All 21 tools were tested systematically. Results:
131
132
  | Utility | hybrid_recall | PASS | 5.7 ms |
132
133
  | Utility | health | PASS | 7.6 ms |
133
134
 
134
- ### Failing Tools (3/21)
135
+ ### Failing Tools (3/22)
135
136
 
136
137
  | Tool | Error | Root Cause |
137
138
  |------|-------|------------|
138
139
  | journey | `distance_to_path` validation | Floating point precision (-4.89e-08) |
139
- | decay | Datetime subtraction error | Timezone naive vs aware mismatch |
140
140
  | export_memories | Path security violation | Test path under C:\Users blocked |
141
+ | import_memories | Not tested | Missing from benchmark suite |
141
142
 
142
- **Note:** These failures are edge cases in test conditions, not fundamental issues. The journey and decay bugs should be fixed in a future patch.
143
+ **Note:** These failures are edge cases in test conditions, not fundamental issues. The `decay` timezone bug was fixed in v1.7.0.
143
144
 
144
145
  ---
145
146
 
@@ -0,0 +1,251 @@
1
+ # Configuration Guide
2
+
3
+ Spatial Memory MCP Server is configured via environment variables with the `SPATIAL_MEMORY_` prefix.
4
+
5
+ ## Configuration Methods
6
+
7
+ ### 1. `.mcp.json` (Recommended for MCP Clients)
8
+
9
+ Create a `.mcp.json` file in your project root:
10
+
11
+ ```json
12
+ {
13
+ "mcpServers": {
14
+ "spatial-memory": {
15
+ "command": "spatial-memory",
16
+ "env": {
17
+ "SPATIAL_MEMORY_AUTO_DECAY_ENABLED": "true",
18
+ "SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED": "false",
19
+ "SPATIAL_MEMORY_LOG_LEVEL": "INFO"
20
+ }
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### 2. Claude Desktop Configuration
27
+
28
+ Edit `claude_desktop_config.json`:
29
+
30
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
31
+ **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
32
+
33
+ ```json
34
+ {
35
+ "mcpServers": {
36
+ "spatial-memory": {
37
+ "command": "spatial-memory",
38
+ "env": {
39
+ "SPATIAL_MEMORY_MEMORY_PATH": "/path/to/storage",
40
+ "SPATIAL_MEMORY_AUTO_DECAY_ENABLED": "true"
41
+ }
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ ### 3. Environment Variables
48
+
49
+ ```bash
50
+ # Export before running
51
+ export SPATIAL_MEMORY_AUTO_DECAY_ENABLED=true
52
+ export SPATIAL_MEMORY_LOG_LEVEL=DEBUG
53
+ spatial-memory
54
+ ```
55
+
56
+ Or inline:
57
+
58
+ ```bash
59
+ SPATIAL_MEMORY_AUTO_DECAY_ENABLED=false spatial-memory
60
+ ```
61
+
62
+ ### 4. `.env` File
63
+
64
+ Create a `.env` file in your working directory:
65
+
66
+ ```env
67
+ SPATIAL_MEMORY_MEMORY_PATH=./.spatial-memory
68
+ SPATIAL_MEMORY_LOG_LEVEL=INFO
69
+ SPATIAL_MEMORY_AUTO_DECAY_ENABLED=true
70
+ SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED=true
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Configuration Reference
76
+
77
+ ### Storage
78
+
79
+ | Variable | Default | Description |
80
+ |----------|---------|-------------|
81
+ | `SPATIAL_MEMORY_MEMORY_PATH` | `./.spatial-memory` | Path to LanceDB storage directory |
82
+ | `SPATIAL_MEMORY_ACKNOWLEDGE_NETWORK_FILESYSTEM_RISK` | `false` | Suppress network filesystem warnings |
83
+
84
+ ### Embedding Model
85
+
86
+ | Variable | Default | Description |
87
+ |----------|---------|-------------|
88
+ | `SPATIAL_MEMORY_EMBEDDING_MODEL` | `all-MiniLM-L6-v2` | Model name or `openai:model-name` |
89
+ | `SPATIAL_MEMORY_EMBEDDING_DIMENSIONS` | `384` | Vector dimensions (auto-detected) |
90
+ | `SPATIAL_MEMORY_EMBEDDING_BACKEND` | `auto` | Backend: `auto`, `onnx`, or `pytorch` |
91
+
92
+ ### OpenAI (Optional)
93
+
94
+ | Variable | Default | Description |
95
+ |----------|---------|-------------|
96
+ | `SPATIAL_MEMORY_OPENAI_API_KEY` | `null` | OpenAI API key for embeddings |
97
+ | `SPATIAL_MEMORY_OPENAI_EMBEDDING_MODEL` | `text-embedding-3-small` | OpenAI model to use |
98
+
99
+ ### Server
100
+
101
+ | Variable | Default | Description |
102
+ |----------|---------|-------------|
103
+ | `SPATIAL_MEMORY_LOG_LEVEL` | `INFO` | Logging level: `DEBUG`, `INFO`, `WARNING`, `ERROR` |
104
+ | `SPATIAL_MEMORY_LOG_FORMAT` | `text` | Log format: `text` or `json` |
105
+
106
+ ### Memory Defaults
107
+
108
+ | Variable | Default | Description |
109
+ |----------|---------|-------------|
110
+ | `SPATIAL_MEMORY_DEFAULT_NAMESPACE` | `default` | Default namespace for memories |
111
+ | `SPATIAL_MEMORY_DEFAULT_IMPORTANCE` | `0.5` | Default importance (0.0-1.0) |
112
+
113
+ ### Limits
114
+
115
+ | Variable | Default | Description |
116
+ |----------|---------|-------------|
117
+ | `SPATIAL_MEMORY_MAX_BATCH_SIZE` | `100` | Max memories per batch operation |
118
+ | `SPATIAL_MEMORY_MAX_RECALL_LIMIT` | `100` | Max results from recall |
119
+ | `SPATIAL_MEMORY_MAX_JOURNEY_STEPS` | `20` | Max steps in journey |
120
+ | `SPATIAL_MEMORY_MAX_WANDER_STEPS` | `20` | Max steps in wander |
121
+
122
+ ---
123
+
124
+ ## Auto-Decay Settings
125
+
126
+ Auto-decay automatically reduces the importance of memories over time, favoring recently accessed memories in search results.
127
+
128
+ | Variable | Default | Description |
129
+ |----------|---------|-------------|
130
+ | `SPATIAL_MEMORY_AUTO_DECAY_ENABLED` | `true` | Enable decay calculation during recall |
131
+ | `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED` | `true` | Save decayed values to database |
132
+ | `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_BATCH_SIZE` | `100` | Batch size for persistence |
133
+ | `SPATIAL_MEMORY_AUTO_DECAY_PERSIST_FLUSH_INTERVAL_SECONDS` | `5.0` | How often to flush updates (seconds) |
134
+ | `SPATIAL_MEMORY_AUTO_DECAY_MIN_CHANGE_THRESHOLD` | `0.01` | Min change to trigger persist (1%) |
135
+ | `SPATIAL_MEMORY_AUTO_DECAY_MAX_QUEUE_SIZE` | `10000` | Max queued updates |
136
+ | `SPATIAL_MEMORY_AUTO_DECAY_FUNCTION` | `exponential` | Decay function: `exponential`, `linear`, or `step` |
137
+
138
+ ### How Auto-Decay Works
139
+
140
+ 1. **Configurable Decay Function**: Choose from `exponential`, `linear`, or `step`
141
+ - `exponential`: Smooth decay following `2^(-t/half_life)`, best for most use cases
142
+ - `linear`: Constant rate decay reaching 0 at 2x half_life
143
+ - `step`: Discrete drops at half_life intervals (1.0 → 0.5 → 0.25)
144
+ 2. **Default Half-Life**: 30 days (memory loses 50% importance after 30 days without access)
145
+ 3. **Adaptive Half-Life**: Access count and importance affect decay rate
146
+ - Frequently accessed memories decay slower (1.5× half-life per access, up to 20)
147
+ - Higher importance memories also decay slower
148
+ 4. **Minimum Floor**: Importance never drops below 10%
149
+
150
+ ### Example Configurations
151
+
152
+ **Disable auto-decay entirely:**
153
+ ```json
154
+ {
155
+ "env": {
156
+ "SPATIAL_MEMORY_AUTO_DECAY_ENABLED": "false"
157
+ }
158
+ }
159
+ ```
160
+
161
+ **Enable decay calculation but don't persist changes:**
162
+ ```json
163
+ {
164
+ "env": {
165
+ "SPATIAL_MEMORY_AUTO_DECAY_ENABLED": "true",
166
+ "SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED": "false"
167
+ }
168
+ }
169
+ ```
170
+
171
+ **Aggressive persistence (frequent flushes):**
172
+ ```json
173
+ {
174
+ "env": {
175
+ "SPATIAL_MEMORY_AUTO_DECAY_PERSIST_FLUSH_INTERVAL_SECONDS": "1.0",
176
+ "SPATIAL_MEMORY_AUTO_DECAY_MIN_CHANGE_THRESHOLD": "0.001"
177
+ }
178
+ }
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Full Example: `.mcp.json`
184
+
185
+ ```json
186
+ {
187
+ "mcpServers": {
188
+ "spatial-memory": {
189
+ "command": "spatial-memory",
190
+ "env": {
191
+ "SPATIAL_MEMORY_MEMORY_PATH": "./my-project-memory",
192
+ "SPATIAL_MEMORY_LOG_LEVEL": "INFO",
193
+ "SPATIAL_MEMORY_DEFAULT_NAMESPACE": "project",
194
+ "SPATIAL_MEMORY_DEFAULT_IMPORTANCE": "0.5",
195
+ "SPATIAL_MEMORY_AUTO_DECAY_ENABLED": "true",
196
+ "SPATIAL_MEMORY_AUTO_DECAY_PERSIST_ENABLED": "true"
197
+ }
198
+ }
199
+ }
200
+ }
201
+ ```
202
+
203
+ ## Full Example: Claude Desktop
204
+
205
+ ```json
206
+ {
207
+ "mcpServers": {
208
+ "spatial-memory": {
209
+ "command": "spatial-memory",
210
+ "env": {
211
+ "SPATIAL_MEMORY_MEMORY_PATH": "/Users/me/memories",
212
+ "SPATIAL_MEMORY_EMBEDDING_MODEL": "openai:text-embedding-3-small",
213
+ "SPATIAL_MEMORY_OPENAI_API_KEY": "sk-...",
214
+ "SPATIAL_MEMORY_AUTO_DECAY_ENABLED": "true"
215
+ }
216
+ }
217
+ }
218
+ }
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Advanced Settings
224
+
225
+ For power users, additional settings are available for:
226
+
227
+ - **Indexing**: `SPATIAL_MEMORY_VECTOR_INDEX_THRESHOLD`, `SPATIAL_MEMORY_AUTO_CREATE_INDEXES`, `SPATIAL_MEMORY_INDEX_TYPE`
228
+ - **Full-Text Search**: `SPATIAL_MEMORY_ENABLE_FTS_INDEX`, `SPATIAL_MEMORY_FTS_LANGUAGE`
229
+ - **Rate Limiting**: `SPATIAL_MEMORY_RATE_LIMIT_PER_AGENT_ENABLED`, `SPATIAL_MEMORY_RATE_LIMIT_PER_AGENT_RATE`
230
+ - **Circuit Breaker**: `SPATIAL_MEMORY_CIRCUIT_BREAKER_ENABLED`, `SPATIAL_MEMORY_CIRCUIT_BREAKER_FAILURE_THRESHOLD`
231
+ - **Caching**: `SPATIAL_MEMORY_RESPONSE_CACHE_ENABLED`, `SPATIAL_MEMORY_RESPONSE_CACHE_MAX_SIZE`
232
+ - **Manual Decay** (via `decay` tool): `SPATIAL_MEMORY_DECAY_DEFAULT_HALF_LIFE_DAYS`, `SPATIAL_MEMORY_DECAY_MIN_IMPORTANCE_FLOOR`
233
+ - **Export/Import**: `SPATIAL_MEMORY_EXPORT_ALLOWED_PATHS`, `SPATIAL_MEMORY_IMPORT_MAX_FILE_SIZE_MB`
234
+
235
+ See the full list in [`spatial_memory/config.py`](../spatial_memory/config.py).
236
+
237
+ ---
238
+
239
+ ## Verifying Configuration
240
+
241
+ Check that your settings are applied by enabling debug logging:
242
+
243
+ ```json
244
+ {
245
+ "env": {
246
+ "SPATIAL_MEMORY_LOG_LEVEL": "DEBUG"
247
+ }
248
+ }
249
+ ```
250
+
251
+ Then check the server logs for configuration values at startup.