claude-memory-layer 1.0.30 → 1.0.32

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 (338) hide show
  1. package/README.md +12 -5
  2. package/dist/cli/index.js +4 -3
  3. package/dist/cli/index.js.map +2 -2
  4. package/dist/core/index.js +3 -2
  5. package/dist/core/index.js.map +2 -2
  6. package/dist/hooks/post-tool-use.js +3 -2
  7. package/dist/hooks/post-tool-use.js.map +2 -2
  8. package/dist/hooks/semantic-daemon.js +3 -2
  9. package/dist/hooks/semantic-daemon.js.map +2 -2
  10. package/dist/hooks/session-end.js +3 -2
  11. package/dist/hooks/session-end.js.map +2 -2
  12. package/dist/hooks/session-start.js +3 -2
  13. package/dist/hooks/session-start.js.map +2 -2
  14. package/dist/hooks/stop.js +3 -2
  15. package/dist/hooks/stop.js.map +2 -2
  16. package/dist/hooks/user-prompt-submit.js +3 -2
  17. package/dist/hooks/user-prompt-submit.js.map +2 -2
  18. package/dist/index.js +3 -2
  19. package/dist/index.js.map +2 -2
  20. package/dist/mcp/index.js +3 -2
  21. package/dist/mcp/index.js.map +2 -2
  22. package/dist/server/api/index.js +3 -2
  23. package/dist/server/api/index.js.map +2 -2
  24. package/dist/server/index.js +3 -2
  25. package/dist/server/index.js.map +2 -2
  26. package/dist/services/memory-service.js +3 -2
  27. package/dist/services/memory-service.js.map +2 -2
  28. package/package.json +10 -3
  29. package/scripts/postinstall-embedding-backend.cjs +18 -16
  30. package/AGENTS.md +0 -71
  31. package/CLAUDE.md +0 -30
  32. package/HANDOFF.md +0 -92
  33. package/Memo.txt +0 -558
  34. package/benchmarks/replay/anonymized-real-sessions.json +0 -48
  35. package/config/kpi-thresholds.json +0 -7
  36. package/context.md +0 -636
  37. package/docs/ARCHITECTURE_COMPARISON_AND_RECOMMENDATIONS.md +0 -627
  38. package/docs/HERMES_MEMORY_INGESTION_ANALYSIS.md +0 -440
  39. package/docs/MCP_MEMORY_SERVICE_COMPARATIVE_REVIEW.md +0 -271
  40. package/docs/MEMORY_USEFULNESS_AUDIT.md +0 -371
  41. package/docs/MEMORY_USEFULNESS_AUDIT_RAW.json +0 -80
  42. package/docs/MEMSEARCH_PROJECT_STRUCTURE_ANALYSIS.md +0 -333
  43. package/docs/MEMU_ADOPTION.md +0 -40
  44. package/docs/OPERATIONS.md +0 -18
  45. package/docs/PRODUCT_VALIDATION_MATRIX.md +0 -82
  46. package/docs/PROJECT_STRUCTURE_ANALYSIS.md +0 -421
  47. package/docs/REFACTORING_MILESTONES_AND_ISSUES.md +0 -501
  48. package/docs/REFACTORING_PLAN_THIN_CORE.md +0 -414
  49. package/docs/REFERENCE_PROJECT_ANALYSES.md +0 -25
  50. package/docs/SUPERLOCALMEMORY_PROJECT_STRUCTURE_ANALYSIS.md +0 -452
  51. package/docs/TARGET_ARCHITECTURE_AND_FOLDER_STRUCTURE.md +0 -446
  52. package/docs/architecture/comparison-index.md +0 -47
  53. package/docs/reports/codex-real-data-validation-20260505T040447Z.md +0 -46
  54. package/plan.md +0 -1642
  55. package/scripts/build.ts +0 -159
  56. package/scripts/bump-patch-version.sh +0 -18
  57. package/scripts/delete-unknown-projects.js +0 -154
  58. package/scripts/fix-sync-gap.js +0 -32
  59. package/scripts/generate-session-qrels.ts +0 -126
  60. package/scripts/heartbeat-memory-orchestrator.sh +0 -28
  61. package/scripts/replay-retrieval-benchmark.ts +0 -69
  62. package/scripts/report-sync-gap.js +0 -26
  63. package/scripts/review-queue-auto-resolve.js +0 -21
  64. package/scripts/sync-gap-auto-heal.sh +0 -17
  65. package/spec.md +0 -624
  66. package/specs/20260207-dashboard-upgrade/context.md +0 -38
  67. package/specs/20260207-dashboard-upgrade/spec.md +0 -96
  68. package/specs/citations-system/context.md +0 -243
  69. package/specs/citations-system/plan.md +0 -495
  70. package/specs/citations-system/spec.md +0 -371
  71. package/specs/endless-mode/context.md +0 -305
  72. package/specs/endless-mode/plan.md +0 -620
  73. package/specs/endless-mode/spec.md +0 -455
  74. package/specs/entity-edge-model/context.md +0 -401
  75. package/specs/entity-edge-model/plan.md +0 -459
  76. package/specs/entity-edge-model/spec.md +0 -391
  77. package/specs/evidence-aligner-v2/context.md +0 -401
  78. package/specs/evidence-aligner-v2/plan.md +0 -303
  79. package/specs/evidence-aligner-v2/spec.md +0 -312
  80. package/specs/mcp-desktop-integration/context.md +0 -278
  81. package/specs/mcp-desktop-integration/plan.md +0 -550
  82. package/specs/mcp-desktop-integration/spec.md +0 -494
  83. package/specs/memory-utilization-improvements/context.md +0 -145
  84. package/specs/memory-utilization-improvements/plan.md +0 -361
  85. package/specs/memory-utilization-improvements/spec.md +0 -361
  86. package/specs/post-tool-use-hook/context.md +0 -319
  87. package/specs/post-tool-use-hook/plan.md +0 -469
  88. package/specs/post-tool-use-hook/spec.md +0 -364
  89. package/specs/private-tags/context.md +0 -288
  90. package/specs/private-tags/plan.md +0 -412
  91. package/specs/private-tags/spec.md +0 -345
  92. package/specs/progressive-disclosure/context.md +0 -346
  93. package/specs/progressive-disclosure/plan.md +0 -663
  94. package/specs/progressive-disclosure/spec.md +0 -415
  95. package/specs/selective-tool-observation/context.md +0 -100
  96. package/specs/selective-tool-observation/plan.md +0 -158
  97. package/specs/selective-tool-observation/spec.md +0 -127
  98. package/specs/task-entity-system/context.md +0 -297
  99. package/specs/task-entity-system/plan.md +0 -301
  100. package/specs/task-entity-system/spec.md +0 -314
  101. package/specs/thin-core-refactor/context.md +0 -275
  102. package/specs/thin-core-refactor/plan.md +0 -536
  103. package/specs/thin-core-refactor/spec.md +0 -465
  104. package/specs/vector-outbox-v2/context.md +0 -470
  105. package/specs/vector-outbox-v2/plan.md +0 -562
  106. package/specs/vector-outbox-v2/spec.md +0 -466
  107. package/specs/web-viewer-ui/context.md +0 -384
  108. package/specs/web-viewer-ui/plan.md +0 -797
  109. package/specs/web-viewer-ui/spec.md +0 -516
  110. package/src/adapters/claude/capture/index.ts +0 -3
  111. package/src/adapters/claude/context/index.ts +0 -3
  112. package/src/adapters/claude/hooks/index.ts +0 -21
  113. package/src/adapters/claude/hooks/post-tool-use.ts +0 -239
  114. package/src/adapters/claude/hooks/prompt-injection-policy.ts +0 -104
  115. package/src/adapters/claude/hooks/semantic-daemon-client.ts +0 -209
  116. package/src/adapters/claude/hooks/semantic-daemon.ts +0 -283
  117. package/src/adapters/claude/hooks/session-end.ts +0 -59
  118. package/src/adapters/claude/hooks/session-start.ts +0 -73
  119. package/src/adapters/claude/hooks/stop.ts +0 -128
  120. package/src/adapters/claude/hooks/user-prompt-submit.ts +0 -361
  121. package/src/adapters/claude/index.ts +0 -4
  122. package/src/adapters/claude/transcript/index.ts +0 -4
  123. package/src/adapters/claude/transcript/transcript-reader.ts +0 -57
  124. package/src/adapters/claude/transcript/turn-reconstructor.ts +0 -65
  125. package/src/apps/cli/claude-settings-hooks.ts +0 -138
  126. package/src/apps/cli/codex-import-runner.ts +0 -125
  127. package/src/apps/cli/codex-validation-output.ts +0 -95
  128. package/src/apps/cli/hermes-import-runner.ts +0 -130
  129. package/src/apps/cli/hermes-validation-output.ts +0 -91
  130. package/src/apps/cli/index.ts +0 -1735
  131. package/src/apps/cli/mcp-install.ts +0 -106
  132. package/src/apps/cli/retrieval-disclosure-output.ts +0 -196
  133. package/src/apps/dashboard/assets/js/bootstrap.js +0 -244
  134. package/src/apps/dashboard/assets/js/chat.js +0 -373
  135. package/src/apps/dashboard/assets/js/disclosure.js +0 -232
  136. package/src/apps/dashboard/assets/js/modals.js +0 -298
  137. package/src/apps/dashboard/assets/js/overview.js +0 -655
  138. package/src/apps/dashboard/assets/js/state.js +0 -72
  139. package/src/apps/dashboard/assets/js/views.js +0 -468
  140. package/src/apps/dashboard/index.html +0 -543
  141. package/src/apps/dashboard/index.ts +0 -3
  142. package/src/apps/dashboard/style.css +0 -1750
  143. package/src/apps/index.ts +0 -5
  144. package/src/apps/server/api/chat.ts +0 -244
  145. package/src/apps/server/api/citations.ts +0 -105
  146. package/src/apps/server/api/events.ts +0 -137
  147. package/src/apps/server/api/health.ts +0 -53
  148. package/src/apps/server/api/index.ts +0 -26
  149. package/src/apps/server/api/projects.ts +0 -74
  150. package/src/apps/server/api/search.ts +0 -184
  151. package/src/apps/server/api/sessions.ts +0 -115
  152. package/src/apps/server/api/stats.ts +0 -723
  153. package/src/apps/server/api/turns.ts +0 -143
  154. package/src/apps/server/api/utils.ts +0 -65
  155. package/src/apps/server/index.ts +0 -111
  156. package/src/cli/index.ts +0 -3
  157. package/src/cli/retrieval-disclosure-output.ts +0 -2
  158. package/src/compat/index.ts +0 -5
  159. package/src/core/canonical-key.ts +0 -186
  160. package/src/core/citation-generator.ts +0 -63
  161. package/src/core/consolidated-store.ts +0 -356
  162. package/src/core/consolidation-worker.ts +0 -493
  163. package/src/core/context-formatter.ts +0 -276
  164. package/src/core/continuity-manager.ts +0 -341
  165. package/src/core/db-wrapper.ts +0 -64
  166. package/src/core/derive/fact-deriver.ts +0 -170
  167. package/src/core/derive/index.ts +0 -2
  168. package/src/core/derive/summary-deriver.ts +0 -76
  169. package/src/core/edge-repo.ts +0 -333
  170. package/src/core/embedder.ts +0 -4
  171. package/src/core/engine/embedding-maintenance-service.ts +0 -187
  172. package/src/core/engine/endless-memory-services.ts +0 -4
  173. package/src/core/engine/index.ts +0 -19
  174. package/src/core/engine/memory-engine-services.ts +0 -170
  175. package/src/core/engine/memory-ingest-service.ts +0 -317
  176. package/src/core/engine/memory-query-service.ts +0 -173
  177. package/src/core/engine/memory-runtime-service.ts +0 -162
  178. package/src/core/engine/memory-service-composition.ts +0 -231
  179. package/src/core/engine/retrieval-analytics-service.ts +0 -181
  180. package/src/core/engine/retrieval-disclosure-service.ts +0 -420
  181. package/src/core/engine/retrieval-orchestrator.ts +0 -377
  182. package/src/core/engine/retrieval-services.ts +0 -176
  183. package/src/core/engine/shared-memory-services.ts +0 -4
  184. package/src/core/entity-repo.ts +0 -349
  185. package/src/core/event-store.ts +0 -779
  186. package/src/core/evidence-aligner.ts +0 -635
  187. package/src/core/external-market-context.ts +0 -582
  188. package/src/core/graduation-worker.ts +0 -171
  189. package/src/core/graduation.ts +0 -377
  190. package/src/core/index.ts +0 -64
  191. package/src/core/ingest-interceptor.ts +0 -80
  192. package/src/core/markdown-mirror.ts +0 -70
  193. package/src/core/matcher.ts +0 -208
  194. package/src/core/md-mirror.ts +0 -92
  195. package/src/core/metadata-extractor.ts +0 -203
  196. package/src/core/model/memory-fact.ts +0 -30
  197. package/src/core/model/memory-rule.ts +0 -14
  198. package/src/core/model/memory-summary.ts +0 -21
  199. package/src/core/model/raw-event.ts +0 -28
  200. package/src/core/model/retrieval-result.ts +0 -35
  201. package/src/core/mongo-sync-config.ts +0 -165
  202. package/src/core/mongo-sync-worker.ts +0 -381
  203. package/src/core/privacy/filter.ts +0 -190
  204. package/src/core/privacy/index.ts +0 -20
  205. package/src/core/privacy/tag-parser.ts +0 -145
  206. package/src/core/product-validation-matrix.ts +0 -314
  207. package/src/core/progressive-retriever.ts +0 -414
  208. package/src/core/registry/project-path.ts +0 -54
  209. package/src/core/registry/session-registry.ts +0 -69
  210. package/src/core/replay-evaluator.ts +0 -625
  211. package/src/core/retrieval-benchmark.ts +0 -117
  212. package/src/core/retrieval-quality.ts +0 -109
  213. package/src/core/retriever.ts +0 -800
  214. package/src/core/session-qrels.ts +0 -360
  215. package/src/core/shared-event-store.ts +0 -114
  216. package/src/core/shared-promoter.ts +0 -249
  217. package/src/core/shared-store.ts +0 -289
  218. package/src/core/shared-vector-store.ts +0 -203
  219. package/src/core/sqlite-event-store.ts +0 -1846
  220. package/src/core/sqlite-wrapper.ts +0 -116
  221. package/src/core/sync-worker.ts +0 -228
  222. package/src/core/tag-taxonomy.ts +0 -51
  223. package/src/core/task/blocker-resolver.ts +0 -333
  224. package/src/core/task/index.ts +0 -9
  225. package/src/core/task/task-matcher.ts +0 -240
  226. package/src/core/task/task-projector.ts +0 -358
  227. package/src/core/task/task-resolver.ts +0 -421
  228. package/src/core/turn-state.ts +0 -207
  229. package/src/core/types.ts +0 -952
  230. package/src/core/vector-outbox.ts +0 -299
  231. package/src/core/vector-store.ts +0 -231
  232. package/src/core/vector-worker.ts +0 -521
  233. package/src/core/working-set-store.ts +0 -257
  234. package/src/extensions/endless-memory/endless-memory-services.ts +0 -350
  235. package/src/extensions/endless-memory/index.ts +0 -1
  236. package/src/extensions/index.ts +0 -5
  237. package/src/extensions/mcp/handlers.ts +0 -960
  238. package/src/extensions/mcp/index.ts +0 -48
  239. package/src/extensions/mcp/tools.ts +0 -252
  240. package/src/extensions/shared-memory/index.ts +0 -1
  241. package/src/extensions/shared-memory/shared-memory-services.ts +0 -211
  242. package/src/extensions/vector/embedder.ts +0 -233
  243. package/src/extensions/vector/index.ts +0 -1
  244. package/src/hooks/post-tool-use.ts +0 -9
  245. package/src/hooks/semantic-daemon-client.ts +0 -1
  246. package/src/hooks/semantic-daemon.ts +0 -11
  247. package/src/hooks/session-end.ts +0 -9
  248. package/src/hooks/session-start.ts +0 -9
  249. package/src/hooks/stop.ts +0 -9
  250. package/src/hooks/user-prompt-submit.ts +0 -9
  251. package/src/index.ts +0 -13
  252. package/src/mcp/handlers.ts +0 -2
  253. package/src/mcp/index.ts +0 -4
  254. package/src/mcp/tools.ts +0 -2
  255. package/src/server/api/chat.ts +0 -2
  256. package/src/server/api/citations.ts +0 -2
  257. package/src/server/api/events.ts +0 -2
  258. package/src/server/api/health.ts +0 -2
  259. package/src/server/api/index.ts +0 -2
  260. package/src/server/api/projects.ts +0 -2
  261. package/src/server/api/search.ts +0 -2
  262. package/src/server/api/sessions.ts +0 -2
  263. package/src/server/api/stats.ts +0 -2
  264. package/src/server/api/turns.ts +0 -2
  265. package/src/server/api/utils.ts +0 -2
  266. package/src/server/index.ts +0 -2
  267. package/src/services/bootstrap-organizer.ts +0 -463
  268. package/src/services/codex-session-history-importer.ts +0 -966
  269. package/src/services/hermes-session-history-importer.ts +0 -733
  270. package/src/services/memory-service-config.ts +0 -36
  271. package/src/services/memory-service-registry.ts +0 -150
  272. package/src/services/memory-service.ts +0 -688
  273. package/src/services/session-history-importer.ts +0 -629
  274. package/tests/README.md +0 -23
  275. package/tests/adapters/claude/claude-semantic-daemon-adapter.test.ts +0 -54
  276. package/tests/adapters/claude/claude-transcript-reconstructor.test.ts +0 -98
  277. package/tests/adapters/claude-hook-prompt-injection-policy.test.ts +0 -99
  278. package/tests/apps/app-layer-boundary.test.ts +0 -48
  279. package/tests/apps/claude-settings-hooks.test.ts +0 -107
  280. package/tests/apps/cli-disclosure-output.test.ts +0 -212
  281. package/tests/apps/codex-import-runner.test.ts +0 -99
  282. package/tests/apps/codex-validation-output.test.ts +0 -100
  283. package/tests/apps/hermes-import-runner.test.ts +0 -99
  284. package/tests/apps/mcp-install-command.test.ts +0 -59
  285. package/tests/apps/package-build-entrypoints.test.ts +0 -30
  286. package/tests/apps/postinstall-embedding-backend.test.ts +0 -175
  287. package/tests/apps/search-api-disclosure.test.ts +0 -162
  288. package/tests/apps/stats-api-lightweight.test.ts +0 -67
  289. package/tests/apps/ui-disclosure-output.test.ts +0 -140
  290. package/tests/core/bootstrap-organizer.test.ts +0 -111
  291. package/tests/core/canonical-key.test.ts +0 -101
  292. package/tests/core/codex-session-history-importer-validation.test.ts +0 -185
  293. package/tests/core/consolidation-worker.test.ts +0 -75
  294. package/tests/core/embedding-maintenance-service.test.ts +0 -282
  295. package/tests/core/evidence-aligner.test.ts +0 -152
  296. package/tests/core/external-market-context.test.ts +0 -209
  297. package/tests/core/fact-deriver.test.ts +0 -79
  298. package/tests/core/hermes-session-history-importer-validation.test.ts +0 -609
  299. package/tests/core/ingest-interceptor.test.ts +0 -38
  300. package/tests/core/markdown-mirror.test.ts +0 -85
  301. package/tests/core/matcher.test.ts +0 -112
  302. package/tests/core/md-mirror.test.ts +0 -50
  303. package/tests/core/memory-engine-services.test.ts +0 -240
  304. package/tests/core/memory-ingest-service.test.ts +0 -296
  305. package/tests/core/memory-query-service.test.ts +0 -129
  306. package/tests/core/memory-runtime-service.test.ts +0 -201
  307. package/tests/core/memory-service-composition.test.ts +0 -192
  308. package/tests/core/memory-service-config.test.ts +0 -41
  309. package/tests/core/memory-service-facade.test.ts +0 -30
  310. package/tests/core/memory-service-registry.test.ts +0 -206
  311. package/tests/core/product-validation-matrix.test.ts +0 -61
  312. package/tests/core/project-registry.test.ts +0 -78
  313. package/tests/core/replay-evaluator.test.ts +0 -181
  314. package/tests/core/retrieval-analytics-service.test.ts +0 -210
  315. package/tests/core/retrieval-benchmark.test.ts +0 -93
  316. package/tests/core/retrieval-disclosure-service.test.ts +0 -264
  317. package/tests/core/retrieval-orchestrator.test.ts +0 -403
  318. package/tests/core/retrieval-quality.test.ts +0 -31
  319. package/tests/core/retrieval-services.test.ts +0 -185
  320. package/tests/core/retriever-fallback-chain.test.ts +0 -223
  321. package/tests/core/retriever-strategy-scope.test.ts +0 -164
  322. package/tests/core/retriever.memu-adoption.test.ts +0 -122
  323. package/tests/core/session-history-importer-filter.test.ts +0 -78
  324. package/tests/core/session-qrels.test.ts +0 -250
  325. package/tests/core/sqlite-event-store-replication.test.ts +0 -127
  326. package/tests/core/summary-deriver.test.ts +0 -66
  327. package/tests/extensions/embedder-warning-suppression.test.ts +0 -83
  328. package/tests/extensions/endless-memory-extension-boundary.test.ts +0 -17
  329. package/tests/extensions/endless-memory-services.test.ts +0 -325
  330. package/tests/extensions/mcp-context-tools.test.ts +0 -905
  331. package/tests/extensions/mcp-extension-boundary.test.ts +0 -21
  332. package/tests/extensions/mcp-package-build.test.ts +0 -22
  333. package/tests/extensions/mcp-project-aware-tools.test.ts +0 -102
  334. package/tests/extensions/shared-memory-extension-boundary.test.ts +0 -24
  335. package/tests/extensions/shared-memory-services.test.ts +0 -309
  336. package/tests/extensions/vector-extension-boundary.test.ts +0 -21
  337. package/tsconfig.json +0 -24
  338. package/vitest.config.ts +0 -15
