memento-mcp-server 1.27.0 โ†’ 1.28.0-b

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 (315) hide show
  1. package/README.en.md +270 -195
  2. package/README.md +185 -274
  3. package/dist/cli/agent-ask.d.ts.map +1 -1
  4. package/dist/cli/agent-ask.js +18 -14
  5. package/dist/cli/agent-ask.js.map +1 -1
  6. package/dist/cli/agent-ops.d.ts +23 -0
  7. package/dist/cli/agent-ops.d.ts.map +1 -0
  8. package/dist/cli/agent-ops.js +568 -0
  9. package/dist/cli/agent-ops.js.map +1 -0
  10. package/dist/cli/claude-code-connect.d.ts +12 -0
  11. package/dist/cli/claude-code-connect.d.ts.map +1 -0
  12. package/dist/cli/claude-code-connect.js +91 -0
  13. package/dist/cli/claude-code-connect.js.map +1 -0
  14. package/dist/cli/claude-code-hook.d.ts +12 -0
  15. package/dist/cli/claude-code-hook.d.ts.map +1 -0
  16. package/dist/cli/claude-code-hook.js +104 -0
  17. package/dist/cli/claude-code-hook.js.map +1 -0
  18. package/dist/cli/codex-connect.d.ts +12 -0
  19. package/dist/cli/codex-connect.d.ts.map +1 -0
  20. package/dist/cli/codex-connect.js +86 -0
  21. package/dist/cli/codex-connect.js.map +1 -0
  22. package/dist/cli/codex-hook.d.ts +12 -0
  23. package/dist/cli/codex-hook.d.ts.map +1 -0
  24. package/dist/cli/codex-hook.js +100 -0
  25. package/dist/cli/codex-hook.js.map +1 -0
  26. package/dist/cli.d.ts.map +1 -1
  27. package/dist/cli.js +31 -1
  28. package/dist/cli.js.map +1 -1
  29. package/dist/server/http-server.d.ts.map +1 -1
  30. package/dist/server/http-server.js +33 -4
  31. package/dist/server/http-server.js.map +1 -1
  32. package/dist/server/middleware/programmatic-auth.middleware.d.ts +1 -0
  33. package/dist/server/middleware/programmatic-auth.middleware.d.ts.map +1 -1
  34. package/dist/server/middleware/programmatic-auth.middleware.js +22 -4
  35. package/dist/server/middleware/programmatic-auth.middleware.js.map +1 -1
  36. package/dist/server/routes/admin/admin-evolution-demo.routes.d.ts +6 -0
  37. package/dist/server/routes/admin/admin-evolution-demo.routes.d.ts.map +1 -0
  38. package/dist/server/routes/admin/admin-evolution-demo.routes.js +44 -0
  39. package/dist/server/routes/admin/admin-evolution-demo.routes.js.map +1 -0
  40. package/dist/server/routes/admin.routes.d.ts.map +1 -1
  41. package/dist/server/routes/admin.routes.js +2 -0
  42. package/dist/server/routes/admin.routes.js.map +1 -1
  43. package/dist/server/routes/agent-transcript-import.d.ts +51 -0
  44. package/dist/server/routes/agent-transcript-import.d.ts.map +1 -0
  45. package/dist/server/routes/agent-transcript-import.js +206 -0
  46. package/dist/server/routes/agent-transcript-import.js.map +1 -0
  47. package/dist/server/routes/agent.routes.d.ts +9 -0
  48. package/dist/server/routes/agent.routes.d.ts.map +1 -0
  49. package/dist/server/routes/agent.routes.dto.d.ts +87 -0
  50. package/dist/server/routes/agent.routes.dto.d.ts.map +1 -0
  51. package/dist/server/routes/agent.routes.dto.js +134 -0
  52. package/dist/server/routes/agent.routes.dto.js.map +1 -0
  53. package/dist/server/routes/agent.routes.events.d.ts +3 -0
  54. package/dist/server/routes/agent.routes.events.d.ts.map +1 -0
  55. package/dist/server/routes/agent.routes.events.js +89 -0
  56. package/dist/server/routes/agent.routes.events.js.map +1 -0
  57. package/dist/server/routes/agent.routes.injection.d.ts +14 -0
  58. package/dist/server/routes/agent.routes.injection.d.ts.map +1 -0
  59. package/dist/server/routes/agent.routes.injection.js +110 -0
  60. package/dist/server/routes/agent.routes.injection.js.map +1 -0
  61. package/dist/server/routes/agent.routes.js +892 -0
  62. package/dist/server/routes/agent.routes.js.map +1 -0
  63. package/dist/server/routes/agent.routes.utils.d.ts +15 -0
  64. package/dist/server/routes/agent.routes.utils.d.ts.map +1 -0
  65. package/dist/server/routes/agent.routes.utils.js +89 -0
  66. package/dist/server/routes/agent.routes.utils.js.map +1 -0
  67. package/dist/server/routes/mcp.routes.d.ts.map +1 -1
  68. package/dist/server/routes/mcp.routes.js +17 -6
  69. package/dist/server/routes/mcp.routes.js.map +1 -1
  70. package/dist/server/utils/mcp-tool-call-error.d.ts +11 -0
  71. package/dist/server/utils/mcp-tool-call-error.d.ts.map +1 -0
  72. package/dist/server/utils/mcp-tool-call-error.js +23 -0
  73. package/dist/server/utils/mcp-tool-call-error.js.map +1 -0
  74. package/node_modules/@memento/core/dist/bootstrap/monitoring-schedulers.d.ts.map +1 -1
  75. package/node_modules/@memento/core/dist/bootstrap/monitoring-schedulers.js +1 -1
  76. package/node_modules/@memento/core/dist/bootstrap/monitoring-schedulers.js.map +1 -1
  77. package/node_modules/@memento/core/dist/database/schema.sql +107 -0
  78. package/node_modules/@memento/core/dist/domains/agent-integration/repositories/agent-integration-repository.d.ts +96 -0
  79. package/node_modules/@memento/core/dist/domains/agent-integration/repositories/agent-integration-repository.d.ts.map +1 -0
  80. package/node_modules/@memento/core/dist/domains/agent-integration/repositories/agent-integration-repository.js +2 -0
  81. package/node_modules/@memento/core/dist/domains/agent-integration/repositories/agent-integration-repository.js.map +1 -0
  82. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-capture-transaction.d.ts +8 -0
  83. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-capture-transaction.d.ts.map +1 -0
  84. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-capture-transaction.js +89 -0
  85. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-capture-transaction.js.map +1 -0
  86. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-injection-service.d.ts +90 -0
  87. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-injection-service.d.ts.map +1 -0
  88. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-injection-service.js +163 -0
  89. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-injection-service.js.map +1 -0
  90. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-recall-service.d.ts +95 -0
  91. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-recall-service.d.ts.map +1 -0
  92. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-recall-service.js +267 -0
  93. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-context-recall-service.js.map +1 -0
  94. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-integration-error.d.ts +8 -0
  95. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-integration-error.d.ts.map +1 -0
  96. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-integration-error.js +13 -0
  97. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-integration-error.js.map +1 -0
  98. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-lifecycle-service.d.ts +53 -0
  99. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-lifecycle-service.d.ts.map +1 -0
  100. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-lifecycle-service.js +112 -0
  101. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-lifecycle-service.js.map +1 -0
  102. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-memory-promotion-service.d.ts +44 -0
  103. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-memory-promotion-service.d.ts.map +1 -0
  104. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-memory-promotion-service.js +197 -0
  105. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-memory-promotion-service.js.map +1 -0
  106. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-provenance-graph.d.ts +9 -0
  107. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-provenance-graph.d.ts.map +1 -0
  108. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-provenance-graph.js +102 -0
  109. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-provenance-graph.js.map +1 -0
  110. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-session-summary-service.d.ts +36 -0
  111. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-session-summary-service.d.ts.map +1 -0
  112. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-session-summary-service.js +130 -0
  113. package/node_modules/@memento/core/dist/domains/agent-integration/services/agent-session-summary-service.js.map +1 -0
  114. package/node_modules/@memento/core/dist/domains/agent-integration/services/sqlite-hybrid-agent-context-source.d.ts +20 -0
  115. package/node_modules/@memento/core/dist/domains/agent-integration/services/sqlite-hybrid-agent-context-source.d.ts.map +1 -0
  116. package/node_modules/@memento/core/dist/domains/agent-integration/services/sqlite-hybrid-agent-context-source.js +128 -0
  117. package/node_modules/@memento/core/dist/domains/agent-integration/services/sqlite-hybrid-agent-context-source.js.map +1 -0
  118. package/node_modules/@memento/core/dist/domains/agent-integration/types.d.ts +152 -0
  119. package/node_modules/@memento/core/dist/domains/agent-integration/types.d.ts.map +1 -0
  120. package/node_modules/@memento/core/dist/domains/agent-integration/types.js +2 -0
  121. package/node_modules/@memento/core/dist/domains/agent-integration/types.js.map +1 -0
  122. package/node_modules/@memento/core/dist/domains/consolidation/services/summarization-service.d.ts.map +1 -1
  123. package/node_modules/@memento/core/dist/domains/consolidation/services/summarization-service.js +3 -2
  124. package/node_modules/@memento/core/dist/domains/consolidation/services/summarization-service.js.map +1 -1
  125. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/answer-over-time.snapshots.d.ts +46 -0
  126. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/answer-over-time.snapshots.d.ts.map +1 -0
  127. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/answer-over-time.snapshots.js +46 -0
  128. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/answer-over-time.snapshots.js.map +1 -0
  129. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/forgetting-policy.snapshots.d.ts +47 -0
  130. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/forgetting-policy.snapshots.d.ts.map +1 -0
  131. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/forgetting-policy.snapshots.js +79 -0
  132. package/node_modules/@memento/core/dist/domains/evolution-demo/fixtures/forgetting-policy.snapshots.js.map +1 -0
  133. package/node_modules/@memento/core/dist/domains/evolution-demo/getters.d.ts +12 -0
  134. package/node_modules/@memento/core/dist/domains/evolution-demo/getters.d.ts.map +1 -0
  135. package/node_modules/@memento/core/dist/domains/evolution-demo/getters.js +69 -0
  136. package/node_modules/@memento/core/dist/domains/evolution-demo/getters.js.map +1 -0
  137. package/node_modules/@memento/core/dist/domains/evolution-demo/index.d.ts +4 -0
  138. package/node_modules/@memento/core/dist/domains/evolution-demo/index.d.ts.map +1 -0
  139. package/node_modules/@memento/core/dist/domains/evolution-demo/index.js +3 -0
  140. package/node_modules/@memento/core/dist/domains/evolution-demo/index.js.map +1 -0
  141. package/node_modules/@memento/core/dist/domains/evolution-demo/spec.d.ts +337 -0
  142. package/node_modules/@memento/core/dist/domains/evolution-demo/spec.d.ts.map +1 -0
  143. package/node_modules/@memento/core/dist/domains/evolution-demo/spec.js +66 -0
  144. package/node_modules/@memento/core/dist/domains/evolution-demo/spec.js.map +1 -0
  145. package/node_modules/@memento/core/dist/domains/evolution-demo/store.d.ts +8 -0
  146. package/node_modules/@memento/core/dist/domains/evolution-demo/store.d.ts.map +1 -0
  147. package/node_modules/@memento/core/dist/domains/evolution-demo/store.js +124 -0
  148. package/node_modules/@memento/core/dist/domains/evolution-demo/store.js.map +1 -0
  149. package/node_modules/@memento/core/dist/domains/evolution-demo/types.d.ts +66 -0
  150. package/node_modules/@memento/core/dist/domains/evolution-demo/types.d.ts.map +1 -0
  151. package/node_modules/@memento/core/dist/domains/evolution-demo/types.js +6 -0
  152. package/node_modules/@memento/core/dist/domains/evolution-demo/types.js.map +1 -0
  153. package/node_modules/@memento/core/dist/domains/memory/services/procedural-llm-extractor.d.ts.map +1 -1
  154. package/node_modules/@memento/core/dist/domains/memory/services/procedural-llm-extractor.js +3 -2
  155. package/node_modules/@memento/core/dist/domains/memory/services/procedural-llm-extractor.js.map +1 -1
  156. package/node_modules/@memento/core/dist/domains/memory/tools/feedback-tool.d.ts.map +1 -1
  157. package/node_modules/@memento/core/dist/domains/memory/tools/feedback-tool.js +29 -0
  158. package/node_modules/@memento/core/dist/domains/memory/tools/feedback-tool.js.map +1 -1
  159. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-anchor-rotation.d.ts +17 -0
  160. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-anchor-rotation.d.ts.map +1 -0
  161. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-anchor-rotation.js +117 -0
  162. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-anchor-rotation.js.map +1 -0
  163. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-definition.d.ts +212 -0
  164. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-definition.d.ts.map +1 -0
  165. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-definition.js +201 -0
  166. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-definition.js.map +1 -0
  167. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-direct.d.ts +9 -0
  168. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-direct.d.ts.map +1 -0
  169. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-direct.js +88 -0
  170. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-direct.js.map +1 -0
  171. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-envelope.d.ts +36 -0
  172. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-envelope.d.ts.map +1 -0
  173. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-envelope.js +160 -0
  174. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-envelope.js.map +1 -0
  175. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-host.d.ts +13 -0
  176. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-host.d.ts.map +1 -0
  177. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-host.js +5 -0
  178. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-host.js.map +1 -0
  179. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-neighbors-fetch.d.ts +12 -0
  180. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-neighbors-fetch.d.ts.map +1 -0
  181. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-neighbors-fetch.js +101 -0
  182. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-neighbors-fetch.js.map +1 -0
  183. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.d.ts +50 -0
  184. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.d.ts.map +1 -0
  185. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.js +242 -0
  186. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.js.map +1 -0
  187. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-schema.d.ts +28 -28
  188. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-search-execution.d.ts +27 -0
  189. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-search-execution.d.ts.map +1 -0
  190. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-search-execution.js +79 -0
  191. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-search-execution.js.map +1 -0
  192. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool.d.ts +3 -69
  193. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool.d.ts.map +1 -1
  194. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool.js +22 -1078
  195. package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool.js.map +1 -1
  196. package/node_modules/@memento/core/dist/domains/monitoring/services/runtime-diagnostics-logger.d.ts +3 -1
  197. package/node_modules/@memento/core/dist/domains/monitoring/services/runtime-diagnostics-logger.d.ts.map +1 -1
  198. package/node_modules/@memento/core/dist/domains/monitoring/services/runtime-diagnostics-logger.js +9 -2
  199. package/node_modules/@memento/core/dist/domains/monitoring/services/runtime-diagnostics-logger.js.map +1 -1
  200. package/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-gemini.js +2 -2
  201. package/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-gemini.js.map +1 -1
  202. package/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-ollama.d.ts.map +1 -1
  203. package/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-ollama.js +2 -1
  204. package/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-ollama.js.map +1 -1
  205. package/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-openai.js +2 -2
  206. package/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-openai.js.map +1 -1
  207. package/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-providers.d.ts.map +1 -1
  208. package/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-providers.js +4 -3
  209. package/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extraction-llm-providers.js.map +1 -1
  210. package/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extractor.d.ts.map +1 -1
  211. package/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extractor.js +4 -3
  212. package/node_modules/@memento/core/dist/domains/relation/services/triple-extraction/triple-extractor.js.map +1 -1
  213. package/node_modules/@memento/core/dist/domains/search/repositories/vector-search.repository.d.ts +5 -0
  214. package/node_modules/@memento/core/dist/domains/search/repositories/vector-search.repository.d.ts.map +1 -1
  215. package/node_modules/@memento/core/dist/domains/search/repositories/vector-search.repository.js +26 -2
  216. package/node_modules/@memento/core/dist/domains/search/repositories/vector-search.repository.js.map +1 -1
  217. package/node_modules/@memento/core/dist/domains/telemetry/types/telemetry.types.d.ts +1 -1
  218. package/node_modules/@memento/core/dist/domains/telemetry/types/telemetry.types.d.ts.map +1 -1
  219. package/node_modules/@memento/core/dist/index.d.ts +20 -0
  220. package/node_modules/@memento/core/dist/index.d.ts.map +1 -1
  221. package/node_modules/@memento/core/dist/index.js +13 -0
  222. package/node_modules/@memento/core/dist/index.js.map +1 -1
  223. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/035-agent-integration-schema.d.ts +13 -0
  224. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/035-agent-integration-schema.d.ts.map +1 -0
  225. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/035-agent-integration-schema.js +131 -0
  226. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/035-agent-integration-schema.js.map +1 -0
  227. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/036-agent-memory-promotion-schema.d.ts +13 -0
  228. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/036-agent-memory-promotion-schema.d.ts.map +1 -0
  229. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/036-agent-memory-promotion-schema.js +74 -0
  230. package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/036-agent-memory-promotion-schema.js.map +1 -0
  231. package/node_modules/@memento/core/dist/infrastructure/database/repositories/sqlite-agent-integration-repository.d.ts +81 -0
  232. package/node_modules/@memento/core/dist/infrastructure/database/repositories/sqlite-agent-integration-repository.d.ts.map +1 -0
  233. package/node_modules/@memento/core/dist/infrastructure/database/repositories/sqlite-agent-integration-repository.js +627 -0
  234. package/node_modules/@memento/core/dist/infrastructure/database/repositories/sqlite-agent-integration-repository.js.map +1 -0
  235. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-job-execution-coordinator.d.ts.map +1 -1
  236. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-job-execution-coordinator.js +11 -3
  237. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-job-execution-coordinator.js.map +1 -1
  238. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-job-timeout-resolver.d.ts +10 -0
  239. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-job-timeout-resolver.d.ts.map +1 -0
  240. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-job-timeout-resolver.js +19 -0
  241. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-job-timeout-resolver.js.map +1 -0
  242. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-default-config.d.ts.map +1 -1
  243. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-default-config.js +2 -1
  244. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-default-config.js.map +1 -1
  245. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-types.d.ts +2 -0
  246. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-types.d.ts.map +1 -1
  247. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-validate-config.d.ts.map +1 -1
  248. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-validate-config.js +10 -0
  249. package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler-validate-config.js.map +1 -1
  250. package/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-consolidation-relation-handlers.d.ts.map +1 -1
  251. package/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-consolidation-relation-handlers.js +6 -2
  252. package/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-consolidation-relation-handlers.js.map +1 -1
  253. package/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.d.ts +3 -0
  254. package/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.d.ts.map +1 -1
  255. package/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.js +45 -6
  256. package/node_modules/@memento/core/dist/infrastructure/scheduler/relation-validator-executor.js.map +1 -1
  257. package/node_modules/@memento/core/dist/shared/config/environment.d.ts.map +1 -1
  258. package/node_modules/@memento/core/dist/shared/config/environment.js +1 -0
  259. package/node_modules/@memento/core/dist/shared/config/environment.js.map +1 -1
  260. package/node_modules/@memento/core/dist/shared/config/index.d.ts.map +1 -1
  261. package/node_modules/@memento/core/dist/shared/config/index.js +9 -0
  262. package/node_modules/@memento/core/dist/shared/config/index.js.map +1 -1
  263. package/node_modules/@memento/core/dist/shared/config/llm-model-resolver.d.ts +15 -0
  264. package/node_modules/@memento/core/dist/shared/config/llm-model-resolver.d.ts.map +1 -0
  265. package/node_modules/@memento/core/dist/shared/config/llm-model-resolver.js +39 -0
  266. package/node_modules/@memento/core/dist/shared/config/llm-model-resolver.js.map +1 -0
  267. package/node_modules/@memento/core/dist/shared/services/llm-client-initializer.d.ts.map +1 -1
  268. package/node_modules/@memento/core/dist/shared/services/llm-client-initializer.js +5 -4
  269. package/node_modules/@memento/core/dist/shared/services/llm-client-initializer.js.map +1 -1
  270. package/node_modules/@memento/core/dist/shared/types/index.d.ts +11 -0
  271. package/node_modules/@memento/core/dist/shared/types/index.d.ts.map +1 -1
  272. package/node_modules/@memento/core/dist/shared/utils/configuration-validator.d.ts +2 -2
  273. package/node_modules/@memento/core/dist/shared/utils/configuration-validator.d.ts.map +1 -1
  274. package/node_modules/@memento/core/dist/shared/utils/jsonl-rotation.d.ts +2 -0
  275. package/node_modules/@memento/core/dist/shared/utils/jsonl-rotation.d.ts.map +1 -0
  276. package/node_modules/@memento/core/dist/shared/utils/jsonl-rotation.js +43 -0
  277. package/node_modules/@memento/core/dist/shared/utils/jsonl-rotation.js.map +1 -0
  278. package/node_modules/@memento/core/dist/shared/utils/pii-masker.js +4 -4
  279. package/node_modules/@memento/core/dist/shared/utils/pii-masker.js.map +1 -1
  280. package/node_modules/@memento/core/dist/test/helpers/vector-search-quality-metrics.d.ts +1 -1
  281. package/node_modules/@memento/core/dist/test/helpers/vector-search-quality-metrics.d.ts.map +1 -1
  282. package/package.json +21 -5
  283. package/scripts/acquire-longmemeval.spec.ts +14 -0
  284. package/scripts/acquire-longmemeval.ts +75 -0
  285. package/scripts/agent-integration-release-gate.spec.ts +156 -0
  286. package/scripts/agent-integration-release-gate.ts +280 -0
  287. package/scripts/agent-memory-benchmark-adapter.spec.ts +155 -0
  288. package/scripts/agent-memory-benchmark-adapter.ts +523 -0
  289. package/scripts/agent-memory-benchmark.spec.ts +148 -0
  290. package/scripts/agent-memory-benchmark.ts +819 -0
  291. package/scripts/agent-smoke-matrix.spec.ts +178 -0
  292. package/scripts/agent-smoke-matrix.ts +776 -0
  293. package/scripts/collect-docker-diagnostics.sh +29 -0
  294. package/scripts/compare-weight-profiles.spec.ts +44 -0
  295. package/scripts/compare-weight-profiles.ts +70 -29
  296. package/scripts/generate-relation-report.ts +9 -6
  297. package/scripts/log-issue-monitor/__tests__/config.spec.ts +1 -0
  298. package/scripts/log-issue-monitor/__tests__/detectors.spec.ts +13 -0
  299. package/scripts/log-issue-monitor/__tests__/monitor.spec.ts +3 -2
  300. package/scripts/log-issue-monitor/__tests__/sanitizer.spec.ts +8 -0
  301. package/scripts/log-issue-monitor/__tests__/sources.spec.ts +47 -2
  302. package/scripts/log-issue-monitor/config.ts +1 -0
  303. package/scripts/log-issue-monitor/detectors.ts +28 -3
  304. package/scripts/log-issue-monitor/index.ts +3 -2
  305. package/scripts/log-issue-monitor/monitor.ts +31 -5
  306. package/scripts/log-issue-monitor/sources.ts +148 -7
  307. package/scripts/log-issue-monitor/types.ts +15 -1
  308. package/scripts/longmemeval-validation.spec.ts +111 -0
  309. package/scripts/longmemeval-validation.ts +299 -0
  310. package/scripts/slop-gate-scan.sh +14 -0
  311. package/scripts/tune-report.ts +142 -0
  312. package/scripts/tune-weights.ts +249 -0
  313. package/scripts/verify-doc-npm-scripts.mjs +3 -0
  314. package/scripts/verify-search-quality-benchmark-review.ts +1 -1
  315. package/scripts/weekly-relation-validation.ts +9 -6
