memento-mcp-server 1.29.0 → 1.30.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.
- package/INSTALL.en.md +12 -3
- package/INSTALL.md +12 -3
- package/LICENSE +21 -0
- package/README.en.md +44 -12
- package/README.md +47 -13
- package/dist/server/handlers/anchor-map.handler.d.ts.map +1 -1
- package/dist/server/handlers/anchor-map.handler.js +128 -61
- package/dist/server/handlers/anchor-map.handler.js.map +1 -1
- package/dist/server/http-server-websocket.d.ts.map +1 -1
- package/dist/server/http-server-websocket.js +2 -3
- package/dist/server/http-server-websocket.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/admin/admin-stats-and-health.routes.js +1 -1
- package/dist/server/routes/admin/admin-stats-and-health.routes.js.map +1 -1
- package/dist/server/routes/admin/admin-telemetry.routes.d.ts.map +1 -1
- package/dist/server/routes/admin/admin-telemetry.routes.js +1 -1
- package/dist/server/routes/admin/admin-telemetry.routes.js.map +1 -1
- package/dist/server/routes/admin/admin-tools.routes.d.ts.map +1 -1
- package/dist/server/routes/admin/admin-tools.routes.js +39 -1
- package/dist/server/routes/admin/admin-tools.routes.js.map +1 -1
- package/dist/server/routes/maintenance.routes.d.ts.map +1 -1
- package/dist/server/routes/maintenance.routes.js +55 -0
- package/dist/server/routes/maintenance.routes.js.map +1 -1
- package/dist/server/routes/mcp/message-processor.js +2 -3
- package/dist/server/routes/mcp/message-processor.js.map +1 -1
- package/dist/server/routes/tools.routes.d.ts.map +1 -1
- package/dist/server/routes/tools.routes.js +2 -3
- package/dist/server/routes/tools.routes.js.map +1 -1
- package/dist/telemetry-cli.d.ts +9 -23
- package/dist/telemetry-cli.d.ts.map +1 -1
- package/dist/telemetry-cli.js +28 -5
- package/dist/telemetry-cli.js.map +1 -1
- package/node_modules/@memento/agent-integration/README.md +33 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/adapter.d.ts +4 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/adapter.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/adapter.js +168 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/adapter.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/diagnostics.d.ts +15 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/diagnostics.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/diagnostics.js +46 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/diagnostics.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/runner.d.ts +3 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/runner.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/runner.js +45 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/runner.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/scope.d.ts +4 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/scope.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/scope.js +56 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/scope.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/settings.d.ts +34 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/settings.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/settings.js +88 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/settings.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/types.d.ts +37 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/types.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/types.js +8 -0
- package/node_modules/@memento/agent-integration/dist/claude-code/types.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/adapter.d.ts +4 -0
- package/node_modules/@memento/agent-integration/dist/codex/adapter.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/adapter.js +140 -0
- package/node_modules/@memento/agent-integration/dist/codex/adapter.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/diagnostics.d.ts +19 -0
- package/node_modules/@memento/agent-integration/dist/codex/diagnostics.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/diagnostics.js +40 -0
- package/node_modules/@memento/agent-integration/dist/codex/diagnostics.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/runner.d.ts +3 -0
- package/node_modules/@memento/agent-integration/dist/codex/runner.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/runner.js +42 -0
- package/node_modules/@memento/agent-integration/dist/codex/runner.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/scope.d.ts +4 -0
- package/node_modules/@memento/agent-integration/dist/codex/scope.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/scope.js +56 -0
- package/node_modules/@memento/agent-integration/dist/codex/scope.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/settings.d.ts +33 -0
- package/node_modules/@memento/agent-integration/dist/codex/settings.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/settings.js +80 -0
- package/node_modules/@memento/agent-integration/dist/codex/settings.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/types.d.ts +35 -0
- package/node_modules/@memento/agent-integration/dist/codex/types.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/codex/types.js +8 -0
- package/node_modules/@memento/agent-integration/dist/codex/types.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/index.d.ts +21 -0
- package/node_modules/@memento/agent-integration/dist/index.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/index.js +21 -0
- package/node_modules/@memento/agent-integration/dist/index.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/injection-contract.d.ts +59 -0
- package/node_modules/@memento/agent-integration/dist/injection-contract.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/injection-contract.js +113 -0
- package/node_modules/@memento/agent-integration/dist/injection-contract.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/normalize.d.ts +8 -0
- package/node_modules/@memento/agent-integration/dist/normalize.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/normalize.js +57 -0
- package/node_modules/@memento/agent-integration/dist/normalize.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/priority-queue.d.ts +16 -0
- package/node_modules/@memento/agent-integration/dist/priority-queue.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/priority-queue.js +63 -0
- package/node_modules/@memento/agent-integration/dist/priority-queue.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/redaction.d.ts +13 -0
- package/node_modules/@memento/agent-integration/dist/redaction.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/redaction.js +118 -0
- package/node_modules/@memento/agent-integration/dist/redaction.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/runtime.d.ts +30 -0
- package/node_modules/@memento/agent-integration/dist/runtime.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/runtime.js +197 -0
- package/node_modules/@memento/agent-integration/dist/runtime.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/schema.d.ts +330 -0
- package/node_modules/@memento/agent-integration/dist/schema.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/schema.js +257 -0
- package/node_modules/@memento/agent-integration/dist/schema.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/size-policy.d.ts +25 -0
- package/node_modules/@memento/agent-integration/dist/size-policy.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/size-policy.js +138 -0
- package/node_modules/@memento/agent-integration/dist/size-policy.js.map +1 -0
- package/node_modules/@memento/agent-integration/dist/types.d.ts +96 -0
- package/node_modules/@memento/agent-integration/dist/types.d.ts.map +1 -0
- package/node_modules/@memento/agent-integration/dist/types.js +8 -0
- package/node_modules/@memento/agent-integration/dist/types.js.map +1 -0
- package/node_modules/@memento/agent-integration/package.json +36 -0
- package/node_modules/@memento/core/README.md +1 -1
- package/node_modules/@memento/core/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/bootstrap.js +3 -1
- package/node_modules/@memento/core/dist/bootstrap.js.map +1 -1
- package/node_modules/@memento/core/dist/database/schema.sql +10 -6
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-interfaces.d.ts +2 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-interfaces.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-interfaces.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-manager.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-manager.js +1 -4
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-manager.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-search-service.d.ts +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-search-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-search-service.js +9 -6
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/anchor-search-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/local-search-service.d.ts +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/local-search-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/local-search-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-linked-memory-service.d.ts +10 -3
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-linked-memory-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-linked-memory-service.js +32 -21
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-linked-memory-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-search-service.d.ts +7 -2
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-search-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-search-service.js +31 -9
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-search-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-search-strategy.d.ts +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-search-strategy.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/n-hop-search-strategy.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/search-strategy-interfaces.d.ts +1 -1
- package/node_modules/@memento/core/dist/domains/anchor/services/anchor/search-strategy-interfaces.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/embedding/services/embedding-reindex-service.d.ts +76 -0
- package/node_modules/@memento/core/dist/domains/embedding/services/embedding-reindex-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/embedding/services/embedding-reindex-service.js +153 -12
- package/node_modules/@memento/core/dist/domains/embedding/services/embedding-reindex-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/introspection-healing-service.d.ts +72 -0
- package/node_modules/@memento/core/dist/domains/memory/services/introspection-healing-service.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/services/introspection-healing-service.js +171 -0
- package/node_modules/@memento/core/dist/domains/memory/services/introspection-healing-service.js.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/services/knowledge-context-bundle-builder.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/knowledge-context-bundle-builder.js +11 -0
- package/node_modules/@memento/core/dist/domains/memory/services/knowledge-context-bundle-builder.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/memory-embedding-service.d.ts +4 -1
- package/node_modules/@memento/core/dist/domains/memory/services/memory-embedding-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/memory-embedding-service.js +70 -67
- package/node_modules/@memento/core/dist/domains/memory/services/memory-embedding-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/meta-memory-service.d.ts +7 -0
- package/node_modules/@memento/core/dist/domains/memory/services/meta-memory-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/meta-memory-service.js +66 -33
- package/node_modules/@memento/core/dist/domains/memory/services/meta-memory-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-crud.d.ts +5 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-crud.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-crud.js +37 -2
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-crud.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-scoring.d.ts +4 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-scoring.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-scoring.js +21 -2
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-scoring.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-update-service.d.ts +2 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-update-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-update-service.js +2 -2
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/semantic-memory-update-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/triple-sentence.d.ts +25 -0
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/triple-sentence.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/triple-sentence.js +92 -0
- package/node_modules/@memento/core/dist/domains/memory/services/semantic-memory/triple-sentence.js.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/convert-episodic-to-semantic-tool.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/convert-episodic-to-semantic-tool.js +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/convert-episodic-to-semantic-tool.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/feedback-tool.js +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/feedback-tool.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/introspection-heal-tool.d.ts +16 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/introspection-heal-tool.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/introspection-heal-tool.js +73 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/introspection-heal-tool.js.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-envelope.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-envelope.js +9 -2
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-envelope.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-filters.d.ts +4 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-filters.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-filters.js +12 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-filters.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.d.ts +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.js +5 -2
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-post-search.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-schema.d.ts +10 -10
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-search-execution.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-search-execution.js +24 -4
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-search-execution.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-telemetry.d.ts +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-telemetry.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-telemetry.js +2 -2
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool-telemetry.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool.js +3 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/recall-tool.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-near-duplicate.d.ts +35 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-near-duplicate.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-near-duplicate.js +134 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-near-duplicate.js.map +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-augmentation.d.ts +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-augmentation.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-augmentation.js +40 -2
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-augmentation.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-host.d.ts +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-host.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-memory-item.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-memory-item.js +54 -32
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-memory-item.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-schema.d.ts +14 -14
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-types.d.ts +1 -0
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool-types.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool.js +18 -1
- package/node_modules/@memento/core/dist/domains/memory/tools/remember-tool.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/category-quality-aggregator.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/category-quality-aggregator.js +14 -1
- package/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/category-quality-aggregator.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/relation/services/relation-graph-query.js +2 -2
- package/node_modules/@memento/core/dist/domains/relation/services/relation-graph-query.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.d.ts +4 -0
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.js +14 -3
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.d.ts +2 -0
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.js +2 -0
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-types.d.ts +2 -0
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-types.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-vector-search-executor.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-vector-search-executor.js +12 -0
- package/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-vector-search-executor.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-sql-builder.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-sql-builder.js +20 -11
- package/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-sql-builder.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/search-result-combiner.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/search-result-combiner.js +4 -0
- package/node_modules/@memento/core/dist/domains/search/algorithms/search-result-combiner.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/vector-search-engine.d.ts +2 -0
- package/node_modules/@memento/core/dist/domains/search/algorithms/vector-search-engine.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/algorithms/vector-search-engine.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-hybrid-query.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-hybrid-query.js +106 -9
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-hybrid-query.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-knn-query.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-knn-query.js +67 -4
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-knn-query.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-result-mapper.d.ts +8 -0
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-result-mapper.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-result-mapper.js +30 -4
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-result-mapper.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-scope.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-scope.js +16 -2
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-scope.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search.types.d.ts +10 -0
- package/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search.types.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-feedback-quality-query.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-feedback-quality-query.js +17 -2
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-feedback-quality-query.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-memory-quality-query.d.ts +3 -2
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-memory-quality-query.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-memory-quality-query.js +23 -14
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-memory-quality-query.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.d.ts +13 -5
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.js +5 -7
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-search-quality-query.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-search-quality-query.js +42 -8
- package/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-search-quality-query.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/services/telemetry-service.d.ts +2 -2
- package/node_modules/@memento/core/dist/domains/telemetry/services/telemetry-service.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/services/telemetry-service.js +4 -4
- package/node_modules/@memento/core/dist/domains/telemetry/services/telemetry-service.js.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.js +10 -2
- package/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.js.map +1 -1
- package/node_modules/@memento/core/dist/index.d.ts +11 -2
- package/node_modules/@memento/core/dist/index.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/index.js +7 -1
- package/node_modules/@memento/core/dist/index.js.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/database/database/ensure-memory-embedding-metadata-defaults.d.ts +13 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/ensure-memory-embedding-metadata-defaults.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/ensure-memory-embedding-metadata-defaults.js +76 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/ensure-memory-embedding-metadata-defaults.js.map +1 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/init-legacy-schema.d.ts +2 -5
- package/node_modules/@memento/core/dist/infrastructure/database/database/init-legacy-schema.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/database/database/init-legacy-schema.js +9 -53
- package/node_modules/@memento/core/dist/infrastructure/database/database/init-legacy-schema.js.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/database/database/init.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/database/database/init.js +3 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/init.js.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/database/database/migrate.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/database/database/migrate.js +124 -137
- package/node_modules/@memento/core/dist/infrastructure/database/database/migrate.js.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/041-vec-cosine-metric.d.ts +25 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/041-vec-cosine-metric.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/041-vec-cosine-metric.js +89 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/migration/migrations/041-vec-cosine-metric.js.map +1 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/vec-schema.d.ts +71 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/vec-schema.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/vec-schema.js +177 -0
- package/node_modules/@memento/core/dist/infrastructure/database/database/vec-schema.js.map +1 -0
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-singleton.d.ts +6 -5
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-singleton.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-singleton.js +6 -14
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-singleton.js.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler.d.ts +3 -1
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler.js +15 -1
- package/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler.js.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-anchor-handlers.d.ts +9 -0
- package/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-anchor-handlers.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-anchor-handlers.js +33 -5
- package/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-anchor-handlers.js.map +1 -1
- package/node_modules/@memento/core/dist/shared/config/index.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/shared/config/index.js +3 -0
- package/node_modules/@memento/core/dist/shared/config/index.js.map +1 -1
- package/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.d.ts +1 -0
- package/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.js +8 -0
- package/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.js.map +1 -1
- package/node_modules/@memento/core/dist/shared/config/vector-search.config.d.ts +7 -0
- package/node_modules/@memento/core/dist/shared/config/vector-search.config.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/shared/config/vector-search.config.js +7 -0
- package/node_modules/@memento/core/dist/shared/config/vector-search.config.js.map +1 -1
- package/node_modules/@memento/core/dist/shared/ops/search-quality-cli-helpers.d.ts +8 -0
- package/node_modules/@memento/core/dist/shared/ops/search-quality-cli-helpers.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/shared/ops/search-quality-cli-helpers.js +8 -0
- package/node_modules/@memento/core/dist/shared/ops/search-quality-cli-helpers.js.map +1 -0
- package/node_modules/@memento/core/dist/shared/types/index.d.ts +4 -0
- package/node_modules/@memento/core/dist/shared/types/index.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/shared/types/relation-graph.d.ts +32 -0
- package/node_modules/@memento/core/dist/shared/types/relation-graph.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/shared/types/vector-search.types.d.ts +5 -0
- package/node_modules/@memento/core/dist/shared/types/vector-search.types.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/shared/utils/fts5-migration-status.js +9 -9
- package/node_modules/@memento/core/dist/shared/utils/fts5-migration-status.js.map +1 -1
- package/node_modules/@memento/core/dist/shared/utils/remember-dedup-config.d.ts +15 -0
- package/node_modules/@memento/core/dist/shared/utils/remember-dedup-config.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/shared/utils/remember-dedup-config.js +35 -0
- package/node_modules/@memento/core/dist/shared/utils/remember-dedup-config.js.map +1 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-benchmark-builder.d.ts +17 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-benchmark-builder.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-benchmark-builder.js +53 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-benchmark-builder.js.map +1 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-candidate-builder.d.ts +9 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-candidate-builder.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-candidate-builder.js +21 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-candidate-builder.js.map +1 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-review-checklist.d.ts +7 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-review-checklist.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-review-checklist.js +112 -0
- package/node_modules/@memento/core/dist/test/helpers/search-quality-review-checklist.js.map +1 -0
- package/node_modules/@memento/core/dist/tools/flatten-tool-params.d.ts +10 -0
- package/node_modules/@memento/core/dist/tools/flatten-tool-params.d.ts.map +1 -0
- package/node_modules/@memento/core/dist/tools/flatten-tool-params.js +69 -0
- package/node_modules/@memento/core/dist/tools/flatten-tool-params.js.map +1 -0
- package/node_modules/@memento/core/dist/tools/index.d.ts +15 -0
- package/node_modules/@memento/core/dist/tools/index.d.ts.map +1 -1
- package/node_modules/@memento/core/dist/tools/index.js +42 -3
- package/node_modules/@memento/core/dist/tools/index.js.map +1 -1
- package/node_modules/@memento/core/package.json +35 -0
- package/package.json +24 -15
- package/scripts/__tests__/legacy-script-removal.spec.ts +15 -34
- package/scripts/__tests__/legacy-script-verification.spec.ts +11 -35
- package/scripts/__tests__/registered-ops-cli-smoke.spec.ts +68 -0
- package/scripts/__tests__/registered-ops-no-root-src.spec.ts +31 -0
- package/scripts/__tests__/registered-ops-script-paths.ts +174 -0
- package/scripts/acquire-locomo.spec.ts +26 -0
- package/scripts/acquire-locomo.ts +88 -0
- package/scripts/agent-memory-benchmark-adapter.spec.ts +62 -0
- package/scripts/agent-memory-benchmark-adapter.ts +262 -0
- package/scripts/agent-memory-benchmark.spec.ts +90 -2
- package/scripts/agent-memory-benchmark.ts +258 -26
- package/scripts/agent-memory-production-adapter.spec.ts +23 -0
- package/scripts/agent-memory-production-adapter.ts +149 -0
- package/scripts/backup-embeddings.js +2 -4
- package/scripts/check-and-fix-trigger.ts +1 -2
- package/scripts/check-production-audit-fixable.mjs +86 -0
- package/scripts/debug-embeddings.js +1 -3
- package/scripts/export-search-quality-benchmark.ts +3 -4
- package/scripts/fix-tfidf-dimensions.ts +4 -5
- package/scripts/fix-vector-dimensions.js +3 -5
- package/scripts/generate-ground-truth.ts +11 -6
- package/scripts/generate-search-quality-candidates.ts +4 -4
- package/scripts/generate-search-quality-review-checklist.ts +1 -1
- package/scripts/log-issue-monitor/__tests__/sources.spec.ts +24 -6
- package/scripts/log-issue-monitor/sources.ts +6 -2
- package/scripts/longmemeval-validation.spec.ts +1 -1
- package/scripts/measure-mcp-tool-surface.ts +80 -0
- package/scripts/migrate-embedding-data.js +1 -3
- package/scripts/pack-with-restore.js +1 -1
- package/scripts/postpack-restore-workspace.js +47 -22
- package/scripts/prepack-bundle-core.js +55 -26
- package/scripts/quality-benchmark-category-report.spec.ts +20 -2
- package/scripts/quality-benchmark-category-report.ts +15 -4
- package/scripts/quality-report.ts +11 -3
- package/scripts/quality-thresholds.ts +1 -2
- package/scripts/regenerate-embeddings.js +3 -5
- package/scripts/repair-triple-sentence-memories.spec.ts +122 -0
- package/scripts/repair-triple-sentence-memories.ts +154 -0
- package/scripts/verify-bin.js +11 -0
- package/scripts/verify-npm-pack-bundle.js +222 -12
- package/scripts/archive/analyze-benchmark-test-data.ts +0 -219
- package/scripts/archive/check-convertible-episodic-memories.ts +0 -344
- package/scripts/archive/check-embedding-dimensions.ts +0 -119
- package/scripts/archive/fix-vec-table-dimensions.ts +0 -180
- package/scripts/archive/remove-benchmark-test-data.ts +0 -222
- package/scripts/check-db-integrity.js +0 -117
- package/scripts/fix-migration.js +0 -128
- package/scripts/run-migration.js +0 -159
- package/scripts/safe-migration.js +0 -200
- package/scripts/save-work-memory.ts +0 -156
- package/scripts/simple-migrate.js +0 -75
- package/scripts/simple-update.js +0 -164
package/INSTALL.en.md
CHANGED
|
@@ -10,6 +10,15 @@ How you install Memento depends on **how fast you want to try it** and **how muc
|
|
|
10
10
|
|
|
11
11
|
## 📋 Installation Method Selection
|
|
12
12
|
|
|
13
|
+
### 🧩 **Claude Code users: install the plugin**
|
|
14
|
+
```
|
|
15
|
+
/plugin marketplace add jee1/memento
|
|
16
|
+
/plugin install memento@memento
|
|
17
|
+
```
|
|
18
|
+
This registers the MCP server and ships a skill for the `recall` → `remember` loop. The memory database lives at `${CLAUDE_PLUGIN_DATA}/memory.db` and survives plugin updates.
|
|
19
|
+
|
|
20
|
+
Four MCP tools are advertised by default: `recall`, `remember`, `memory_injection`, and `feedback`. To reach the rest — anchors, procedural versioning, introspection — add `MEMENTO_TOOLSET=full` to the `memento` server's `env` block in your user or project MCP config (edits to the plugin's own `.mcp.json` are lost on update).
|
|
21
|
+
|
|
13
22
|
### 🥇 **1st Priority: One-click Installation (Recommended)**
|
|
14
23
|
```bash
|
|
15
24
|
# Run automatic installation script
|
|
@@ -87,9 +96,9 @@ npx memento-mcp-server@latest setup
|
|
|
87
96
|
npm install -g memento-mcp-server
|
|
88
97
|
|
|
89
98
|
# Usage
|
|
90
|
-
memento-mcp dev
|
|
91
|
-
memento-mcp start
|
|
92
|
-
memento-mcp setup
|
|
99
|
+
memento-mcp-server dev
|
|
100
|
+
memento-mcp-server start
|
|
101
|
+
memento-mcp-server setup
|
|
93
102
|
```
|
|
94
103
|
|
|
95
104
|
### 3. Docker Method
|
package/INSTALL.md
CHANGED
|
@@ -10,6 +10,15 @@ Memento를 설치하는 방법은 **얼마나 빨리 써 보고 싶은지**, **
|
|
|
10
10
|
|
|
11
11
|
## 📋 설치 방법 선택
|
|
12
12
|
|
|
13
|
+
### 🧩 **Claude Code 사용자: 플러그인 설치**
|
|
14
|
+
```
|
|
15
|
+
/plugin marketplace add jee1/memento
|
|
16
|
+
/plugin install memento@memento
|
|
17
|
+
```
|
|
18
|
+
MCP 서버 등록과 `recall`→`remember` 습관 skill이 함께 설치되고, 기억 DB는 `${CLAUDE_PLUGIN_DATA}/memory.db`에 보관되어 업데이트 후에도 유지됩니다.
|
|
19
|
+
|
|
20
|
+
기본으로 노출되는 MCP 도구는 `recall`·`remember`·`memory_injection`·`feedback` 4개입니다. 앵커·절차 버전관리·introspection 같은 나머지 도구까지 쓰려면 사용자/프로젝트 MCP 설정의 `memento` 서버 `env`에 `MEMENTO_TOOLSET=full`을 추가하세요 (플러그인 내부 `.mcp.json` 수정은 업데이트 시 사라집니다).
|
|
21
|
+
|
|
13
22
|
### 🥇 **1순위: 원클릭 설치 (권장)**
|
|
14
23
|
```bash
|
|
15
24
|
# 자동 설치 스크립트 실행
|
|
@@ -100,9 +109,9 @@ npx memento-mcp-server@latest dev
|
|
|
100
109
|
npm install -g memento-mcp-server
|
|
101
110
|
|
|
102
111
|
# 사용법
|
|
103
|
-
memento-mcp dev
|
|
104
|
-
memento-mcp start
|
|
105
|
-
memento-mcp setup
|
|
112
|
+
memento-mcp-server dev
|
|
113
|
+
memento-mcp-server start
|
|
114
|
+
memento-mcp-server setup
|
|
106
115
|
```
|
|
107
116
|
|
|
108
117
|
### 3. Docker 방식
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Memento Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.en.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
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
|
+
|
|
8
|
+
[](LICENSE)
|
|
7
9
|
</div>
|
|
8
10
|
|
|
9
11
|
---
|
|
@@ -30,15 +32,22 @@ The goal is not to make AI "pretend to remember." It's to make AI an **agent tha
|
|
|
30
32
|
|
|
31
33
|
### 📦 Monorepo Structure
|
|
32
34
|
|
|
33
|
-
This repository is an **npm workspaces** monorepo. `@memento/core` holds domain logic, the database, and MCP tools; `memento-server` exposes them over stdio and HTTP. Use `@memento
|
|
35
|
+
This repository is an **npm workspaces** monorepo. `@memento/core` holds domain logic, the database, and MCP tools; `memento-server` exposes them over stdio and HTTP. Use `@jee1/memento-client` for REST from your apps, `@jee1/memento-assistant` to wire external assistants, and `@memento/agent-integration` for session and provenance contracts — the latter is **internal only** and is not published to npm (it ships bundled inside the server tarball). Experiments live under `apps/`.
|
|
36
|
+
|
|
37
|
+
Three packages are published to npm: `memento-mcp-server` (the server), `@jee1/memento-client`, and `@jee1/memento-assistant`.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm i @jee1/memento-client # REST client
|
|
41
|
+
npm i @jee1/memento-assistant # auto recall/save SDK for external assistants
|
|
42
|
+
```
|
|
34
43
|
|
|
35
44
|
| Path | Description |
|
|
36
45
|
|------|-------------|
|
|
37
46
|
| **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
47
|
| **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
|
|
40
|
-
| **packages/memento-assistant** (`@memento
|
|
41
|
-
| **packages/memento-agent-integration** (`@memento/agent-integration`) | Agent integration contracts and adapters. |
|
|
48
|
+
| **packages/memento-client** (`@jee1/memento-client`) | Client library for connecting to the server. |
|
|
49
|
+
| **packages/memento-assistant** (`@jee1/memento-assistant`) | SDK for external AI assistants (recall/remember). |
|
|
50
|
+
| **packages/memento-agent-integration** (`@memento/agent-integration`) | Agent integration contracts and adapters. Internal only (`private`), not published to npm. |
|
|
42
51
|
| **apps/** | Experimental apps (e.g., `experimental-example` uses `@memento/core` in-process). |
|
|
43
52
|
|
|
44
53
|
For detailed structure, build, and test commands, see [AGENTS.md](AGENTS.md).
|
|
@@ -64,6 +73,27 @@ npx memento-mcp-server@latest start
|
|
|
64
73
|
|
|
65
74
|
**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).
|
|
66
75
|
|
|
76
|
+
### Claude Code Plugin (recommended — zero config)
|
|
77
|
+
|
|
78
|
+
This repository is itself a plugin marketplace. Installing the plugin registers the MCP server and ships a skill that teaches the `recall` → `remember` loop.
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
/plugin marketplace add jee1/memento
|
|
82
|
+
/plugin install memento@memento
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The memory database lives at `${CLAUDE_PLUGIN_DATA}/memory.db`, so it survives plugin updates. After installing, check the `/plugin` panel to confirm the `memento` MCP server is connected.
|
|
86
|
+
|
|
87
|
+
### Official MCP Registry
|
|
88
|
+
|
|
89
|
+
Memento is listed in the official MCP registry as `io.github.jee1/memento-mcp-server`. Registry-aware clients and marketplaces resolve it by that name.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.jee1/memento-mcp-server"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The listing metadata lives in the root [`server.json`](server.json); every stable release publishes it automatically from `release.yml` after the npm publish (pre-releases are not listed).
|
|
96
|
+
|
|
67
97
|
### Docker Method (For Production)
|
|
68
98
|
```bash
|
|
69
99
|
docker-compose -f docker-compose.dev.yml up -d # Development
|
|
@@ -94,7 +124,7 @@ With this setup, all agents connect to one HTTP/WebSocket interface, and the SQL
|
|
|
94
124
|
|
|
95
125
|
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)
|
|
96
126
|
|
|
97
|
-
Use the `@memento
|
|
127
|
+
Use the `@jee1/memento-assistant` SDK for automatic recall/remember in two lines of code — [SDK quickstart](./docs/integrations/_shared/sdk-quickstart.md)
|
|
98
128
|
|
|
99
129
|
## 🛠️ Usage
|
|
100
130
|
|
|
@@ -102,7 +132,7 @@ Three ways to connect to Memento:
|
|
|
102
132
|
|
|
103
133
|
- **mcp.json config**: Register Memento in MCP host apps like Claude Desktop, Cursor, or Claude Code — no code required
|
|
104
134
|
- **MCP protocol** (`@modelcontextprotocol/sdk`): Connect directly from custom agent code
|
|
105
|
-
- **HTTP API client** (`@memento
|
|
135
|
+
- **HTTP API client** (`@jee1/memento-client`): Call Memento's REST API from TypeScript/JavaScript applications
|
|
106
136
|
|
|
107
137
|
### mcp.json Config (Claude Desktop · Cursor · Claude Code)
|
|
108
138
|
|
|
@@ -206,12 +236,12 @@ const results = await client.callTool({
|
|
|
206
236
|
});
|
|
207
237
|
```
|
|
208
238
|
|
|
209
|
-
### HTTP API Client (`@memento
|
|
239
|
+
### HTTP API Client (`@jee1/memento-client`)
|
|
210
240
|
|
|
211
|
-
`@memento
|
|
241
|
+
`@jee1/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.
|
|
212
242
|
|
|
213
243
|
```typescript
|
|
214
|
-
import { MementoClient } from "@memento
|
|
244
|
+
import { MementoClient } from "@jee1/memento-client";
|
|
215
245
|
|
|
216
246
|
const client = new MementoClient({
|
|
217
247
|
serverUrl: "http://localhost:9001",
|
|
@@ -241,7 +271,7 @@ await client.forget(result.memory_id);
|
|
|
241
271
|
|
|
242
272
|
### Core Memory Management (MCP Client)
|
|
243
273
|
|
|
244
|
-
22 tools are
|
|
274
|
+
22 tools are registered, but `tools/list` advertises only four by default (v1.18+): `recall`, `remember`, `memory_injection`, `feedback`. Tool definitions occupy the client's context for the whole session, and Memento is a server people leave running — trimming the default listing cuts that from ~5,860 to ~2,954 estimated tokens (49.6%). The other 18 stay registered and callable; they are only withheld from the listing. Set `MEMENTO_TOOLSET=full` to advertise all of them. Operational functions (anchor restore, embedding migration, episodic→semantic conversion, meta stats) remain HTTP API only.
|
|
245
275
|
|
|
246
276
|
- **Memory storage**: `working`, `episodic`, `semantic`, `procedural` types
|
|
247
277
|
- **Memory search**: Hybrid search (FTS5 text + vector)
|
|
@@ -433,6 +463,8 @@ npm run test -- --watch
|
|
|
433
463
|
npm run test -- --coverage
|
|
434
464
|
```
|
|
435
465
|
|
|
466
|
+
Retrieval quality against public datasets (LongMemEval-S, LoCoMo) runs through the same harness: acquire with `npm run quality:longmemeval:acquire` / `npm run quality:locomo:acquire`, then run `npm run quality:locomo:benchmark`. Raw datasets are never committed, and LoCoMo is **CC BY-NC 4.0 (NonCommercial)**, so its numbers cannot back commercial claims. The procedure and current results live in [benchmark-datasets.md](docs/_work/testing/ko/benchmark-datasets.md); the production search path does not yet beat a plain FTS baseline, so these figures are kept as an internal regression metric rather than published.
|
|
467
|
+
|
|
436
468
|
## 📚 Developer Guidelines
|
|
437
469
|
|
|
438
470
|
- **Project structure**: npm workspaces — `packages/memento-core`, `packages/memento-server`, `packages/memento-client`, `apps/*`. See [AGENTS.md](AGENTS.md).
|
|
@@ -465,7 +497,7 @@ npm run test -- --coverage
|
|
|
465
497
|
|
|
466
498
|
Memento is designed to grow: from a personal local server, through team collaboration, to an organization-scale memory platform.
|
|
467
499
|
|
|
468
|
-
**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). 22 MCP tools, management functions separated into HTTP API.
|
|
500
|
+
**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). 22 registered MCP tools with four listed by default (`MEMENTO_TOOLSET=full` lists all), management functions separated into HTTP API.
|
|
469
501
|
|
|
470
502
|
**M2: Team (planned)** — SQLite server mode, API Key auth, Docker single container. Multiple teammates share one memory backend.
|
|
471
503
|
|
|
@@ -490,7 +522,7 @@ npm run test
|
|
|
490
522
|
|
|
491
523
|
## 📄 License
|
|
492
524
|
|
|
493
|
-
MIT License.
|
|
525
|
+
This project is released under the [MIT License](LICENSE). Matches `package.json` `"license": "MIT"`.
|
|
494
526
|
|
|
495
527
|
## 📞 Support
|
|
496
528
|
|
package/README.md
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
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
|
+
|
|
8
|
+
[](LICENSE)
|
|
7
9
|
</div>
|
|
8
10
|
|
|
9
11
|
---
|
|
@@ -30,15 +32,22 @@ AI가 "기억하는 척"하는 것이 아니라, 기억을 생성·분류·강
|
|
|
30
32
|
|
|
31
33
|
### 📦 모노레포 구조
|
|
32
34
|
|
|
33
|
-
이 저장소는 **npm workspaces** 모노레포입니다. `@memento/core`가 도메인·DB·MCP 도구를 담고, `memento-server`가 stdio/HTTP로 이를 노출합니다. 앱이나 스크립트에서 REST로 붙을 때는 `@memento
|
|
35
|
+
이 저장소는 **npm workspaces** 모노레포입니다. `@memento/core`가 도메인·DB·MCP 도구를 담고, `memento-server`가 stdio/HTTP로 이를 노출합니다. 앱이나 스크립트에서 REST로 붙을 때는 `@jee1/memento-client`, OpenClaw 같은 외부 비서에는 `@jee1/memento-assistant`, 에이전트 세션·프로버넌스 계약은 `@memento/agent-integration`이 담당하지만 이는 **내부 전용 패키지**로 npm에 발행되지 않습니다(서버 tarball에 번들). 실험 코드는 `apps/` 아래에 두었습니다.
|
|
36
|
+
|
|
37
|
+
npm에 발행되는 패키지는 셋입니다: `memento-mcp-server`(서버), `@jee1/memento-client`, `@jee1/memento-assistant`.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm i @jee1/memento-client # REST 클라이언트
|
|
41
|
+
npm i @jee1/memento-assistant # 외부 비서용 auto-recall/save SDK
|
|
42
|
+
```
|
|
34
43
|
|
|
35
44
|
| 경로 | 설명 |
|
|
36
45
|
|------|------|
|
|
37
46
|
| **packages/memento-core** (`@memento/core`) | 도메인·인프라·공유 라이브러리. 진입점: `createMementoCore`, `createToolContext`, `getToolRegistry`, `closeDatabase`. DB 초기화·마이그레이션은 루트에서 `npm run db:init` / `npm run db:migrate`로 실행. |
|
|
38
47
|
| **packages/memento-server** | core를 사용하는 MCP/HTTP 서버. 루트 `npm run dev`, `npm start`, `npm run dev:http` 등으로 실행. |
|
|
39
|
-
| **packages/memento-client** (`@memento
|
|
40
|
-
| **packages/memento-assistant** (`@memento
|
|
41
|
-
| **packages/memento-agent-integration** (`@memento/agent-integration`) | 에이전트 통합 계약·어댑터. |
|
|
48
|
+
| **packages/memento-client** (`@jee1/memento-client`) | 서버 연결용 클라이언트 라이브러리. |
|
|
49
|
+
| **packages/memento-assistant** (`@jee1/memento-assistant`) | 외부 AI 비서용 recall/remember SDK. |
|
|
50
|
+
| **packages/memento-agent-integration** (`@memento/agent-integration`) | 에이전트 통합 계약·어댑터. 내부 전용(`private`), npm 미발행. |
|
|
42
51
|
| **apps/** | 실험용 앱 (예: `experimental-example`은 `@memento/core`를 in-process로 사용). |
|
|
43
52
|
|
|
44
53
|
상세 구조·빌드·테스트 명령은 [AGENTS.md](AGENTS.md)를 참조하세요.
|
|
@@ -75,6 +84,27 @@ npx memento-mcp-server@latest setup
|
|
|
75
84
|
|
|
76
85
|
**반복 사용 시 주의**: 매번 npx로 실행하면 다운로드가 발생할 수 있으므로 반복 사용에는 **글로벌 설치**(`npm i -g memento-mcp-server`) 또는 로컬 설치 후 `./node_modules/.bin/memento` 사용을 권장합니다. 모드 구분: MCP 서버(`memento-mcp-server` / stdio), HTTP 서버(`memento-dev`), CLI(`memento` — recall, remember, forget, memory_injection). CLI 가이드: [docs/guides/ko/memento-cli-for-ai.md](docs/guides/ko/memento-cli-for-ai.md).
|
|
77
86
|
|
|
87
|
+
### Claude Code 플러그인 (권장 — 설정 없이 한 번에)
|
|
88
|
+
|
|
89
|
+
이 저장소 자체가 플러그인 마켓플레이스입니다. MCP 서버 등록과 `recall`→`remember` 사용 습관 skill이 함께 설치됩니다.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
/plugin marketplace add jee1/memento
|
|
93
|
+
/plugin install memento@memento
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
기억 DB는 `${CLAUDE_PLUGIN_DATA}/memory.db`에 저장되어 플러그인을 업데이트해도 유지됩니다. 설치 후 `/plugin` 패널에서 `memento` MCP 서버가 연결됐는지 확인하세요.
|
|
97
|
+
|
|
98
|
+
### MCP 공식 레지스트리
|
|
99
|
+
|
|
100
|
+
Memento는 MCP 공식 레지스트리에 `io.github.jee1/memento-mcp-server` 이름으로 등재됩니다. 레지스트리를 읽는 클라이언트·마켓플레이스에서 이 이름으로 찾을 수 있습니다.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
curl "https://registry.modelcontextprotocol.io/v0.1/servers?search=io.github.jee1/memento-mcp-server"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
등재 메타데이터는 루트 [`server.json`](server.json)에 있고, 정식 릴리스마다 `release.yml`이 npm 배포 후 버전을 맞춰 자동으로 갱신합니다 (pre-release는 등재하지 않습니다).
|
|
107
|
+
|
|
78
108
|
### Docker 방식 (프로덕션용)
|
|
79
109
|
```bash
|
|
80
110
|
docker-compose -f docker-compose.dev.yml up -d # 개발
|
|
@@ -138,7 +168,7 @@ npm run build && npm run start:http # 프로덕션
|
|
|
138
168
|
|
|
139
169
|
OpenClaw / NanoClaw / ZeroClaw 같은 개인 AI 비서가 Memento를 공유 장기 기억 백엔드로 사용할 수 있습니다. 가이드: [docs/integrations/](./docs/integrations/README.md)
|
|
140
170
|
|
|
141
|
-
`@memento
|
|
171
|
+
`@jee1/memento-assistant` SDK를 사용하면 자동 recall/remember를 코드 두 줄로 붙일 수 있습니다 — [SDK quickstart](./docs/integrations/_shared/sdk-quickstart.md)
|
|
142
172
|
|
|
143
173
|
## 💡 사용 예시
|
|
144
174
|
|
|
@@ -199,7 +229,7 @@ await client.callTool({
|
|
|
199
229
|
|
|
200
230
|
- **mcp.json 설정**: Claude Desktop, Cursor, Claude Code 등 MCP 호스트에 Memento를 등록하는 방식 (코드 불필요)
|
|
201
231
|
- **MCP 프로토콜** (`@modelcontextprotocol/sdk`): 커스텀 에이전트 코드에서 MCP 프로토콜로 직접 연결하는 방식
|
|
202
|
-
- **HTTP API 클라이언트** (`@memento
|
|
232
|
+
- **HTTP API 클라이언트** (`@jee1/memento-client`): TypeScript/JavaScript 코드에서 Memento 서버의 REST API를 프로그래밍 방식으로 사용하는 방식
|
|
203
233
|
|
|
204
234
|
### 0. mcp.json 설정 (Claude Desktop · Cursor · Claude Code)
|
|
205
235
|
|
|
@@ -308,12 +338,12 @@ const results = await client.callTool({
|
|
|
308
338
|
});
|
|
309
339
|
```
|
|
310
340
|
|
|
311
|
-
### 2. HTTP API 클라이언트 (`@memento
|
|
341
|
+
### 2. HTTP API 클라이언트 (`@jee1/memento-client`)
|
|
312
342
|
|
|
313
|
-
`@memento
|
|
343
|
+
`@jee1/memento-client`는 MCP 프로토콜이 아닌 **HTTP REST API 래퍼**입니다. TypeScript/JavaScript 애플리케이션에서 `/tools/*` 엔드포인트를 직접 호출할 때 사용합니다.
|
|
314
344
|
|
|
315
345
|
```typescript
|
|
316
|
-
import { MementoClient } from "@memento
|
|
346
|
+
import { MementoClient } from "@jee1/memento-client";
|
|
317
347
|
|
|
318
348
|
const client = new MementoClient({
|
|
319
349
|
serverUrl: "http://localhost:9001",
|
|
@@ -405,9 +435,11 @@ http://localhost:9001/graph
|
|
|
405
435
|
|
|
406
436
|
## 📋 API 문서
|
|
407
437
|
|
|
408
|
-
### MCP Tools (
|
|
438
|
+
### MCP Tools (등록 22개, 기본 노출 4개)
|
|
409
439
|
|
|
410
|
-
> **중요**:
|
|
440
|
+
> **중요**: 서버에는 도구 22개가 등록되어 있지만, `tools/list`에는 기본적으로 **`recall`·`remember`·`memory_injection`·`feedback` 4개만** 노출됩니다(v1.18+). 도구 정의는 세션 내내 클라이언트 컨텍스트를 점유하므로, 늘 켜두는 서버일수록 기본 표면을 줄이는 편이 낫습니다(측정: 5,860 → 2,954 추정 토큰, 49.6% 감소).
|
|
441
|
+
>
|
|
442
|
+
> 나머지 18개는 **등록된 채로 남아 호출은 그대로 됩니다** — 목록에서만 빠집니다. 전부 나열하려면 `MEMENTO_TOOLSET=full`을 설정하세요. 관리/운영성 기능(앵커 복원, 임베딩 마이그레이션, Episodic→Semantic 변환, 메타 메모리 통계)은 여전히 HTTP API로만 제공됩니다.
|
|
411
443
|
|
|
412
444
|
#### 기본 메모리 관리 (8개)
|
|
413
445
|
| Tool | 설명 | 파라미터 |
|
|
@@ -581,6 +613,8 @@ npm run test -- --watch
|
|
|
581
613
|
npm run test -- --coverage
|
|
582
614
|
```
|
|
583
615
|
|
|
616
|
+
공개 데이터셋(LongMemEval-S·LoCoMo)으로 검색 품질을 재는 하네스는 `npm run quality:longmemeval:acquire`·`npm run quality:locomo:acquire`로 데이터를 받은 뒤 `npm run quality:locomo:benchmark`로 돌립니다. 원본 데이터는 커밋하지 않으며, LoCoMo는 **CC BY-NC 4.0(비상업)** 이라 상업적 사용이 불가합니다. 절차와 현재 수치는 [benchmark-datasets.md](docs/_work/testing/ko/benchmark-datasets.md)에 있고, 프로덕션 검색이 단순 FTS 베이스라인을 넘지 못한 상태라 대외 수치로 쓰지 않습니다.
|
|
617
|
+
|
|
584
618
|
## 📚 개발자 가이드라인
|
|
585
619
|
|
|
586
620
|
- **프로젝트 구조**: npm workspaces 모노레포 — `packages/memento-core`, `packages/memento-server`, `packages/memento-client`, `apps/*`. 상세: [AGENTS.md](AGENTS.md)
|
|
@@ -613,7 +647,7 @@ npm run test -- --coverage
|
|
|
613
647
|
|
|
614
648
|
Memento는 개인용 로컬 서버로 시작해, 팀 협업을 거쳐, 조직 규모의 메모리 플랫폼으로 성장하도록 설계되어 있다.
|
|
615
649
|
|
|
616
|
-
**M1: 개인용 (현재)** — 지금 사용할 수 있는 형태다. SQLite 임베디드, FTS5 + sqlite-vec 인덱스, 로컬 실행. **인증**: 브라우저 세션 + 헤더 기반 분리 신뢰 모델(`/auth/session` 쿠키 세션, `/admin`·`/api` 브라우저 세션 요구, `/tools`·`/mcp`는 Bearer/API-Key 요구). 22개
|
|
650
|
+
**M1: 개인용 (현재)** — 지금 사용할 수 있는 형태다. SQLite 임베디드, FTS5 + sqlite-vec 인덱스, 로컬 실행. **인증**: 브라우저 세션 + 헤더 기반 분리 신뢰 모델(`/auth/session` 쿠키 세션, `/admin`·`/api` 브라우저 세션 요구, `/tools`·`/mcp`는 Bearer/API-Key 요구). MCP 도구 22개 등록·기본 노출 4개(`MEMENTO_TOOLSET=full`로 전체), 관리 기능은 HTTP API로 분리.
|
|
617
651
|
|
|
618
652
|
**M2: 팀 협업 (계획)** — SQLite 서버 모드, API Key 인증, Docker 단일 컨테이너. 여러 팀원이 하나의 기억 백엔드를 공유한다.
|
|
619
653
|
|
|
@@ -667,7 +701,7 @@ npm run test
|
|
|
667
701
|
|
|
668
702
|
## 📄 라이선스
|
|
669
703
|
|
|
670
|
-
MIT
|
|
704
|
+
이 프로젝트는 [MIT License](LICENSE) 하에 배포됩니다. `package.json`의 `"license": "MIT"` 와 동일합니다.
|
|
671
705
|
|
|
672
706
|
## 📞 지원
|
|
673
707
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anchor-map.handler.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/anchor-map.handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAGpC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,kBAAkB,EAAE,CAa9E;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"anchor-map.handler.d.ts","sourceRoot":"","sources":["../../../src/server/handlers/anchor-map.handler.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAGpC;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,kBAAkB,EAAE,CAa9E;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,aAAa,CAAC,CAoCxB;AAoPD;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,GAAG,CAAC,SAAS,CAAC,EAC3B,UAAU,EAAE,aAAa,GACxB,IAAI,CAeN;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI,EAC5B,cAAc,EAAE,cAAc,GAAG,IAAI,EACrC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,EACjD,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
|
|
@@ -41,7 +41,7 @@ export async function buildAnchorMapData(db, serverServices, agentId) {
|
|
|
41
41
|
}
|
|
42
42
|
const anchorList = Array.isArray(anchors) ? anchors : [anchors];
|
|
43
43
|
// 네트워크 노드 및 링크 생성
|
|
44
|
-
const { nodes, links } = await buildNetworkNodesAndLinks(db, anchorManager, agentId, anchorList);
|
|
44
|
+
const { nodes, links } = await buildNetworkNodesAndLinks(db, anchorManager, agentId, anchorList, serverServices.relationGraph);
|
|
45
45
|
return {
|
|
46
46
|
agent_id: agentId,
|
|
47
47
|
anchors: anchorList,
|
|
@@ -50,13 +50,67 @@ export async function buildAnchorMapData(db, serverServices, agentId) {
|
|
|
50
50
|
timestamp: new Date().toISOString()
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* 검색 결과 항목이 가리키는 predecessor id 목록을 얻는다.
|
|
55
|
+
* n-hop 검색이 여러 경로로 같은 메모리를 재발견하면 predecessor_ids(복수)에 모두 기록되므로
|
|
56
|
+
* (#715 MEDIUM#1), 있으면 그것을 우선하고 없으면 predecessor_id(단수)로 대체한다.
|
|
57
|
+
*/
|
|
58
|
+
function getPredecessorIds(item) {
|
|
59
|
+
const ids = item.predecessor_ids;
|
|
60
|
+
if (Array.isArray(ids)) {
|
|
61
|
+
return ids.filter((id) => typeof id === 'string');
|
|
62
|
+
}
|
|
63
|
+
return typeof item.predecessor_id === 'string' ? [item.predecessor_id] : [];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* hop 오름차순으로 경로 폐쇄성(path-closure)을 검증하며 노드/엣지를 확정한다.
|
|
67
|
+
* predecessor가 랭킹/limit/쿼리 필터로 탈락해 경로가 끊긴 hop≥2 노드는
|
|
68
|
+
* 부유(floating) 상태로 지도에 남기지 않고 제외한다 (#715 MEDIUM#2).
|
|
69
|
+
*/
|
|
70
|
+
function resolvePathClosedItems(items, anchorMemoryId) {
|
|
71
|
+
const itemsByHop = new Map();
|
|
72
|
+
for (const item of items) {
|
|
73
|
+
const hop = typeof item.hop_distance === 'number' ? item.hop_distance : 0;
|
|
74
|
+
const bucket = itemsByHop.get(hop) ?? [];
|
|
75
|
+
bucket.push(item);
|
|
76
|
+
itemsByHop.set(hop, bucket);
|
|
77
|
+
}
|
|
78
|
+
const reachableIds = new Set([anchorMemoryId]);
|
|
79
|
+
const reachableItems = [];
|
|
80
|
+
const edges = [];
|
|
81
|
+
const hopsAscending = Array.from(itemsByHop.keys())
|
|
82
|
+
.filter(hop => hop >= 1)
|
|
83
|
+
.sort((a, b) => a - b);
|
|
84
|
+
for (const hop of hopsAscending) {
|
|
85
|
+
for (const item of itemsByHop.get(hop) ?? []) {
|
|
86
|
+
if (hop === 1) {
|
|
87
|
+
reachableIds.add(item.id);
|
|
88
|
+
reachableItems.push(item);
|
|
89
|
+
edges.push({ source: anchorMemoryId, target: item.id, hop_distance: 1, similarity: item.similarity });
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const validPredecessorIds = getPredecessorIds(item).filter(id => reachableIds.has(id));
|
|
93
|
+
if (validPredecessorIds.length === 0) {
|
|
94
|
+
continue; // 경로가 끊긴 노드는 지도에 포함하지 않음
|
|
95
|
+
}
|
|
96
|
+
reachableIds.add(item.id);
|
|
97
|
+
reachableItems.push(item);
|
|
98
|
+
for (const predecessorId of validPredecessorIds) {
|
|
99
|
+
edges.push({ source: predecessorId, target: item.id, hop_distance: hop, similarity: item.similarity });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return { reachableItems, edges };
|
|
104
|
+
}
|
|
53
105
|
/**
|
|
54
106
|
* 네트워크 노드 및 링크 생성
|
|
55
107
|
*/
|
|
56
|
-
async function buildNetworkNodesAndLinks(db, anchorManager, agentId, anchorList) {
|
|
108
|
+
async function buildNetworkNodesAndLinks(db, anchorManager, agentId, anchorList, relationGraph) {
|
|
57
109
|
const nodes = [];
|
|
58
110
|
const links = [];
|
|
59
|
-
|
|
111
|
+
// 노드 dedup(메모리 id당 1개)과 별개로, slot→memory 엣지는 슬롯마다 생성한다
|
|
112
|
+
// (같은 메모리가 slot A/B에 모두 잡히면 노드는 1개, 엣지는 2개)
|
|
113
|
+
const nodeIds = new Set();
|
|
60
114
|
// 각 앵커에 대해 처리
|
|
61
115
|
for (const anchor of anchorList) {
|
|
62
116
|
if (!anchor.memory_id)
|
|
@@ -68,44 +122,52 @@ async function buildNetworkNodesAndLinks(db, anchorManager, agentId, anchorList)
|
|
|
68
122
|
WHERE id = ?
|
|
69
123
|
`).get(anchor.memory_id);
|
|
70
124
|
if (anchorMemory) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
125
|
+
if (!nodeIds.has(anchor.memory_id)) {
|
|
126
|
+
nodes.push({
|
|
127
|
+
id: anchor.memory_id,
|
|
128
|
+
type: 'anchor',
|
|
129
|
+
slot: anchor.slot,
|
|
130
|
+
content: anchorMemory.content.substring(0, 100),
|
|
131
|
+
importance: anchorMemory.importance,
|
|
132
|
+
created_at: anchorMemory.created_at
|
|
133
|
+
});
|
|
134
|
+
nodeIds.add(anchor.memory_id);
|
|
135
|
+
}
|
|
80
136
|
// 앵커 주변 메모리 검색
|
|
81
137
|
try {
|
|
82
138
|
const slotConfig = anchorManager.getSlotConfig(anchor.slot);
|
|
83
139
|
const searchResult = await anchorManager.searchLocal(agentId, anchor.slot, undefined, slotConfig.hop_limit, { limit: 50 });
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
target: item.id,
|
|
103
|
-
type: 'hop',
|
|
104
|
-
hop_distance: 1,
|
|
105
|
-
similarity: item.similarity
|
|
140
|
+
const anchorNode = nodes.find(n => n.id === anchor.memory_id);
|
|
141
|
+
if (anchorNode && searchResult.anchor_info?.embedding_missing) {
|
|
142
|
+
anchorNode.embedding_missing = true;
|
|
143
|
+
}
|
|
144
|
+
// hop 오름차순으로 경로 폐쇄성을 검증해, predecessor가 랭킹/limit/쿼리 필터로
|
|
145
|
+
// 탈락한 hop≥2 노드는 부유(floating) 상태로 남기지 않고 제외한다 (#715 MEDIUM#2).
|
|
146
|
+
// 노드 dedup과 별개로, 하나의 메모리로 여러 경로가 합류하면 edge는 모두 보존한다 (#715 MEDIUM#1).
|
|
147
|
+
const { reachableItems, edges } = resolvePathClosedItems(searchResult.items, anchor.memory_id);
|
|
148
|
+
for (const item of reachableItems) {
|
|
149
|
+
if (!nodeIds.has(item.id)) {
|
|
150
|
+
nodes.push({
|
|
151
|
+
id: item.id,
|
|
152
|
+
type: 'memory',
|
|
153
|
+
content: item.content.substring(0, 100),
|
|
154
|
+
hop_distance: item.hop_distance || 0,
|
|
155
|
+
similarity: item.similarity,
|
|
156
|
+
importance: item.importance,
|
|
157
|
+
created_at: item.created_at
|
|
106
158
|
});
|
|
159
|
+
nodeIds.add(item.id);
|
|
107
160
|
}
|
|
108
161
|
}
|
|
162
|
+
for (const edge of edges) {
|
|
163
|
+
links.push({
|
|
164
|
+
source: edge.source,
|
|
165
|
+
target: edge.target,
|
|
166
|
+
type: 'hop',
|
|
167
|
+
hop_distance: edge.hop_distance,
|
|
168
|
+
similarity: edge.similarity
|
|
169
|
+
});
|
|
170
|
+
}
|
|
109
171
|
}
|
|
110
172
|
catch (error) {
|
|
111
173
|
const isEmbeddingMissing = error instanceof Error && error.name === 'EmbeddingNotFoundError';
|
|
@@ -123,48 +185,53 @@ async function buildNetworkNodesAndLinks(db, anchorManager, agentId, anchorList)
|
|
|
123
185
|
slot: anchor.slot,
|
|
124
186
|
error: error instanceof Error ? error.message : String(error)
|
|
125
187
|
});
|
|
188
|
+
throw error;
|
|
126
189
|
}
|
|
127
190
|
}
|
|
128
191
|
}
|
|
129
192
|
}
|
|
130
|
-
//
|
|
131
|
-
const
|
|
132
|
-
links.push(...
|
|
193
|
+
// memory_relation 테이블(RelationGraph)을 활용한 직접 연결 정보 추가
|
|
194
|
+
const relationLinks = await buildRelationLinks(relationGraph, nodeIds);
|
|
195
|
+
links.push(...relationLinks);
|
|
133
196
|
return { nodes, links };
|
|
134
197
|
}
|
|
135
198
|
/**
|
|
136
|
-
*
|
|
199
|
+
* RelationGraph(memory_relation)를 활용한 네트워크 링크 생성.
|
|
200
|
+
* 노드로 등록된 메모리끼리의 관계만 엣지로 반영하며, confidence를 가중치로 사용한다.
|
|
201
|
+
* hop 2/3의 anchor→memory 경로 엣지는 buildNetworkNodesAndLinks에서
|
|
202
|
+
* n-hop 검색 결과의 predecessor_id로 생성하므로(#715) 이 함수는 다루지 않는다.
|
|
137
203
|
*/
|
|
138
|
-
function
|
|
204
|
+
async function buildRelationLinks(relationGraph, nodeIds) {
|
|
139
205
|
const links = [];
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const linkedId = link.target_id || link.source_id;
|
|
155
|
-
if (linkedId && processedMemoryIds.has(linkedId)) {
|
|
156
|
-
// relation_type을 기반으로 similarity 추정
|
|
157
|
-
const similarity = link.relation_type === 'derived_from' ? 0.9 :
|
|
158
|
-
link.relation_type === 'cause_of' ? 0.8 : 0.7;
|
|
206
|
+
if (nodeIds.size === 0)
|
|
207
|
+
return links;
|
|
208
|
+
const memoryIds = Array.from(nodeIds);
|
|
209
|
+
try {
|
|
210
|
+
const relationsByMemory = await relationGraph.getRelationsBatch(memoryIds, { direction: 'both' });
|
|
211
|
+
const seenRelationIds = new Set();
|
|
212
|
+
for (const memoryId of memoryIds) {
|
|
213
|
+
for (const relation of relationsByMemory.get(memoryId) ?? []) {
|
|
214
|
+
if (seenRelationIds.has(relation.id))
|
|
215
|
+
continue;
|
|
216
|
+
const otherId = relation.source_id === memoryId ? relation.target_id : relation.source_id;
|
|
217
|
+
if (otherId === memoryId || !nodeIds.has(otherId))
|
|
218
|
+
continue;
|
|
219
|
+
seenRelationIds.add(relation.id);
|
|
159
220
|
links.push({
|
|
160
|
-
source:
|
|
161
|
-
target:
|
|
221
|
+
source: relation.source_id,
|
|
222
|
+
target: relation.target_id,
|
|
162
223
|
type: 'link',
|
|
163
|
-
similarity:
|
|
224
|
+
similarity: relation.confidence
|
|
164
225
|
});
|
|
165
226
|
}
|
|
166
227
|
}
|
|
167
228
|
}
|
|
229
|
+
catch (error) {
|
|
230
|
+
logger.error('Relation link lookup failed', {
|
|
231
|
+
error: error instanceof Error ? error.message : String(error)
|
|
232
|
+
});
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
168
235
|
return links;
|
|
169
236
|
}
|
|
170
237
|
/**
|