@@ -1,80 +0,0 @@
1
- {
2
- "root": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p",
3
- "home": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/home",
4
- "project_a": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai",
5
- "project_b": "/var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb",
6
- "results": [
7
- {
8
- "label": "import alpha crafted Claude session",
9
- "exit": 0,
10
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js import --session /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/alpha-session.jsonl --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --verbose",
11
- "output": "\n⏳ Initializing memory service...\n ✅ Ready (embedder: jinaai/jina-embeddings-v5-text-nano-text-matching)\n\n📥 Importing session: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/alpha-session.jsonl\n Target: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai\n\n\n 📄 [1/...] 1 msgs | +1 imported, ~0 skipped Imported 3 prompts, 3 responses from /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/alpha-session.jsonl\n\n🧠 Processing embeddings...\n\n┌─────────────────────────────────┐\n│ ✅ Import Complete │\n├─────────────────────────────────┤\n│ Sessions processed: 1 │\n│ Total messages: 7 │\n│ Imported prompts: 3 │\n│ Imported responses: 3 │\n│ Skipped duplicates: 1 │\n│ Embeddings queued: 6 │\n└─────────────────────────────────┘\n\n⏱️ Completed in 1.7s\n"
12
- },
13
- {
14
- "label": "import beta conflicting project session",
15
- "exit": 0,
16
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js import --session /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/beta-session.jsonl --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb --verbose",
17
- "output": "\n⏳ Initializing memory service...\n ✅ Ready (embedder: jinaai/jina-embeddings-v5-text-nano-text-matching)\n\n📥 Importing session: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/beta-session.jsonl\n Target: /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb\n\n\n 📄 [1/...] 1 msgs | +1 imported, ~0 skipped Imported 1 prompts, 1 responses from /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/beta-session.jsonl\n\n🧠 Processing embeddings...\n\n┌─────────────────────────────────┐\n│ ✅ Import Complete │\n├─────────────────────────────────┤\n│ Sessions processed: 1 │\n│ Total messages: 2 │\n│ Imported prompts: 1 │\n│ Imported responses: 1 │\n│ Skipped duplicates: 0 │\n│ Embeddings queued: 2 │\n└─────────────────────────────────┘\n\n⏱️ Completed in 1.4s\n"
18
- },
19
- {
20
- "label": "alpha stats",
21
- "exit": 0,
22
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js stats --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai",
23
- "output": "\n📊 Memory Statistics\n\nTotal Events: 6\nVector Count: 6\n\nMemory Levels:\n L0: █ 6\n"
24
- },
25
- {
26
- "label": "Q1 lifecycle lightweight expand/source",
27
- "exit": 0,
28
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search disclosure expand source initialize vector workers lightweight --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
29
- "output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 3\nShared memories found: 0\n\n---\n📌 agent_response (2026-05-05)\n Score: 1.000\n Session: alpha-se...\n Content: Decision recorded: For progressive retrieval disclosure, expand/source drill-down routes must stay lightweight. Do not call full MemoryService.initialize for disclosure expand/source because it can...\n\n---\n📌 agent_response (2026-05-05)\n Score: 0.829\n Session: alpha-se...\n Content: Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI m...\n\n---\n📌 user_prompt (2026-05-05)\n Score: 0.773\n Session: alpha-se...\n Content: When adding retrieval disclosure API routes, what lifecycle rule should we remember?\n\n"
30
- },
31
- {
32
- "label": "Q2 FTS T.event_id fix",
33
- "exit": 0,
34
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search T.event_id FTS rebuild internal table trigger event_id --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
35
- "output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 2\nShared memories found: 0\n\n---\n📌 agent_response (2026-05-05)\n Score: 0.978\n Session: alpha-se...\n Content: Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tok...\n\n---\n📌 user_prompt (2026-05-05)\n Score: 0.905\n Session: alpha-se...\n Content: How did we fix the SQLite FTS rebuild T.event_id failure?\n\n"
36
- },
37
- {
38
- "label": "Q3 shared provenance dashboard",
39
- "exit": 0,
40
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search shared_troubleshooting rootCause solution sourceProjectHash --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
41
- "output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 1\nShared memories found: 0\n\n---\n📌 agent_response (2026-05-05)\n Score: 1.000\n Session: alpha-se...\n Content: Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI m...\n\n"
42
- },
43
- {
44
- "label": "Q4 noise command artifact should not retrieve",
45
- "exit": 0,
46
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search local-command-stdout command-name opus --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
47
- "output": "\n📚 Search Results\n\nConfidence: none\nTotal local memories found: 0\nShared memories found: 0\n\n"
48
- },
49
- {
50
- "label": "Q5 project scoping negative DuckDB from alpha",
51
- "exit": 0,
52
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search DuckDB legacy storage migrate --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 5 --min-score 0.1",
53
- "output": "\n📚 Search Results\n\nConfidence: none\nTotal local memories found: 0\nShared memories found: 0\n\n"
54
- },
55
- {
56
- "label": "Q6 beta project positive DuckDB",
57
- "exit": 0,
58
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search DuckDB legacy storage migrate --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/beta-legacy-duckdb --top-k 5 --min-score 0.1",
59
- "output": "\n📚 Search Results\n\nConfidence: high\nTotal local memories found: 2\nShared memories found: 0\n\n---\n📌 user_prompt (2026-05-05)\n Score: 1.000\n Session: beta-ses...\n Content: For the beta legacy storage project, should we migrate away from DuckDB?\n\n---\n📌 agent_response (2026-05-05)\n Score: 0.922\n Session: beta-ses...\n Content: Legacy beta project decision: this old unrelated project should keep DuckDB and should not migrate to SQLite. This memory intentionally conflicts with alpha-commerce-ai and is used to test strict p...\n\n"
60
- },
61
- {
62
- "label": "Q7 disclosure FTS query",
63
- "exit": 0,
64
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js search T.event_id FTS rebuild internal table --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --top-k 3 --min-score 0.1 --disclosure --strategy fast",
65
- "output": "\n🔎 Progressive Search Results\n\nMeta: total=2 vector=no keyword=yes fallback=no\n\n1. [source] Agent response\n id: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n score: 1.000\n reasons: keyword_match, recent_relevance, continuity_link\n source: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n session: alpha-sessio...\n snippet: Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recre...\n\n2. [source] User prompt\n id: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n score: 0.905\n reasons: keyword_match, recent_relevance, continuity_link\n source: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n session: alpha-sessio...\n snippet: How did we fix the SQLite FTS rebuild T.event_id failure?\n\n"
66
- },
67
- {
68
- "label": "Q8 expand first disclosure result",
69
- "exit": 0,
70
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js expand event:a5a01a44-67cb-4cef-b0e5-44c72925db9c --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai --window-size 2",
71
- "output": "\n🧩 Expanded Retrieval Result\n\nTarget\n- [source] Agent response\n id: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n score: 1.000\n reasons: continuity_link\n source: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\n session: alpha-sessio...\n snippet: Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recre...\n\n\nSurrounding\n1. [source] Agent response\n id: event:c0c2e795-eb98-4354-9ce0-cf453d967a87\n score: 1.000\n reasons: continuity_link\n source: event:c0c2e795-eb98-4354-9ce0-cf453d967a87\n session: alpha-sessio...\n snippet: Decision recorded: For progressive retrieval disclosure, expand/source drill-down routes must stay lightweight. Do not call full MemoryService.initialize for disclosure expand/source because it can start embedders, vector workers, and sh...\n\n2. [source] User prompt\n id: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n score: 1.000\n reasons: continuity_link\n source: event:eb14f3db-0aeb-424d-ae96-b2d6baefb731\n session: alpha-sessio...\n snippet: How did we fix the SQLite FTS rebuild T.event_id failure?\n\n3. [source] User prompt\n id: event:34f59596-f65f-4520-9a88-6ba835b8018a\n score: 1.000\n reasons: continuity_link\n source: event:34f59596-f65f-4520-9a88-6ba835b8018a\n session: alpha-sessio...\n snippet: For dashboard shared retrieval provenance, what should the UI show?\n\n4. [source] Agent response\n id: event:9b376621-c598-42fc-826a-306b3603ba18\n score: 1.000\n reasons: continuity_link\n source: event:9b376621-c598-42fc-826a-306b3603ba18\n session: alpha-sessio...\n snippet: Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI must state that there are no local raw ev...\n\n\nSources\n- event:c0c2e795-eb98-4354-9ce0-cf453d967a87 (imported_history) events=c0c2e795-eb98-4354-9ce0-cf453d967a87\n- event:eb14f3db-0aeb-424d-ae96-b2d6baefb731 (imported_history) events=eb14f3db-0aeb-424d-ae96-b2d6baefb731\n- event:a5a01a44-67cb-4cef-b0e5-44c72925db9c (imported_history) events=a5a01a44-67cb-4cef-b0e5-44c72925db9c\n- event:34f59596-f65f-4520-9a88-6ba835b8018a (imported_history) events=34f59596-f65f-4520-9a88-6ba835b8018a\n- event:9b376621-c598-42fc-826a-306b3603ba18 (imported_history) events=9b376621-c598-42fc-826a-306b3603ba18\n\nExpanded Context\n[agent_response] Decision recorded: For progressive retrieval disclosure, expand/source drill-down routes must stay lightweight. Do not call full MemoryService.initialize for disclosure expand/source because it can start embedders, vector workers, and shared promotion machinery. Use narrow SQLiteEventStore getEvent/getSessionEvents or shared-store lookup ports instead. API tests should assert initialize is not called for GET expand/source routes, including 404 paths.\n\n[user_prompt] How did we fix the SQLite FTS rebuild T.event_id failure?\n\n[agent_response] Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recreating events_fts and then recreate triggers that write rowid, content, and event_id. Also cover deleteSessionEvents followed by rebuildFtsIndex.\n\n[user_prompt] For dashboard shared retrieval provenance, what should the UI show?\n\n[agent_response] Dashboard provenance decision: shared disclosure results should be rendered as shared_troubleshooting provenance, showing sourceProjectHash, sourceEntryId, topics, rootCause, and solution. The UI must state that there are no local raw events for a shared source instead of pretending shared memories are local event IDs. Escape all metadata before innerHTML rendering.\n\n"
72
- },
73
- {
74
- "label": "Q9 source first disclosure result",
75
- "exit": 0,
76
- "cmd": "node /Users/namsangboy/workspace/claude-memory-layer/dist/cli/index.js source event:a5a01a44-67cb-4cef-b0e5-44c72925db9c --project /var/folders/vw/0ts5bq8n0k31vy_y7t0pd1nw0000gp/T/cml-usefulness-5q7j2p0p/projects/alpha-commerce-ai",
77
- "output": "\n📎 Retrieval Source\n\nsourceRef: event:a5a01a44-67cb-4cef-b0e5-44c72925db9c\nsourceType: imported_history\neventIds: a5a01a44-67cb-4cef-b0e5-44c72925db9c\n\nRaw Events\n- a5a01a44-67cb-4cef-b0e5-44c72925db9c 2026-05-05T01:38:20.318Z\n [agent_response] Bug fix recorded: SQLite FTS rebuild failure 'no such column: T.event_id' is fixed by making events_fts an internal FTS5 table with columns content and event_id UNINDEXED using porter unicode61 tokenization. Rebuild by dropping and recreating events_fts and then recreate triggers that write rowid, content, and event_id. Also cover deleteSessionEvents followed by rebuildFtsIndex.\n session: alpha-session\n canonicalKey: bug fix recorded sqlite fts rebuild failure no such column teventid is fixed by making eventsfts an internal fts5 table with columns content and eventid unindexed using porter unicode61 token_2e1a5fce\n\n"
78
- }
79
- ]
80
- }
@@ -1,333 +0,0 @@
1
- <!-- Imported from `/Users/namsangboy/workspace/memsearch/docs/PROJECT_STRUCTURE_ANALYSIS.md` as a local comparison snapshot for claude-memory-layer refactoring. -->
2
-
3
- # memsearch 프로젝트 구조 분석
4
-
5
- ## 한 줄 요약
6
- `memsearch`는 **markdown을 source of truth로 삼고, Milvus를 파생 인덱스로 사용하는 가볍고 실용적인 semantic memory/search 엔진**이다. 코어 라이브러리는 비교적 작고 명확하며, 복잡성의 대부분은 각 에이전트/플랫폼용 플러그인 통합 계층에 있다.
7
-
8
- ---
9
-
10
- ## 1. 프로젝트 목적
11
-
12
- 이 프로젝트의 핵심 목적은 다음이다.
13
-
14
- - markdown 기반 메모리/지식 문서를 semantic search 가능하게 인덱싱
15
- - 여러 AI coding agent/도구(Claude Code, Codex, OpenClaw, OpenCode)에서 공통 memory layer로 활용
16
- - 기억의 “원본”은 사람이 읽고 편집 가능한 markdown으로 유지
17
- - 벡터 DB는 언제든 다시 만들 수 있는 파생 인덱스로 취급
18
-
19
- 즉, 이 프로젝트는 **vector DB 중심 시스템**이 아니라,
20
- **markdown 중심 메모리 시스템**에 더 가깝다.
21
-
22
- ---
23
-
24
- ## 2. 기술 스택
25
-
26
- ### 언어 / 런타임
27
- - Python 3.10+
28
- - 일부 플러그인은 shell / TypeScript / Node 조합
29
-
30
- ### 핵심 라이브러리
31
- - CLI: `click`
32
- - 벡터 저장소: `pymilvus` / Milvus Lite
33
- - 파일 감시: `watchdog`
34
- - 임베딩 제공자: OpenAI / Google / Voyage / Jina / Mistral / Ollama / local / ONNX
35
- - 문서/툴링: mkdocs, pytest, ruff, uv
36
-
37
- ### 주요 엔트리 포인트
38
- - Python API: `src/memsearch/core.py`
39
- - CLI: `src/memsearch/cli.py`
40
- - 모듈 실행: `src/memsearch/__main__.py`
41
- - 플랫폼 플러그인: `plugins/*`
42
-
43
- ---
44
-
45
- ## 3. 디렉터리 구조 분석
46
-
47
- ### `src/memsearch/`
48
- 코어 라이브러리 영역이다.
49
-
50
- 주요 파일:
51
- - `core.py`: 공개 API `MemSearch`
52
- - `store.py`: Milvus wrapper, hybrid retrieval
53
- - `chunker.py`: markdown chunking, chunk ID 생성
54
- - `scanner.py`: markdown 파일 스캔
55
- - `watcher.py`: 파일 변경 감지 및 debounce
56
- - `config.py`: layered TOML config
57
- - `compact.py`: LLM 기반 요약/압축
58
- - `reranker.py`: optional cross-encoder rerank
59
- - `embeddings/*`: provider abstraction
60
-
61
- 이 구조는 매우 명확하다.
62
- 핵심 기능이 파일 단위로 잘 나뉘어 있고, 각 모듈의 책임이 비교적 분명하다.
63
-
64
- ### `plugins/`
65
- 플랫폼별 통합 레이어다.
66
-
67
- 구성:
68
- - `claude-code/`
69
- - `codex/`
70
- - `openclaw/`
71
- - `opencode/`
72
- - `_shared/`
73
-
74
- 즉, 메모리 엔진은 공통이고,
75
- 각 에이전트별 capture/retrieval/injection 방식을 다르게 붙이는 구조다.
76
-
77
- ### `tests/`
78
- chunking, config, store, CLI, transcript 파싱 등 코어 품질을 검증한다.
79
-
80
- ### `docs/`
81
- 문서 품질이 높은 편이다.
82
- 아키텍처 설명, 플랫폼별 설치, 설정, FAQ, CLI 등이 비교적 잘 정리되어 있다.
83
-
84
- ---
85
-
86
- ## 4. 데이터 모델
87
-
88
- ### 4.1 Source of truth = Markdown
89
- 이 프로젝트에서 가장 중요한 원칙이다.
90
-
91
- 메모리는 결국 markdown 파일이다.
92
- 예:
93
- - `.memsearch/memory/YYYY-MM-DD.md`
94
-
95
- 장점:
96
- - 사람이 직접 읽고 수정 가능
97
- - git 관리 가능
98
- - vendor lock-in이 약함
99
- - 인덱스가 깨져도 원본은 남음
100
-
101
- ### 4.2 Vector index = Milvus
102
- Milvus는 파생 검색 인덱스다.
103
-
104
- 대표 스키마 필드:
105
- - `chunk_hash` (PK)
106
- - `embedding`
107
- - `sparse_vector`
108
- - `content`
109
- - `source`
110
- - `heading`
111
- - `heading_level`
112
- - `start_line`
113
- - `end_line`
114
-
115
- 즉,
116
- **문서 provenance를 꽤 잘 보존하는 chunk index** 구조다.
117
-
118
- ### 4.3 Chunk ID 전략
119
- `chunker.py`의 composite ID 설계가 핵심이다.
120
-
121
- 대략 구성:
122
- - source
123
- - line range
124
- - content hash
125
- - model
126
-
127
- 이 방식의 장점:
128
- - 자연스러운 dedupe
129
- - 변경 감지 쉬움
130
- - 파일 일부만 바뀌어도 필요한 chunk만 재색인 가능
131
-
132
- ---
133
-
134
- ## 5. 인덱싱 파이프라인
135
-
136
- 코어 흐름은 매우 직관적이다.
137
-
138
- ### 단계
139
- 1. `scanner.py`가 markdown 파일 탐색
140
- 2. `chunker.py`가 heading 기반 분할
141
- 3. 필요 시 oversized section을 추가 분할
142
- 4. content 정리 후 embedding 생성
143
- 5. `store.py`가 Milvus에 upsert
144
- 6. 기존 chunk와 비교해서 stale chunk 삭제
145
-
146
- 특징:
147
- - heading 중심 chunking
148
- - preamble chunk 지원
149
- - line overlap 지원
150
- - HTML comment 제거 후 embedding
151
- - changed chunk만 재처리
152
-
153
- 즉, 단순하지만 실전적인 indexing pipeline이다.
154
-
155
- ---
156
-
157
- ## 6. 검색 구조
158
-
159
- ### hybrid retrieval
160
- 이 프로젝트의 핵심 강점이다.
161
-
162
- - dense vector search
163
- - BM25 sparse search
164
- - RRF(Reciprocal Rank Fusion)
165
-
166
- 즉, vector-only가 아니라 lexical 검색을 기본 결합한다.
167
- 이건 실제 회상 정확도에서 꽤 중요하다.
168
-
169
- ### progressive disclosure
170
- - L1: search
171
- - L2: expand (원문 markdown section 복원)
172
- - L3: transcript drill-down (플랫폼별)
173
-
174
- 특히 Claude Code plugin은 이 구조를 잘 활용한다.
175
-
176
- ### optional reranker
177
- 추가적으로 cross-encoder reranker도 붙일 수 있다.
178
- 하지만 기본은 비교적 가볍게 유지되어 있다.
179
-
180
- ---
181
-
182
- ## 7. 플랫폼 플러그인 구조
183
-
184
- `memsearch`의 진짜 복잡성은 여기 있다.
185
- 코어보다 플러그인 계층이 훨씬 운영적으로 까다롭다.
186
-
187
- ### Claude Code 플러그인
188
- 구성 요소:
189
- - hooks
190
- - shared shell runtime (`common.sh`)
191
- - transcript parser
192
- - `memory-recall` skill
193
-
194
- 역할:
195
- - SessionStart 시 최근 메모리 주입
196
- - Stop 시 마지막 턴 요약/기록
197
- - Skill을 통한 forked memory recall
198
-
199
- 이건 단순 자동 검색보다 더 세련된 구조다.
200
- 메인 컨텍스트를 더럽히지 않고 recall을 subagent skill로 위임한다.
201
-
202
- ### Codex 플러그인
203
- Claude 구조와 유사하지만,
204
- Codex lifecycle 제약(SessionEnd 부재 등) 때문에 프로세스 정리 로직이 더 복잡하다.
205
-
206
- ### OpenClaw 플러그인
207
- TypeScript 기반 plugin으로 붙어 있으며,
208
- 메모리 검색/원문 조회/트랜스크립트 조회 도구를 제공한다.
209
-
210
- ### OpenCode 플러그인
211
- 가장 무거운 편이다.
212
- 배경 Python daemon이 SQLite를 polling하며 새 턴을 요약/기록한다.
213
-
214
- ---
215
-
216
- ## 8. Watch / Sync 구조
217
-
218
- `watcher.py`는 `watchdog` 기반의 debounce watcher다.
219
-
220
- 하지만 플러그인 레벨에서는 백엔드 종류에 따라 전략이 달라진다.
221
-
222
- - Milvus server/remote: 장기 watch 가능
223
- - Milvus Lite: file lock 문제 때문에 일회성 index 위주 fallback
224
-
225
- 즉, 저장소 기술 선택이 integration 전략에 직접 영향을 준다.
226
-
227
- ---
228
-
229
- ## 9. 설정 구조
230
-
231
- `config.py`는 layered configuration 구조를 가진다.
232
-
233
- 우선순위:
234
- 1. defaults
235
- 2. `~/.memsearch/config.toml`
236
- 3. 프로젝트 로컬 `.memsearch.toml`
237
- 4. CLI flags
238
-
239
- 장점:
240
- - 사용성과 운영 flexibility가 좋음
241
- - 전역/로컬 설정 분리가 자연스러움
242
-
243
- 또한 secret을 `env:VAR_NAME` 으로 간접 참조할 수 있어 실전성이 높다.
244
-
245
- ---
246
-
247
- ## 10. 테스트 / 품질 평가
248
-
249
- 이 저장소는 코어 라이브러리 품질 신호가 좋다.
250
-
251
- 강점:
252
- - chunker / config / store / scanner / transcript 등 핵심 경로 테스트 존재
253
- - CI, lint, format 정리되어 있음
254
- - 코어가 작아서 테스트 범위를 잡기 쉬움
255
-
256
- 한계:
257
- - 플랫폼 integration 전체를 완전히 일관되게 검증하기는 어렵다
258
- - 일부 경로는 외부 API/환경 의존이 있다
259
-
260
- 즉,
261
- - **core는 비교적 단단함**
262
- - **plugin edge는 환경 의존성이 큼**
263
-
264
- ---
265
-
266
- ## 11. 아키텍처 강점
267
-
268
- ### 강점 1: source of truth가 명확하다
269
- markdown이 원본이다.
270
- 이건 설명 가능성, 복구성, 이식성 면에서 매우 큰 장점이다.
271
-
272
- ### 강점 2: 코어가 작고 선명하다
273
- scanner → chunker → embedder → store 라는 파이프라인이 아주 명료하다.
274
-
275
- ### 강점 3: hybrid retrieval 기본 제공
276
- 실전 회상 품질을 높이는 중요한 선택이다.
277
-
278
- ### 강점 4: 플러그인 분리 구조가 좋다
279
- 코어 메모리 엔진과 각 에이전트 통합 레이어가 비교적 깔끔하게 분리돼 있다.
280
-
281
- ### 강점 5: progressive disclosure 철학
282
- search → expand → transcript drill-down은 메모리 시스템 UX 측면에서 매우 좋다.
283
-
284
- ---
285
-
286
- ## 12. 약점 / 리스크
287
-
288
- ### 약점 1: Milvus 의존성
289
- 문서 원본은 markdown이지만, 실제 semantic search 운영은 Milvus 특성에 많이 의존한다.
290
-
291
- ### 약점 2: 플랫폼별 유지보수 비용
292
- Claude/Codex/OpenClaw/OpenCode 각각 lifecycle과 transcript format이 다르므로 plugin maintenance cost가 커진다.
293
-
294
- ### 약점 3: shell hook brittleness
295
- shell script 기반 훅은 OS/환경 차이, PATH, 프로세스 정리 등에서 취약할 수 있다.
296
-
297
- ### 약점 4: Lite 모드 동시성 제약
298
- Milvus Lite file lock 문제로 이상적인 watch 구조를 항상 쓰기 어렵다.
299
-
300
- ### 약점 5: 메타데이터 모델은 상대적으로 얇다
301
- 현재는 markdown chunk 중심 구조라,
302
- 고급 엔티티 그래프, task graph, helpfulness 학습 같은 계층은 상대적으로 약하다.
303
-
304
- ---
305
-
306
- ## 13. 구조적 해석
307
-
308
- `memsearch`는 크게 두 부분으로 나뉜다.
309
-
310
- 1. **아주 잘 정리된 코어 라이브러리**
311
- 2. **상대적으로 복잡한 플랫폼별 통합 계층**
312
-
313
- 즉,
314
- “엔진은 가볍고 선명한데, 실제 제품화 complexity는 integration에 있다.”
315
-
316
- 이 점이 매우 중요하다.
317
-
318
- ---
319
-
320
- ## 14. 결론
321
-
322
- `memsearch`는 무거운 메모리 플랫폼이 아니라,
323
- **좋은 철학을 가진 가벼운 semantic memory engine** 이다.
324
-
325
- 핵심적으로 배울 점은 다음이다.
326
- - 원본을 markdown에 두는 것
327
- - 코어를 작게 유지하는 것
328
- - retrieval을 hybrid로 설계하는 것
329
- - 플랫폼 통합을 core 밖으로 밀어내는 것
330
- - progressive disclosure로 UX를 설계하는 것
331
-
332
- 즉, 이 프로젝트는 “엄청 많은 기능”보다,
333
- **작지만 강한 코어와 좋은 메모리 UX 패턴**이 매력인 구조다.
@@ -1,40 +0,0 @@
1
- # memU Adoption Notes (claude-memory-layer)
2
-
3
- 이 프로젝트에 적용된 memU 장점 요약입니다.
4
-
5
- ## 1) Dual Retrieval Strategy
6
- - `strategy: "fast" | "deep" | "auto"`
7
- - `fast`: 키워드 기반(FTS/keyword) 우선 탐색으로 저지연 검색
8
- - `deep`: 임베딩 + 벡터 검색 + 재정렬(키워드 오버랩 가중)로 정밀 검색
9
-
10
- ## 2) Scoped Retrieval Filters
11
- `scope`로 검색 범위를 좁혀 정확도를 높입니다.
12
-
13
- - `sessionId` / `sessionIdPrefix`
14
- - `eventTypes`
15
- - `canonicalKeyPrefix`
16
- - `contentIncludes` (부분 문자열 OR)
17
- - `metadata` (dot-path, 예: `scope.project.id`)
18
-
19
- ## 3) Hybrid Rerank Behavior
20
- `rerankWithKeyword=true`일 때 semantic score에 키워드 오버랩/최근성 점수를 가중해 재정렬합니다.
21
-
22
- ## 4) Test Coverage
23
- - `tests/retriever.memu-adoption.test.ts`
24
- - metadata dot-path 스코프 필터
25
- - fast 전략 키워드 경로
26
- - `tests/retriever-strategy-scope.test.ts`
27
- - fast/deep 전략 및 복합 스코프 필터
28
-
29
- ## Quick Example
30
- ```ts
31
- await retriever.retrieve('브리핑', {
32
- strategy: 'deep',
33
- topK: 10,
34
- scope: {
35
- sessionIdPrefix: 'agent:main:',
36
- canonicalKeyPrefix: 'pref/briefing',
37
- metadata: { 'scope.project.id': 'alpha' }
38
- }
39
- });
40
- ```
@@ -1,18 +0,0 @@
1
- # Operations Runbook
2
-
3
- ## Health scripts
4
-
5
- - `npm run ops:sync-gap:report`
6
- - `npm run ops:sync-gap:fix`
7
- - `npm run ops:sync-gap:heal`
8
- - `npm run ops:review:resolve`
9
- - `npm run ops:heartbeat`
10
-
11
- ## Status policy
12
-
13
- - `ok`: no failed outbox items and no un-leveled events after heal
14
- - `needs-attention`: failed outbox remains or level sync still broken
15
-
16
- ## Notes
17
-
18
- These scripts are best-effort operational automation for Claude memory DB (`~/.claude-code/memory/events.sqlite`).
@@ -1,82 +0,0 @@
1
- # Product Validation Matrix
2
-
3
- This document mirrors the tested matrix in `src/core/product-validation-matrix.ts`. The matrix is data-first so product reports and future CLI/API surfaces can reuse the same surface → requirement → evidence representation.
4
-
5
- ## Scope
6
-
7
- | Area | Surface | Status | Validation intent |
8
- | --- | --- | --- | --- |
9
- | Claude | Claude adapter import | covered | Import Claude Code JSONL while filtering tool/local-command noise and preserving turn/project continuity. |
10
- | Claude | Claude adapter search | covered | Search memory by project/session with plain and disclosure output paths. |
11
- | Claude | Claude adapter disclosure | covered | Exercise search → expand → source/citation disclosure flow. |
12
- | Codex | Codex adapter scan | ready | Recursively scan `~/.codex/sessions`, match by `session_meta.payload.cwd`, and count malformed/unsupported records. |
13
- | Codex | Codex adapter import | covered | Existing explicit import path remains mutation-only; `codex import` now exposes project/session/all imports while validation/replay stay read-only. |
14
- | Codex | Codex adapter replay | ready | Normalize real Codex `response_item` message records and aggregate replay counts without transcript content. |
15
- | Hermes | Hermes adapter scan | ready | Read Hermes `~/.hermes/state.db` in read-only mode, match project context, and aggregate unsupported/empty/truncated counts without transcript content. |
16
- | Hermes | Hermes adapter import | covered | `hermes import` exposes project/session/all imports while preserving SessionDB as raw source-of-truth and storing only redacted user/assistant turns. |
17
- | Hermes | Hermes adapter replay | ready | Normalize Hermes SessionDB rows into aggregate replay reports without transcript content or secrets. |
18
- | MCP | MCP context pack | covered | Combine relevant project memories and recent timeline into agent-ready startup context with citations/follow-up refs. |
19
- | MCP | MCP project timeline | covered | Summarize recent project memory by session, source agent, event counts, and safe preview. |
20
- | MCP | MCP source reference | covered | Resolve event/mem citation refs into redacted source previews with safe metadata only. |
21
- | CLI/API | CLI / API / reporting | ready | Provide `claude-memory-layer codex validate` / `codex replay` and `hermes validate` / `hermes replay` with JSON/Markdown reports. |
22
- | Safety | Safety / dry-run | ready | Default Codex/Hermes validation is read-only, avoids Claude settings/memory mutation, and can exclude transcript content from reports. |
23
-
24
- ## Codex validation requirements
25
-
26
- `claude-memory-layer codex validate` and `claude-memory-layer codex replay` are intentionally read-only. They support:
27
-
28
- - `--project <path>`: match sessions whose `session_meta.payload.cwd` resolves to the project path.
29
- - `--sessions-dir <path>`: override the default `~/.codex/sessions` root.
30
- - `--limit <number>`: cap the number of session files scanned.
31
- - `--format json|markdown`: choose machine-readable or human-readable aggregate output.
32
- - `--output <path>`: save the aggregate report to disk.
33
- - `--dry-run`: explicit safety marker; mutation is not supported by validation/replay.
34
- - `--anonymize-projects`: replace raw cwd labels with stable project hashes for shareable reports.
35
-
36
- Reports include only aggregate counts: sessions scanned/matched, records read, messages/turns normalized, user/assistant counts, malformed lines, skipped/unsupported records, empty assistant messages, truncated messages, missing cwd, warnings, top projects, and source paths. Transcript text is never included in validation reports.
37
-
38
- ## Hermes validation requirements
39
-
40
- `claude-memory-layer hermes validate` and `claude-memory-layer hermes replay` are intentionally read-only. They support:
41
-
42
- - `--project <path>`: match sessions whose Hermes session context/title includes the project path.
43
- - `--state-db <path>`: override the default `~/.hermes/state.db` source for tests, profiles, or replay fixtures.
44
- - `--limit <number>`: cap the number of matching sessions scanned.
45
- - `--format json|markdown`: choose machine-readable or human-readable aggregate output.
46
- - `--output <path>`: save the aggregate report to disk.
47
- - `--dry-run`: explicit safety marker; mutation is not supported by validation/replay.
48
-
49
- Reports include only aggregate counts: sessions scanned/matched, messages read/normalized, turns normalized, user/assistant counts, skipped/unsupported messages, empty assistant messages, truncated messages, missing project context, warnings, top sources, and source paths. Transcript text is never included in validation reports.
50
-
51
- ## MCP context navigator requirements
52
-
53
- The MCP server exposes read-only project context navigation for Claude Desktop, Codex, Hermes, and other MCP clients. These tools support the same optional `projectPath` scoping as `mem-search`/`mem-stats`:
54
-
55
- - `mem-context-pack`: agent startup context pack. It combines relevant retrieval results (`query`, `topK`, optional `sessionId`) with a bounded recent project timeline (`recentLimit`, `sessionLimit`) and returns follow-up citation refs.
56
- - `mem-project-timeline`: recent project memory grouped by session, source agent/import source, event counts, and a privacy-filtered last preview.
57
- - `mem-source-ref`: resolves `event:<id>`, full event IDs, `mem:<citation>`, bare citation IDs, or `[mem:<citation>]` into source metadata and a redacted preview.
58
-
59
- The tools are intentionally context/navigation-oriented rather than mutation APIs. `mem-source-ref` uses a narrow safe metadata allowlist and shared privacy filtering before returning previews; raw transcript dumps should use lower-level detail APIs only when explicitly needed.
60
-
61
- ## Codex import requirements
62
-
63
- `claude-memory-layer codex import` is the explicit mutation path. It supports:
64
-
65
- - `--project <path>`: import matching Codex sessions into the project-scoped memory store.
66
- - `--session <file>`: import one Codex JSONL session into the selected project scope.
67
- - `--all`: import all Codex sessions; without `--project`, this intentionally uses global memory and prints a warning.
68
- - `--sessions-dir <path>`: override the default `~/.codex/sessions` root for tests, replays, or alternate Codex profiles.
69
- - `--limit <number>`, `--force`, `--verbose`, and `--no-process-embeddings` for bounded/repeatable operational runs.
70
-
71
- ## Evidence
72
-
73
- - `tests/core/product-validation-matrix.test.ts` checks coverage, summary, and Markdown rendering of the matrix.
74
- - `tests/core/codex-session-history-importer-validation.test.ts` covers Codex dry-run scan/replay, cwd project matching, malformed lines, unsupported/tool-ish records, empty assistant messages, large/truncated content, missing cwd, all-session summary, and transcript exclusion.
75
- - `tests/apps/codex-validation-output.test.ts` covers JSON and Markdown reporting helpers.
76
- - `tests/apps/codex-import-runner.test.ts` covers explicit Codex import routing for project, session, and global all-session modes.
77
- - `tests/extensions/mcp-context-tools.test.ts` covers MCP context-pack/timeline/source-ref routing, output shape, citation refs, safe previews, and secret redaction.
78
- - `src/extensions/mcp/tools.ts` defines MCP schemas for search/timeline/details/stats and the context navigator tools.
79
- - `src/extensions/mcp/handlers.ts` implements project-aware MCP tool dispatch and privacy-safe context navigation formatting.
80
- - `src/services/codex-session-history-importer.ts` implements read-only scan/normalize/validate helpers in addition to existing explicit Codex import APIs.
81
- - `src/apps/cli/codex-import-runner.ts` implements the safe import command runner.
82
- - `src/apps/cli/index.ts` exposes the user-facing commands.