package/README.en.md CHANGED
@@ -1,77 +1,56 @@
1
- # Memento MCP Server
1
+ # ๐Ÿง  Memento
2
2
 
3
3
  <div align="center">
4
4
  <img src="static/logo.png" alt="Memento Logo" width="200" height="200">
5
-
5
+
6
6
  [๐Ÿ‡ฐ๐Ÿ‡ท ํ•œ๊ตญ์–ด](README.md) | [๐Ÿ‡บ๐Ÿ‡ธ English](README.en.md)
7
7
  </div>
8
8
 
9
- AI Agent Memory Assistant MCP Server - Storage+Search+Summary+Forgetting mechanisms modeled after human memory structure
9
+ ---
10
10
 
11
- ## ๐ŸŽฏ Project Overview
11
+ LLMs forget everything when a conversation ends. Names, decisions, the debugging context you built together last week. This isn't a technical limitation โ€” it's the absence of **memory infrastructure**.
12
12
 
13
- Memento MCP Server is a Model Context Protocol (MCP) server that helps AI Agents store and manage long-term memory. It simulates human memory structure (working memory, episodic memory, semantic memory, procedural memory) to provide an efficient memory management system.
13
+ Memento is that infrastructure. Not a database that stores memories, but a **MCP-based memory operating system** where memories are created, classified, reinforced, and forgotten.
14
14
 
15
- ## โœจ Key Features
15
+ ## Memory Is Not Simple
16
16
 
17
- ### ๐Ÿง  Core Memory Management (MCP Client)
18
- - **Memory Storage**: Store 4 types of memories (working, episodic, semantic, procedural)
19
- - **Memory Search**: Hybrid search (text + vector)
20
- - **Memory Neighbors**: Vector similarity-based automatic recommendation of similar memories
21
- - **Memory Pinning**: Pin/unpin important memories
22
- - **Memory Deletion**: Soft/hard deletion
23
- - **Anchor System**: Set important memories as anchors for context management
24
- > **Note**: Anchor recovery, embedding migration, Episodic โ†’ Semantic conversion, and meta memory statistics are exposed through the HTTP Management API, not MCP tools.
17
+ Decades of psychology and neuroscience have established one thing clearly: human memory is not a single thing.
25
18
 
26
- ### ๐Ÿ” Advanced Search
27
- - **FTS5 Text Search**: SQLite's Full-Text Search
28
- - **Vector Search**: OpenAI embedding-based semantic search (falls back to lightweight embeddings when unavailable)
29
- - **Hybrid Search**: Combination of text and vector search
30
- - **Multi-provider Support**: TF-IDF, MiniLM, OpenAI, Gemini with automatic selection
31
- - **Lightweight Embedding**: TF-IDF + keyword matching fallback solution
32
- - **Tag-based Filtering**: Metadata-based search
19
+ **Working memory** holds what's being processed right now. It vanishes in seconds, but in those seconds it's the foundation of every decision. **Episodic memory** is the trace of experience โ€” "that afternoon I first learned React Hooks" โ€” memory with time and context attached. **Semantic memory** is knowledge distilled from experience: the understanding that "TypeScript generics work like this," accumulated through hundreds of debugging sessions. And **procedural memory** is the ingrained routine โ€” Docker deployment steps, PR checklists, team coding conventions.
33
20
 
34
- ### ๐Ÿงน Forgetting Policy
35
- - **Forgetting Algorithm**: Forgetting score calculation based on recency, usage, duplication ratio
36
- - **Spaced Repetition**: Review scheduling based on importance and usage
37
- - **TTL Management**: Type-specific lifespan management
38
- - **Auto Cleanup**: Automated soft/hard deletion
21
+ Most LLMs lose all four with every conversation. Memento persists all four โ€” specify `type: working`, `episodic`, `semantic`, or `procedural` in the `remember` call and the right memory structure handles the rest.
39
22
 
40
- ### ๐Ÿ“Š Performance Monitoring (HTTP Management API)
41
- - **Security**: HTTP server splits browser-session and header-based trust. `/auth/session` starts the cookie-backed browser flow; `/admin` and `/api` require a browser session; `/api/v1/quality`, `/tools`, and `/mcp` require `Authorization: Bearer` or `X-API-Key`. See [docs/reference/en/security.md](docs/reference/en/security.md).
42
- - **Real-time Metrics**: Database, search, memory performance monitoring
43
- - **Real-time Alerts**: Automatic performance checks every 30 seconds with threshold-based alerts
44
- - **Error Logging**: Structured error logging and statistics collection
45
- - **Database Optimization**: Automatic index recommendation and creation
46
- - **Cache System**: LRU + TTL based caching
47
- - **Async Processing**: Worker pool based parallel processing
23
+ ## Living Memory
48
24
 
49
- ### ๐Ÿ”— Memory Graph View (Browser)
25
+ This is not a simple storage layer. Memory in Memento is alive.
50
26
 
51
- After starting the HTTP server, you can visualize semantic relationships between memories as an interactive graph in your browser. `/dashboard` is the preferred entry point for the full admin flow, and opening `/graph` directly now offers the same `/auth/session` re-auth path so signed-out users can recover the session in place.
27
+ Memories that matter get reinforced. Memories that grow stale get cleaned up by the forgetting algorithm. Similar memories connect to each other through vector similarity, forming a graph. Repeated procedures are version-controlled โ€” `procedural_diff` and `procedural_rollback` let you track how a workflow evolves. Critical context gets pinned as an anchor, so the next conversation starts with that context already loaded.
52
28
 
53
- ```
54
- http://localhost:9001/dashboard
55
- http://localhost:9001/graph
56
- ```
29
+ The goal is not to make AI "pretend to remember." It's to make AI an **agent that creates, classifies, reinforces, and forgets** โ€” just like memory actually works.
57
30
 
58
- ![Memento Memory Graph View](docs/graph-screenshot.png)
31
+ ### ๐Ÿ“ฆ Monorepo Structure
59
32
 
60
- ## ๐Ÿ”— Use Memento with External AI Assistants
33
+ This repository is an **npm workspaces** monorepo.
61
34
 
62
- Personal AI assistants like OpenClaw, NanoClaw, and ZeroClaw can use Memento as a shared long-term memory backend. Guide: [docs/integrations/](./docs/integrations/README.md)
35
+ | Path | Description |
36
+ |------|-------------|
37
+ | **packages/memento-core** (`@memento/core`) | Domain, infrastructure, and shared library. Entry points: `createMementoCore`, `createToolContext`, `getToolRegistry`, `closeDatabase`. DB init and migration run from the root via `npm run db:init` / `npm run db:migrate`. |
38
+ | **packages/memento-server** | MCP/HTTP server built on core. Run via root `npm run dev`, `npm start`, `npm run dev:http`, etc. |
39
+ | **packages/memento-client** (`@memento/client`) | Client library for connecting to the server. |
40
+ | **apps/** | Experimental apps (e.g., `experimental-example` uses `@memento/core` in-process). |
63
41
 
64
- Use the `@memento/assistant` SDK for deterministic auto recall/remember with just two hooks โ€” [SDK quickstart](./docs/integrations/_shared/sdk-quickstart.md)
42
+ For detailed structure, build, and test commands, see [AGENTS.md](AGENTS.md).
65
43
 
66
44
  ## ๐Ÿš€ Quick Start
67
45
 
68
- ### ๐Ÿฅ‡ **One-click Installation (Recommended)**
46
+ > **๐Ÿ“ฆ Package manager**: This project uses **npm**. `pnpm` and `yarn` are not supported.
47
+
48
+ ### One-click Installation (Recommended)
69
49
  ```bash
70
- # Run automatic installation script
71
50
  curl -sSL https://raw.githubusercontent.com/jee1/memento/main/install.sh | bash
72
51
  ```
73
52
 
74
- ### ๐Ÿฅˆ **npx Method (For Developers)**
53
+ ### npx Method (For Developers)
75
54
  ```bash
76
55
  # Run immediately (without installation)
77
56
  npx memento-mcp-server@latest dev
@@ -81,31 +60,101 @@ npx memento-mcp-server@latest setup
81
60
  npx memento-mcp-server@latest start
82
61
  ```
83
62
 
84
- ### ๐Ÿฅ‰ **Docker Method (For Production)**
85
- ```bash
86
- # Development environment
87
- docker-compose -f docker-compose.dev.yml up -d
63
+ **Repeated use**: Running via npx each time triggers a download. For frequent use, prefer **global install** (`npm i -g memento-mcp-server`) or local install with `./node_modules/.bin/memento`. Mode breakdown: MCP server (`memento-mcp-server` / stdio), HTTP server (`memento-dev`), CLI (`memento` โ€” recall, remember, forget, memory_injection). CLI guide: [docs/guides/ko/memento-cli-for-ai.md](docs/guides/ko/memento-cli-for-ai.md).
88
64
 
89
- # Production environment
90
- docker-compose -f docker-compose.prod.yml up -d
65
+ ### Docker Method (For Production)
66
+ ```bash
67
+ docker-compose -f docker-compose.dev.yml up -d # Development
68
+ docker-compose -f docker-compose.prod.yml up -d # Production
91
69
  ```
92
70
 
93
- ### ๐Ÿ› ๏ธ **Source Code Method (For Developers)**
71
+ ### Source Code Method (For Developers)
94
72
  ```bash
95
- # Clone repository
96
73
  git clone https://github.com/jee1/memento.git
97
74
  cd memento
98
-
99
- # One-click installation and run
100
75
  npm run quick-start
101
76
  ```
102
77
 
103
- ### ๐Ÿ“š **Detailed Installation Guide**
104
78
  For detailed installation methods, see [INSTALL.en.md](INSTALL.en.md).
105
79
 
80
+ ### HTTP MCP Server for Multi-Agent Deployments
81
+
82
+ SQLite only allows one writer at a time, even in WAL mode. Multiple AI agents calling `remember`/`forget` in separate processes will hit `SQLITE_BUSY`. The solution: **run a single MCP server process** that owns the database exclusively.
83
+
84
+ ```bash
85
+ npm run dev:http # Development (hot reload)
86
+ npm run build && npm run start:http # Production
87
+ ```
88
+
89
+ With this setup, all agents connect to one HTTP/WebSocket interface, and the SQLite writer stays in a single process.
90
+
91
+ ## ๐Ÿ”— Use with External AI Assistants
92
+
93
+ Personal AI assistants like OpenClaw, NanoClaw, and ZeroClaw can use Memento as a shared long-term memory backend. Guide: [docs/integrations/](./docs/integrations/README.md)
94
+
95
+ Use the `@memento/assistant` SDK for automatic recall/remember in two lines of code โ€” [SDK quickstart](./docs/integrations/_shared/sdk-quickstart.md)
96
+
106
97
  ## ๐Ÿ› ๏ธ Usage
107
98
 
108
- ### MCP Client Connection
99
+ Three ways to connect to Memento:
100
+
101
+ - **mcp.json config**: Register Memento in MCP host apps like Claude Desktop, Cursor, or Claude Code โ€” no code required
102
+ - **MCP protocol** (`@modelcontextprotocol/sdk`): Connect directly from custom agent code
103
+ - **HTTP API client** (`@memento/client`): Call Memento's REST API from TypeScript/JavaScript applications
104
+
105
+ ### mcp.json Config (Claude Desktop ยท Cursor ยท Claude Code)
106
+
107
+ #### stdio mode (single agent)
108
+
109
+ After `npm run build`:
110
+
111
+ ```json
112
+ {
113
+ "mcpServers": {
114
+ "memento": {
115
+ "command": "node",
116
+ "args": ["/path/to/memento/packages/memento-server/dist/server/index.js"],
117
+ "env": {
118
+ "DB_PATH": "/absolute/path/to/data/memory.db"
119
+ }
120
+ }
121
+ }
122
+ }
123
+ ```
124
+
125
+ #### HTTP MCP mode (shared multi-agent server)
126
+
127
+ ```bash
128
+ npm run build && npm run start:http # default port: 8080
129
+ ```
130
+
131
+ ```json
132
+ {
133
+ "mcpServers": {
134
+ "memento": {
135
+ "type": "http",
136
+ "url": "http://127.0.0.1:8080/mcp"
137
+ }
138
+ }
139
+ }
140
+ ```
141
+
142
+ > **Using npx** (without building from source):
143
+ > ```json
144
+ > {
145
+ > "mcpServers": {
146
+ > "memento": {
147
+ > "command": "npx",
148
+ > "args": ["memento-mcp-server@latest"],
149
+ > "env": {
150
+ > "DB_PATH": "/absolute/path/to/data/memory.db"
151
+ > }
152
+ > }
153
+ > }
154
+ > }
155
+ > ```
156
+
157
+ ### MCP Protocol (`@modelcontextprotocol/sdk`)
109
158
 
110
159
  ```typescript
111
160
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
@@ -114,61 +163,136 @@ const client = new Client({
114
163
  name: "memento-client",
115
164
  version: "0.1.0"
116
165
  }, {
117
- capabilities: {
118
- tools: {},
119
- resources: {},
120
- prompts: {}
121
- }
166
+ capabilities: { tools: {}, resources: {}, prompts: {} }
122
167
  });
123
168
 
124
169
  // stdio connection
125
170
  await client.connect({
126
171
  command: "node",
127
- args: ["dist/server/index.js"]
172
+ args: ["packages/memento-server/dist/server/index.js"]
128
173
  });
129
174
 
130
- // WebSocket connection
175
+ // HTTP MCP connection (shared multi-agent server)
131
176
  await client.connect({
132
177
  transport: {
133
- type: "websocket",
134
- url: "ws://localhost:8080/mcp"
178
+ type: "http",
179
+ url: "http://127.0.0.1:7777"
135
180
  }
136
181
  });
137
182
  ```
138
183
 
139
- ### Memory Storage
140
-
141
184
  ```typescript
142
185
  // Store memory
143
- const result = await client.callTool({
186
+ await client.callTool({
144
187
  name: "remember",
145
188
  arguments: {
146
- content: "I learned about React Hooks. useState manages state and useEffect handles side effects.",
189
+ content: "I learned about React Hooks. useState manages state, useEffect handles side effects.",
147
190
  type: "episodic",
148
191
  tags: ["react", "hooks", "javascript"],
149
192
  importance: 0.8
150
193
  }
151
194
  });
152
- ```
153
-
154
- ### Memory Search
155
195
 
156
- ```typescript
157
196
  // Search memory
158
197
  const results = await client.callTool({
159
198
  name: "recall",
160
199
  arguments: {
161
- query: "React Hook",
162
- filters: {
163
- type: ["episodic", "semantic"],
164
- tags: ["react"]
165
- },
200
+ query: "What do I need to know about React Hooks?",
201
+ filters: { type: ["episodic", "semantic"], tags: ["react"] },
166
202
  limit: 10
167
203
  }
168
204
  });
169
205
  ```
170
206
 
171
- ## ๐Ÿ“‹ API Documentation
207
+ ### HTTP API Client (`@memento/client`)
208
+
209
+ `@memento/client` is an **HTTP REST API wrapper**, not an MCP client. Use it to call Memento's `/tools/*` endpoints directly from TypeScript/JavaScript applications.
210
+
211
+ ```typescript
212
+ import { MementoClient } from "@memento/client";
213
+
214
+ const client = new MementoClient({
215
+ serverUrl: "http://localhost:8080",
216
+ apiKey: "your-api-key"
217
+ });
218
+
219
+ await client.connect(); // health check
220
+
221
+ const result = await client.remember({
222
+ content: "I learned about React Hooks.",
223
+ type: "episodic",
224
+ tags: ["react", "hooks"],
225
+ importance: 0.8
226
+ });
227
+
228
+ const results = await client.recall(
229
+ "What should I know when first learning React Hooks?",
230
+ { type: ["episodic", "semantic"], tags: ["react"] },
231
+ 10
232
+ );
233
+
234
+ await client.pin(result.memory_id);
235
+ await client.forget(result.memory_id);
236
+ ```
237
+
238
+ ## ๐Ÿง  Features
239
+
240
+ ### Core Memory Management (MCP Client)
241
+
242
+ 14 tools are exposed via MCP. Operational functions (anchor restore, embedding migration, episodicโ†’semantic conversion, meta stats) are HTTP API only.
243
+
244
+ - **Memory storage**: `working`, `episodic`, `semantic`, `procedural` types
245
+ - **Memory search**: Hybrid search (FTS5 text + vector)
246
+ - **Memory neighbors**: Vector similarity-based automatic recommendation
247
+ - **Memory pinning**: Pin/unpin important memories
248
+ - **Memory deletion**: Soft/hard deletion
249
+ - **Anchor system**: Pin critical memories as anchors for instant context restoration in new conversations
250
+
251
+ > **Note**: Anchor recovery, embedding migration, Episodic โ†’ Semantic conversion, and meta memory statistics are exposed through the HTTP Management API, not MCP tools.
252
+
253
+ ### ๐Ÿ” Hybrid Search
254
+
255
+ Text and semantic (vector) search combined. Even when you don't remember the exact keyword, similar concepts surface.
256
+
257
+ - **FTS5 text search**: SQLite Full-Text Search
258
+ - **Vector search**: sqlite-vec semantic similarity search
259
+ - **Hybrid search**: Combined scoring (Consolidation Score weighting)
260
+ - **Multi-provider support**: TF-IDF, MiniLM, OpenAI, Gemini with automatic selection
261
+ - **Auto fallback**: If a provider fails, automatically switches to the next
262
+ - **Tag-based filtering**: Metadata-based search
263
+
264
+ ### ๐Ÿงน Forgetting Policy
265
+
266
+ A memory system is only useful if it also forgets. Memories that only accumulate become noise.
267
+
268
+ - **Forgetting algorithm**: Score based on recency, usage frequency, and duplication ratio
269
+ - **Spaced repetition**: Review scheduling based on importance and usage
270
+ - **TTL management**: Type-specific lifespans (working 2d, episodic 30d, semantic 180d, procedural 90d)
271
+ - **Auto cleanup**: Automated soft/hard deletion
272
+
273
+ ### ๐Ÿ“Š Performance Monitoring (HTTP Management API)
274
+
275
+ - **Security**: HTTP server splits browser-session and header-based trust. `/auth/session` starts the cookie-backed browser flow; `/admin` and `/api` require a browser session; `/api/v1/quality`, `/tools`, and `/mcp` require `Authorization: Bearer` or `X-API-Key`. See [docs/reference/en/security.md](docs/reference/en/security.md).
276
+
277
+ - **Real-time metrics**: Database, search, memory performance monitoring
278
+ - **Real-time alerts**: Automatic performance checks every 30 seconds with threshold-based alerts
279
+ - **Error logging**: Structured error logging and statistics collection
280
+ - **Database optimization**: Automatic index recommendation and creation
281
+ - **Cache system**: LRU + TTL based caching
282
+ - **Async processing**: Worker pool based parallel processing
283
+
284
+ ### ๐Ÿ”— Memory Graph View (Browser)
285
+
286
+ After starting the HTTP server, visualize semantic relationships between memories as an interactive graph. `/dashboard` is the preferred entry point for the full admin flow; opening `/graph` directly now offers the same `/auth/session` re-auth path for session recovery.
287
+
288
+ ```
289
+ http://localhost:9001/dashboard
290
+ http://localhost:9001/graph
291
+ ```
292
+
293
+ ![Memento Memory Graph View](docs/graph-screenshot.png)
294
+
295
+ ## ๐Ÿ“‹ API Reference
172
296
 
173
297
  ### MCP Tools (Core 14)
174
298
 
@@ -200,15 +324,17 @@ const results = await client.callTool({
200
324
  | `procedural_diff` | Compare procedural memory versions | left_id, right_id |
201
325
  | `procedural_rollback` | Roll back procedural memory to a previous version | current_id, target_version_id |
202
326
 
203
- **HTTP-only (not MCP)**: `restore_anchors`, `migrate_embeddings`, `convert_episodic_to_semantic`, `get_meta_memory_stats` - see the HTTP Management API below.
327
+ **HTTP-only (not MCP)**: `restore_anchors`, `migrate_embeddings`, `convert_episodic_to_semantic`, `get_meta_memory_stats` โ€” see HTTP Management API below.
204
328
 
205
329
  ### HTTP Management API
206
330
 
331
+ > **Important**: The following functions are not exposed via MCP and are only available through the HTTP API.
332
+
207
333
  | Endpoint | Description | Method |
208
334
  |----------|-------------|--------|
209
335
  | `/admin/memory/cleanup` | Memory cleanup | POST |
210
336
  | `/admin/memory/review-candidates` | Memory review candidate queue | GET |
211
- | `/admin/memory/items/:memory_id` | Single memory JSON preview (dashboard, etc.) | GET |
337
+ | `/admin/memory/items/:memory_id` | Single memory JSON preview | GET |
212
338
  | `/admin/memory/review-candidates/:id/review` | Mark review candidate as reviewed | POST |
213
339
  | `/admin/memory/review-candidates/:id/dismiss` | Dismiss review candidate | POST |
214
340
  | `/admin/stats/forgetting` | Forgetting statistics | GET |
@@ -217,8 +343,10 @@ const results = await client.callTool({
217
343
  | `/admin/errors/resolve` | Resolve errors | POST |
218
344
  | `/admin/alerts/performance` | Performance alerts | GET |
219
345
  | `/admin/database/optimize` | Database optimization | POST |
346
+ | `/admin/anchors/restore` | Restore anchors | POST |
347
+ | `/admin/embeddings/migrate` | Embedding migration | POST |
220
348
 
221
- **Other HTTP admin**: Batch status/run (`/admin/batch/*`, including `jobType` `memory_review_candidates`), performance metrics/alerts (`/admin/performance/*`), relation extract/get/visualize (`/admin/relations/*`). See [docs/api/en/api-reference.md](docs/api/en/api-reference.md). For the memory review MVP (endpoints, env, batch), use the **"Memory review candidates (MVP)"** section there.
349
+ **Other HTTP admin**: Batch status/run (`/admin/batch/*`, including `memory_review_candidates`), performance metrics/alerts (`/admin/performance/*`), relation extract/get/visualize (`/admin/relations/*`). See [docs/api/en/api-reference.md](docs/api/en/api-reference.md).
222
350
 
223
351
  ### Resources
224
352
 
@@ -241,10 +369,10 @@ const results = await client.callTool({
241
369
  | `GEMINI_API_KEY` | - | Gemini API key (optional) |
242
370
  | `EMBEDDING_PROVIDER` | minilm | Embedding provider (tfidf, lightweight, minilm, openai, gemini) |
243
371
  | `CORS_ALLOWED_ORIGINS` | (empty) | CORS allowed origins (comma-separated; empty = no cross-origin) |
244
- | `ENABLE_PII_MASKING` | true | PII masking (security; see [docs/reference/en/security.md](docs/reference/en/security.md)) |
245
- | `MEMORY_REVIEW_IMPORTANCE_THRESHOLD` | `0.7` | Memory review: minimum importance (0-1). Details in [docs/api/en/api-reference.md](docs/api/en/api-reference.md) ("Memory review candidates (MVP)") |
372
+ | `ENABLE_PII_MASKING` | true | PII masking (see [docs/reference/en/security.md](docs/reference/en/security.md)) |
373
+ | `MEMORY_REVIEW_IMPORTANCE_THRESHOLD` | `0.7` | Memory review: minimum importance (0-1) |
246
374
  | `MEMORY_REVIEW_STALE_DAYS` | `14` | Memory review: minimum stale age in days (integer โ‰ฅ 1) |
247
- | `MEMORY_REVIEW_MAX_CANDIDATES` | `50` | Memory review: max candidates from selection (integer โ‰ฅ 1) |
375
+ | `MEMORY_REVIEW_MAX_CANDIDATES` | `50` | Memory review: max candidates (integer โ‰ฅ 1) |
248
376
  | `MEMORY_REVIEW_CANDIDATES_INTERVAL_MS` | `86400000` | `memory_review_candidates` batch interval in ms (minimum `60000`) |
249
377
  | `MEMORY_REVIEW_CANDIDATE_DUE_DAYS` | `14` | Days added when the batch computes `due_at` (1โ€“366) |
250
378
 
@@ -253,12 +381,10 @@ const results = await client.callTool({
253
381
  ### Forgetting Policy Configuration
254
382
 
255
383
  ```bash
256
- # Forgetting thresholds
257
384
  FORGET_THRESHOLD=0.6
258
385
  SOFT_DELETE_THRESHOLD=0.6
259
386
  HARD_DELETE_THRESHOLD=0.8
260
387
 
261
- # TTL settings (in days)
262
388
  TTL_SOFT_WORKING=2
263
389
  TTL_SOFT_EPISODIC=30
264
390
  TTL_SOFT_SEMANTIC=180
@@ -268,108 +394,64 @@ TTL_SOFT_PROCEDURAL=90
268
394
  ## ๐Ÿงช Testing
269
395
 
270
396
  ```bash
271
- # Run all tests (Vitest)
272
397
  npm run test
273
398
 
274
- # Run individual tests
275
- npm run test:client # Client tests
276
- npm run test:search # Search functionality tests
277
- npm run test:embedding # Embedding functionality tests
278
- npm run test:lightweight-embedding # Lightweight embedding tests
279
- npm run test:gemini-embedding # Gemini embedding tests
280
- npm run test:forgetting # Forgetting policy tests
281
- npm run test:performance # Performance benchmarks
282
- npm run test:monitoring # Performance monitoring tests
283
- npm run test:error-logging # Error logging tests
284
- npm run test:performance-alerts # Performance alert tests
285
- npm run test:vector-search # Vector search tests
286
- npm run test:memory-injection # Memory injection tests
287
- npm run test:batch-scheduler # Batch scheduler tests
288
- npm run test:embedding-benchmark # Embedding performance benchmark
289
- npm run test:all-embedding # All embedding-related Vitest files
290
-
291
- # Test watch mode
292
- npm run test -- --watch
399
+ npm run test:client
400
+ npm run test:search
401
+ npm run test:embedding
402
+ npm run test:lightweight-embedding
403
+ npm run test:gemini-embedding
404
+ npm run test:forgetting
405
+ npm run test:performance
406
+ npm run test:monitoring
407
+ npm run test:error-logging
408
+ npm run test:performance-alerts
409
+ npm run test:vector-search
410
+ npm run test:memory-injection
411
+ npm run test:batch-scheduler
412
+ npm run test:embedding-benchmark
293
413
 
294
- # Tests with coverage
414
+ npm run test -- --watch
295
415
  npm run test -- --coverage
296
416
  ```
297
417
 
298
418
  ## ๐Ÿ“š Developer Guidelines
299
419
 
300
- ### Repository Guidelines (`AGENTS.md`)
301
- - **Project Structure**: npm workspaces โ€” code lives under `packages/memento-core`, `packages/memento-server`, `packages/memento-client`, plus `apps/` and root-level `tests/`. See [AGENTS.md](AGENTS.md).
302
- - **Build/Test Commands**: `npm run dev`, `npm run build`, `npm run test`, etc.
303
- - **Coding Style**: Node.js โ‰ฅ 24, TypeScript ES modules, 2-space indentation
304
- - **Testing Guidelines**: Vitest; colocate `*.spec.ts` under each package `src/`, workspace-level specs under root `tests/`, and scenario drivers under `packages/*/src/test/` where applicable.
305
- - **Commit/PR Guidelines**: Conventional Commits, Korean context included
306
- - **Environment/Database**: `.env` configuration, `data/` folder management
307
-
308
- ## ๐Ÿ“Š Performance Metrics
309
-
310
- ### Basic Performance
311
- - **Database Performance**: Average query time 0.16-0.22ms
312
- - **Search Performance**: 0.78-4.24ms (improved with cache effects)
313
- - **Memory Usage**: 11-15MB heap usage
314
- - **Concurrent Connections**: Supports up to 1000 connections
315
-
316
- ### Advanced Performance Optimization
317
- - **Cache Hit Rate**: 80%+ (search result caching)
318
- - **Embedding Caching**: 24-hour TTL for cost savings
319
- - **Async Processing**: Worker pool based parallel processing
320
- - **Database Optimization**: Automatic index recommendation and creation
321
- - **Real-time Monitoring**: Automatic performance checks every 30 seconds
322
- - **Error Logging**: Structured error tracking and statistics
323
- - **Performance Alerts**: Threshold-based automatic alert system
324
-
325
- ### Embedding Provider Performance
420
+ - **Project structure**: npm workspaces โ€” `packages/memento-core`, `packages/memento-server`, `packages/memento-client`, `apps/*`. See [AGENTS.md](AGENTS.md).
421
+ - **Build/test**: `npm run dev`, `npm run build`, `npm run test`, etc.
422
+ - **Coding style**: Node.js โ‰ฅ 24, TypeScript ES modules, 2-space indentation
423
+ - **Testing**: Vitest; colocate `*.spec.ts` under each package `src/`, workspace-level specs under root `tests/`
424
+ - **Commit/PR**: Conventional Commits, Korean context included
425
+
426
+ ## ๐Ÿ“Š Performance
427
+
428
+ ### Benchmarks
429
+ - **Database**: average query time 0.16โ€“0.22ms
430
+ - **Search**: 0.78โ€“4.24ms (improved with cache effects)
431
+ - **Memory usage**: 11โ€“15MB heap
432
+ - **Concurrent connections**: up to 1000
433
+
434
+ ### Embedding Provider Comparison
326
435
 
327
436
  #### Free Providers (Local Processing)
328
- - **TF-IDF**: 512 dimensions, extremely fast (0.82ms), low memory usage (4.48MB)
329
- - **MiniLM**: 384 dimensions, balanced performance, multilingual support
437
+ - **TF-IDF**: 512 dimensions, extremely fast (0.82ms), low memory (4.48MB)
438
+ - **MiniLM**: 384 dimensions, balanced performance, multilingual
330
439
 
331
440
  #### Paid Providers (Cloud API)
332
- - **OpenAI**: 1536 dimensions, highest performance, high accuracy
333
- - **Gemini**: 768 dimensions, high performance, multilingual support
334
-
335
- **Auto Selection and Priority Order**:
336
- 1. **Explicit Request**: If a specific provider is requested in API call, it takes priority
337
- 2. **Configuration Default**: Uses `EMBEDDING_PROVIDER` value from `.env` file
338
- 3. **Automatic Priority Selection**: Automatically selects available providers in the following order:
339
- - 1st Priority: **OpenAI** (paid, highest performance)
340
- - 2nd Priority: **Gemini** (paid, high performance)
341
- - 3rd Priority: **MiniLM** (free, balanced performance)
342
- - 4th Priority: **TF-IDF** (free, fast speed)
343
-
344
- **Fallback Mechanism**: Automatically falls back to the next priority provider if a higher priority provider fails.
345
-
346
- ## ๐Ÿ—๏ธ Architecture
347
-
348
- ### M1: Personal Use (Current Implementation)
349
- - **Storage**: better-sqlite3 embedded
350
- - **Index**: FTS5 + sqlite-vec
351
- - **Authentication**: Split browser-session and header-based trust model (`/auth/session` starts the cookie-backed browser flow; `/admin` and `/api` require a browser session; `/api/v1/quality`, `/tools`, and `/mcp` require `Authorization: Bearer` or `X-API-Key`)
352
- - **Operation**: Local execution
353
- - **MCP Client**: Exposes 14 core tools
354
- - **Management Functions**: Separated into HTTP API
355
- - **Additional Features**:
356
- - Multiple embedding providers (TF-IDF, MiniLM, OpenAI, Gemini)
357
- - Performance monitoring and alert system
358
- - Cache system
359
- - Anchor system (context management)
360
- - Relation graph (semantic relation extraction)
361
- - Meta memory statistics
362
- - Consolidation score system
363
-
364
- ### M2: Team Collaboration (Planned)
365
- - **Storage**: SQLite server mode
366
- - **Authentication**: API Key
367
- - **Operation**: Docker single container
368
-
369
- ### M3: Organization Entry (Planned)
370
- - **Storage**: PostgreSQL + pgvector
371
- - **Authentication**: JWT
372
- - **Operation**: Docker Compose
441
+ - **OpenAI**: 1536 dimensions, highest accuracy
442
+ - **Gemini**: 768 dimensions, high performance, multilingual
443
+
444
+ **Auto selection order**: explicit request โ†’ `.env` `EMBEDDING_PROVIDER` โ†’ OpenAI(1) โ†’ Gemini(2) โ†’ MiniLM(3) โ†’ TF-IDF(4). Automatic fallback on provider failure.
445
+
446
+ ## ๐Ÿ—๏ธ Architecture Journey
447
+
448
+ Memento is designed to grow: from a personal local server, through team collaboration, to an organization-scale memory platform.
449
+
450
+ **M1: Personal (current)** โ€” the form you can use today. SQLite embedded, FTS5 + sqlite-vec indexes, local execution. **Authentication**: Split browser-session and header-based trust model (`/auth/session` cookie flow, `/admin`ยท`/api` require browser session, `/tools`ยท`/mcp` require Bearer/API-Key). 14 MCP tools, management functions separated into HTTP API.
451
+
452
+ **M2: Team (planned)** โ€” SQLite server mode, API Key auth, Docker single container. Multiple teammates share one memory backend.
453
+
454
+ **M3: Organization (planned)** โ€” PostgreSQL + pgvector, JWT auth, Docker Compose. Hundreds of agents share organizational memory.
373
455
 
374
456
  ## ๐Ÿค Contributing
375
457
 
@@ -379,25 +461,18 @@ npm run test -- --coverage
379
461
  4. Push to the Branch (`git push origin feature/AmazingFeature`)
380
462
  5. Open a Pull Request
381
463
 
382
- ### Development Environment Setup
464
+ ### Development Setup
383
465
  ```bash
384
- # Fork and clone repository
385
466
  git clone https://github.com/your-username/memento.git
386
467
  cd memento
387
-
388
- # Install dependencies
389
468
  npm install
390
-
391
- # Start development server
392
469
  npm run dev
393
-
394
- # Run tests
395
470
  npm run test
396
471
  ```
397
472
 
398
473
  ## ๐Ÿ“„ License
399
474
 
400
- This project is distributed under the MIT License. See the `LICENSE` file for details.
475
+ MIT License. See the `LICENSE` file for details.
401
476
 
402
477
  ## ๐Ÿ“ž Support
403
478
 
@@ -408,9 +483,9 @@ This project is distributed under the MIT License. See the `LICENSE` file for de
408
483
 
409
484
  ## ๐Ÿ™ Acknowledgments
410
485
 
411
- - [Model Context Protocol](https://modelcontextprotocol.io/) - MCP Protocol
412
- - [OpenAI](https://openai.com/) - Embedding Service
413
- - [better-sqlite3](https://github.com/WiseLibs/better-sqlite3) - High-performance SQLite driver
414
- - [Express](https://expressjs.com/) - Web framework
415
- - [Vitest](https://vitest.dev/) - Testing framework
416
- - [TypeScript](https://www.typescriptlang.org/) - Development language
486
+ - [Model Context Protocol](https://modelcontextprotocol.io/)
487
+ - [OpenAI](https://openai.com/)
488
+ - [better-sqlite3](https://github.com/WiseLibs/better-sqlite3)
489
+ - [Express](https://expressjs.com/)
490
+ - [Vitest](https://vitest.dev/)
491
+ - [TypeScript](https://www.typescriptlang.org/)