memento-mcp-server 2.1.0 → 2.2.1
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/dist/node_modules/@memento/core/dist/database/schema.sql +10 -3
- package/dist/node_modules/@memento/core/dist/domains/anchor/tools/restore-anchors-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/anchor/tools/search-local-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/anchor/tools/set-anchor-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/consolidation/services/cluster-judge.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/consolidation/services/cluster-judge.js +3 -0
- package/dist/node_modules/@memento/core/dist/domains/consolidation/services/cluster-judge.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/migration-execution.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/migration-execution.js +2 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/migration-execution.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/migration-rollback.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/migration-rollback.js +4 -2
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/migration-rollback.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/types.d.ts +2 -0
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service/types.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service.js +5 -3
- package/dist/node_modules/@memento/core/dist/domains/embedding/services/embedding-migration-service.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/forgetting/repositories/forgetting-event-repository.d.ts +1 -1
- package/dist/node_modules/@memento/core/dist/domains/forgetting/repositories/forgetting-event-repository.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/forgetting/repositories/forgetting-event-repository.js +2 -2
- package/dist/node_modules/@memento/core/dist/domains/forgetting/repositories/forgetting-event-repository.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/forgetting/services/forgetting-policy-service.d.ts +0 -4
- package/dist/node_modules/@memento/core/dist/domains/forgetting/services/forgetting-policy-service.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/forgetting/services/forgetting-policy-service.js +0 -42
- package/dist/node_modules/@memento/core/dist/domains/forgetting/services/forgetting-policy-service.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/introspection/get-introspection-summary-tool.js +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/introspection/get-introspection-summary-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/introspection/introspection-heal-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/procedural/procedural-llm-extractor.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/procedural/procedural-llm-extractor.js +2 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/procedural/procedural-llm-extractor.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-anchor-rotation.d.ts +3 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-anchor-rotation.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-anchor-rotation.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-direct.d.ts +6 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-direct.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-direct.js +2 -2
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-direct.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-envelope.d.ts +7 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-envelope.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-envelope.js +5 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-envelope.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-neighbors-fetch.d.ts +3 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-neighbors-fetch.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-neighbors-fetch.js +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-neighbors-fetch.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.d.ts +9 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.js +8 -8
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-post-search.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-search-execution.d.ts +4 -2
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-search-execution.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-search-execution.js +8 -2
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-search-execution.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-types.d.ts +7 -0
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool-types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool.js +65 -35
- package/dist/node_modules/@memento/core/dist/domains/memory/recall/recall-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-augmentation.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-augmentation.js +35 -19
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-augmentation.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-core.js +4 -4
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-core.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-db-helpers.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-db-helpers.js +4 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-db-helpers.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-memory-item.js +4 -4
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-memory-item.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-near-duplicate.js +2 -2
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-near-duplicate.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-vault.js +4 -4
- package/dist/node_modules/@memento/core/dist/domains/memory/remember/remember-tool-vault.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/services/memory-embedding-service.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/services/memory-embedding-service.js +20 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/services/memory-embedding-service.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/feedback-tool.js +3 -3
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/feedback-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/forget-tool.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/forget-tool.js +3 -2
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/forget-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/get-memory-neighbors-tool.js +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/get-memory-neighbors-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/memory-injection-prompt.js +2 -2
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/memory-injection-prompt.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/pin-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/memory/tools/unpin-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/category-quality-aggregator.d.ts +4 -2
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/category-quality-aggregator.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/category-quality-aggregator.js +21 -12
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/category-quality-aggregator.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.d.ts +2 -1
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.js +4 -0
- package/dist/node_modules/@memento/core/dist/domains/monitoring/services/quality-assurance/quality-metrics-collector.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/monitoring/tools/get-meta-memory-stats-tool.js +1 -1
- package/dist/node_modules/@memento/core/dist/domains/monitoring/tools/get-meta-memory-stats-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/personal-agent/config/personal-agent-llm-env.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/personal-agent/config/personal-agent-llm-env.js +2 -2
- package/dist/node_modules/@memento/core/dist/domains/personal-agent/config/personal-agent-llm-env.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/jev-relation-judge.d.ts +34 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/jev-relation-judge.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/jev-relation-judge.js +130 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/jev-relation-judge.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/llm-based-relation-extractor.d.ts +0 -6
- package/dist/node_modules/@memento/core/dist/domains/relation/services/llm-based-relation-extractor.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/llm-based-relation-extractor.js +2 -25
- package/dist/node_modules/@memento/core/dist/domains/relation/services/llm-based-relation-extractor.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-gemini.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-gemini.js +2 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/llm-relation-extractor/extract-relations-gemini.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-candidate-pool.d.ts +9 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-candidate-pool.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-candidate-pool.js +24 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-candidate-pool.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-extractor.d.ts +5 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-extractor.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-extractor.js +54 -3
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-extractor.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-graph-cycle-detector.d.ts +1 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-graph-cycle-detector.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-graph-cycle-detector.js +12 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/relation-graph-cycle-detector.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/remember-relation-extraction.d.ts +27 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/remember-relation-extraction.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/remember-relation-extraction.js +60 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/remember-relation-extraction.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/rule-based-relation-extractor.d.ts +5 -0
- package/dist/node_modules/@memento/core/dist/domains/relation/services/rule-based-relation-extractor.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/relation/services/rule-based-relation-extractor.js +10 -4
- package/dist/node_modules/@memento/core/dist/domains/relation/services/rule-based-relation-extractor.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.d.ts +3 -2
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.js +17 -7
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-engine.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.d.ts +4 -0
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.js +35 -5
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-provider-parallel.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-types.d.ts +12 -0
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-search-types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-vector-search-executor.d.ts +2 -0
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-vector-search-executor.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-vector-search-executor.js +3 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/hybrid-vector-search-executor.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-ranking.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-ranking.js +24 -50
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-engine/search-engine-ranking.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.d.ts +1 -2
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.js +3 -5
- package/dist/node_modules/@memento/core/dist/domains/search/algorithms/search-ranking.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/factories/hybrid-search.factory.d.ts +0 -2
- package/dist/node_modules/@memento/core/dist/domains/search/factories/hybrid-search.factory.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/factories/hybrid-search.factory.js +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/factories/hybrid-search.factory.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/ports/relevance-gate-port.d.ts +7 -8
- package/dist/node_modules/@memento/core/dist/domains/search/ports/relevance-gate-port.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/ports/relevance-gate-port.js +5 -6
- package/dist/node_modules/@memento/core/dist/domains/search/ports/relevance-gate-port.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-hybrid-query.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-hybrid-query.js +5 -1
- package/dist/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-hybrid-query.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-knn-query.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-knn-query.js +5 -1
- package/dist/node_modules/@memento/core/dist/domains/search/repositories/vector-search/vector-search-knn-query.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/services/relevance-gate/create-relevance-gate.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/services/relevance-gate/create-relevance-gate.js +3 -2
- package/dist/node_modules/@memento/core/dist/domains/search/services/relevance-gate/create-relevance-gate.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/services/relevance-gate/jev-relevance-gate.d.ts +8 -24
- package/dist/node_modules/@memento/core/dist/domains/search/services/relevance-gate/jev-relevance-gate.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/search/services/relevance-gate/jev-relevance-gate.js +55 -117
- package/dist/node_modules/@memento/core/dist/domains/search/services/relevance-gate/jev-relevance-gate.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.d.ts +6 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-repository.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-search-quality-query.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-search-quality-query.js +24 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/repositories/telemetry-search-quality-query.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-outcome-extra.d.ts +13 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-outcome-extra.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-outcome-extra.js +28 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-outcome-extra.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-reranked-extra.d.ts +3 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-reranked-extra.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-reranked-extra.js +10 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-reranked-extra.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/extra-keys.d.ts +10 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/extra-keys.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/extra-keys.js +10 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/extra-keys.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/index.d.ts +3 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/index.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/index.js +3 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/index.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.js +5 -2
- package/dist/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migrate.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migrate.js +8 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migrate.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/053-narrow-legacy-vec-allowlist.d.ts +13 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/053-narrow-legacy-vec-allowlist.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/053-narrow-legacy-vec-allowlist.js +122 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/053-narrow-legacy-vec-allowlist.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/054-memory-embedding-content-hash.d.ts +13 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/054-memory-embedding-content-hash.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/054-memory-embedding-content-hash.js +37 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migration/migrations/054-memory-embedding-content-hash.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/vec-schema.d.ts +2 -6
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/vec-schema.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/vec-schema.js +18 -10
- package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/vec-schema.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-create.d.ts +2 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-create.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-create.js +6 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-create.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-incremental.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-incremental.js +6 -2
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-incremental.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-replace.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-replace.js +3 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-replace.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-versioned.d.ts +2 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-versioned.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-versioned.js +3 -2
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-update-versioned.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service.d.ts +4 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service.js +17 -3
- package/dist/node_modules/@memento/core/dist/infrastructure/reflexion-procedural-memory-service.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.d.ts +2 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.js +4 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-recurring-schedules.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.d.ts +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.js +2 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-context.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-default-config.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-default-config.js +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-default-config.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-control.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-control.js +3 -2
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-control.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.d.ts +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.js +2 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-processor.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.d.ts +2 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.js +6 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-job-runners.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-service-wiring.d.ts +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-service-wiring.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-service-wiring.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-types.d.ts +2 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler-types.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.d.ts +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.js +5 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/batch-scheduler/batch-scheduler.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-embedding-handlers.d.ts +4 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-embedding-handlers.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-embedding-handlers.js +25 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/handlers/batch-scheduler-embedding-handlers.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/embedding-reconciliation-batch-job.d.ts +13 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/embedding-reconciliation-batch-job.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/embedding-reconciliation-batch-job.js +86 -0
- package/dist/node_modules/@memento/core/dist/infrastructure/scheduler/jobs/embedding-reconciliation-batch-job.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/config/constants.d.ts +13 -0
- package/dist/node_modules/@memento/core/dist/shared/config/constants.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/constants.js +13 -0
- package/dist/node_modules/@memento/core/dist/shared/config/constants.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/environment.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/environment.js +3 -2
- package/dist/node_modules/@memento/core/dist/shared/config/environment.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/index.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/index.js +8 -6
- package/dist/node_modules/@memento/core/dist/shared/config/index.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/llm-model-resolver.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/llm-model-resolver.js +2 -1
- package/dist/node_modules/@memento/core/dist/shared/config/llm-model-resolver.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/llm-provider-override.d.ts +2 -0
- package/dist/node_modules/@memento/core/dist/shared/config/llm-provider-override.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/llm-provider-override.js +5 -1
- package/dist/node_modules/@memento/core/dist/shared/config/llm-provider-override.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.d.ts +1 -0
- package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.js +1 -0
- package/dist/node_modules/@memento/core/dist/shared/config/ranking-weights-loader.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/relation-extraction-seat.d.ts +30 -0
- package/dist/node_modules/@memento/core/dist/shared/config/relation-extraction-seat.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/config/relation-extraction-seat.js +37 -0
- package/dist/node_modules/@memento/core/dist/shared/config/relation-extraction-seat.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/config/vector-search.config.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/config/vector-search.config.js +0 -1
- package/dist/node_modules/@memento/core/dist/shared/config/vector-search.config.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/constants/relation-constants.d.ts +6 -2
- package/dist/node_modules/@memento/core/dist/shared/constants/relation-constants.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/constants/relation-constants.js +6 -2
- package/dist/node_modules/@memento/core/dist/shared/constants/relation-constants.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/services/typesafe/system-one-client.d.ts +40 -0
- package/dist/node_modules/@memento/core/dist/shared/services/typesafe/system-one-client.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/services/typesafe/system-one-client.js +139 -0
- package/dist/node_modules/@memento/core/dist/shared/services/typesafe/system-one-client.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/types/benchmark.types.d.ts +26 -1
- package/dist/node_modules/@memento/core/dist/shared/types/benchmark.types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/types/benchmark.types.js +7 -0
- package/dist/node_modules/@memento/core/dist/shared/types/benchmark.types.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/types/memory.types.d.ts +6 -0
- package/dist/node_modules/@memento/core/dist/shared/types/memory.types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/types/migration.types.d.ts +1 -0
- package/dist/node_modules/@memento/core/dist/shared/types/migration.types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/types/relation-graph.d.ts +2 -5
- package/dist/node_modules/@memento/core/dist/shared/types/relation-graph.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/types/relation.d.ts +6 -2
- package/dist/node_modules/@memento/core/dist/shared/types/relation.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/types/relation.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/database/schema-initialization.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/database/schema-initialization.js +3 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/database/schema-initialization.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/ensure-memory-embedding-content-hash.d.ts +3 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/ensure-memory-embedding-content-hash.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/ensure-memory-embedding-content-hash.js +27 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/ensure-memory-embedding-content-hash.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-content-hash.d.ts +2 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-content-hash.d.ts.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-content-hash.js +5 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-content-hash.js.map +1 -0
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-embedding-write.d.ts +2 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-embedding-write.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-embedding-write.js +7 -4
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-embedding-write.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-filter-sql.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-filter-sql.js +34 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/memory-filter-sql.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/sql-security-validator.d.ts +0 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/sql-security-validator.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/sql-security-validator.js +0 -2
- package/dist/node_modules/@memento/core/dist/shared/utils/sql-security-validator.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/window-embedding-write.d.ts +2 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/window-embedding-write.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/shared/utils/window-embedding-write.js +26 -19
- package/dist/node_modules/@memento/core/dist/shared/utils/window-embedding-write.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/tools/base-tool.js +2 -2
- package/dist/node_modules/@memento/core/dist/tools/base-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/tools/index.js +1 -1
- package/dist/node_modules/@memento/core/dist/tools/index.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/tools/migrate-embeddings-tool.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/tools/migrate-embeddings-tool.js +2 -0
- package/dist/node_modules/@memento/core/dist/tools/migrate-embeddings-tool.js.map +1 -1
- package/dist/node_modules/@memento/core/dist/tools/types.d.ts +0 -2
- package/dist/node_modules/@memento/core/dist/tools/types.d.ts.map +1 -1
- package/dist/node_modules/@memento/core/dist/tools/types.js.map +1 -1
- package/dist/node_modules/@memento/core/package.json +1 -1
- package/dist/server/routes/admin/admin-batch.routes.d.ts.map +1 -1
- package/dist/server/routes/admin/admin-batch.routes.js +240 -257
- package/dist/server/routes/admin/admin-batch.routes.js.map +1 -1
- package/dist/server/routes/api.routes.d.ts.map +1 -1
- package/dist/server/routes/api.routes.js +7 -4
- package/dist/server/routes/api.routes.js.map +1 -1
- package/dist/server/routes/mcp/message-processor.d.ts.map +1 -1
- package/dist/server/routes/mcp/message-processor.js +5 -29
- package/dist/server/routes/mcp/message-processor.js.map +1 -1
- package/dist/telemetry-cli.d.ts.map +1 -1
- package/dist/telemetry-cli.js +3 -0
- package/dist/telemetry-cli.js.map +1 -1
- package/package.json +2 -1
package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/build-outcome-extra.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SEARCH_QUALITY_EXTRA_KEYS } from './extra-keys.js';
|
|
2
|
+
/**
|
|
3
|
+
* selected/empty extra의 단계 ms.
|
|
4
|
+
* `text_ms`는 hybrid면 텍스트 레인만, FTS-only면 `SearchEngine.search` 전체(`query_time`)다.
|
|
5
|
+
* p50·p95는 `retrieval_strategy`로 거른 뒤 낼 것. (#1386)
|
|
6
|
+
*/
|
|
7
|
+
export function recallOutcomeStageExtra(searchResult, postMs) {
|
|
8
|
+
const extra = {};
|
|
9
|
+
const stage = searchResult?.stage_ms;
|
|
10
|
+
if (stage) {
|
|
11
|
+
extra[SEARCH_QUALITY_EXTRA_KEYS.text_ms] = stage.text_ms;
|
|
12
|
+
if (stage.embedding_ms !== undefined) {
|
|
13
|
+
extra[SEARCH_QUALITY_EXTRA_KEYS.embedding_ms] = stage.embedding_ms;
|
|
14
|
+
}
|
|
15
|
+
if (stage.vector_ms !== undefined) {
|
|
16
|
+
extra[SEARCH_QUALITY_EXTRA_KEYS.vector_ms] = stage.vector_ms;
|
|
17
|
+
}
|
|
18
|
+
if (stage.gate_ms !== undefined) {
|
|
19
|
+
extra[SEARCH_QUALITY_EXTRA_KEYS.gate_ms] = stage.gate_ms;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else if (typeof searchResult?.query_time === 'number') {
|
|
23
|
+
extra[SEARCH_QUALITY_EXTRA_KEYS.text_ms] = searchResult.query_time;
|
|
24
|
+
}
|
|
25
|
+
extra[SEARCH_QUALITY_EXTRA_KEYS.post_ms] = postMs;
|
|
26
|
+
return extra;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=build-outcome-extra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-outcome-extra.js","sourceRoot":"","sources":["../../../../src/domains/telemetry/search-quality/build-outcome-extra.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAO5D;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAoD,EACpD,MAAc;IAEd,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,YAAY,EAAE,QAAQ,CAAC;IACrC,IAAI,KAAK,EAAE,CAAC;QACV,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QACzD,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;YACrC,KAAK,CAAC,yBAAyB,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,YAAY,CAAC;QACrE,CAAC;QACD,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YAClC,KAAK,CAAC,yBAAyB,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC;QAC/D,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC;QAC3D,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,YAAY,EAAE,UAAU,KAAK,QAAQ,EAAE,CAAC;QACxD,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC;IACrE,CAAC;IACD,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;IAClD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RelevanceGateOutcome } from '../../search/ports/relevance-gate-port.js';
|
|
2
|
+
export declare function rejectionGateTelemetryExtra(gate: Pick<RelevanceGateOutcome, 'verdict' | 'top_score'> | undefined): Record<string, string | number | null>;
|
|
3
|
+
//# sourceMappingURL=build-reranked-extra.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-reranked-extra.d.ts","sourceRoot":"","sources":["../../../../src/domains/telemetry/search-quality/build-reranked-extra.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGtF,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,WAAW,CAAC,GAAG,SAAS,GACpE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAMxC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SEARCH_QUALITY_EXTRA_KEYS } from './extra-keys.js';
|
|
2
|
+
export function rejectionGateTelemetryExtra(gate) {
|
|
3
|
+
if (gate === undefined)
|
|
4
|
+
return {};
|
|
5
|
+
return {
|
|
6
|
+
[SEARCH_QUALITY_EXTRA_KEYS.rejection_gate_verdict]: gate.verdict,
|
|
7
|
+
[SEARCH_QUALITY_EXTRA_KEYS.rejection_gate_top_score]: gate.top_score,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=build-reranked-extra.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-reranked-extra.js","sourceRoot":"","sources":["../../../../src/domains/telemetry/search-quality/build-reranked-extra.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,UAAU,2BAA2B,CACzC,IAAqE;IAErE,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO;QACL,CAAC,yBAAyB,CAAC,sBAAsB,CAAC,EAAE,IAAI,CAAC,OAAO;QAChE,CAAC,yBAAyB,CAAC,wBAAwB,CAAC,EAAE,IAAI,CAAC,SAAS;KACrE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const SEARCH_QUALITY_EXTRA_KEYS: {
|
|
2
|
+
readonly rejection_gate_verdict: "rejection_gate_verdict";
|
|
3
|
+
readonly rejection_gate_top_score: "rejection_gate_top_score";
|
|
4
|
+
readonly text_ms: "text_ms";
|
|
5
|
+
readonly embedding_ms: "embedding_ms";
|
|
6
|
+
readonly vector_ms: "vector_ms";
|
|
7
|
+
readonly gate_ms: "gate_ms";
|
|
8
|
+
readonly post_ms: "post_ms";
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=extra-keys.d.ts.map
|
package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/extra-keys.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extra-keys.d.ts","sourceRoot":"","sources":["../../../../src/domains/telemetry/search-quality/extra-keys.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB;;;;;;;;CAQ5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const SEARCH_QUALITY_EXTRA_KEYS = {
|
|
2
|
+
rejection_gate_verdict: 'rejection_gate_verdict',
|
|
3
|
+
rejection_gate_top_score: 'rejection_gate_top_score',
|
|
4
|
+
text_ms: 'text_ms',
|
|
5
|
+
embedding_ms: 'embedding_ms',
|
|
6
|
+
vector_ms: 'vector_ms',
|
|
7
|
+
gate_ms: 'gate_ms',
|
|
8
|
+
post_ms: 'post_ms',
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=extra-keys.js.map
|
package/dist/node_modules/@memento/core/dist/domains/telemetry/search-quality/extra-keys.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extra-keys.js","sourceRoot":"","sources":["../../../../src/domains/telemetry/search-quality/extra-keys.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,sBAAsB,EAAE,wBAAwB;IAChD,wBAAwB,EAAE,0BAA0B;IACpD,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;CACV,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/domains/telemetry/search-quality/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domains/telemetry/search-quality/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-telemetry-summary-tool.d.ts","sourceRoot":"","sources":["../../../../src/domains/telemetry/tools/get-telemetry-summary-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAiBvE,qBAAa,uBAAwB,SAAQ,QAAQ;;IAS7C,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"get-telemetry-summary-tool.d.ts","sourceRoot":"","sources":["../../../../src/domains/telemetry/tools/get-telemetry-summary-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAiBvE,qBAAa,uBAAwB,SAAQ,QAAQ;;IAS7C,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;CA6FzE"}
|
package/dist/node_modules/@memento/core/dist/domains/telemetry/tools/get-telemetry-summary-tool.js
CHANGED
|
@@ -32,9 +32,9 @@ export class GetTelemetrySummaryTool extends BaseTool {
|
|
|
32
32
|
return this.createErrorResult('Invalid period. Allowed: 24h, 7d, 30d');
|
|
33
33
|
}
|
|
34
34
|
// ALS context에서 ownerId 추출
|
|
35
|
-
const ownerId = context.services
|
|
35
|
+
const ownerId = context.services.telemetryService?.getContext()?.ownerId ?? null;
|
|
36
36
|
try {
|
|
37
|
-
const telemetryService = context.services
|
|
37
|
+
const telemetryService = context.services.telemetryService;
|
|
38
38
|
if (!telemetryService) {
|
|
39
39
|
return this.createErrorResult('TelemetryService가 초기화되지 않았습니다');
|
|
40
40
|
}
|
|
@@ -66,6 +66,9 @@ export class GetTelemetrySummaryTool extends BaseTool {
|
|
|
66
66
|
reranked_count: searchResult.reranked_count,
|
|
67
67
|
selected_count: searchResult.selected_count,
|
|
68
68
|
ranking_versions: searchResult.ranking_versions,
|
|
69
|
+
rejection_rate: searchResult.rejection_rate,
|
|
70
|
+
rejection_decided_count: searchResult.rejection_decided_count,
|
|
71
|
+
fail_open_count: searchResult.fail_open_count,
|
|
69
72
|
},
|
|
70
73
|
memory_quality: {
|
|
71
74
|
total_memories: memoryResult.total_memories,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-telemetry-summary-tool.js","sourceRoot":"","sources":["../../../../src/domains/telemetry/tools/get-telemetry-summary-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIvD,MAAM,eAAe,GAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAEhE,MAAM,yBAAyB,GAAG;IAChC,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;YAC1B,WAAW,EAAE,kBAAkB;SAChC;KACF;IACD,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,OAAO,uBAAwB,SAAQ,QAAQ;IACnD;QACE,KAAK,CACH,uBAAuB,EACvB,uFAAuF,EACvF,yBAAyB,CAC1B,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAe,EAAE,OAAoB;QAChD,qBAAqB;QACrB,MAAM,SAAS,GACb,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YAC5D,CAAC,CAAE,MAAkC,CAAC,MAAM;YAC5C,CAAC,CAAC,SAAS,CAAC;QAEhB,MAAM,MAAM,GAAqB,SAA6B,IAAI,KAAK,CAAC;QAExE,IAAI,SAAS,KAAK,SAAS,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,SAA4B,CAAC,EAAE,CAAC;YACvF,OAAO,IAAI,CAAC,iBAAiB,CAAC,uCAAuC,CAAC,CAAC;QACzE,CAAC;QAED,2BAA2B;QAC3B,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"get-telemetry-summary-tool.js","sourceRoot":"","sources":["../../../../src/domains/telemetry/tools/get-telemetry-summary-tool.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAIvD,MAAM,eAAe,GAAsB,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAEhE,MAAM,yBAAyB,GAAG;IAChC,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;YAC1B,WAAW,EAAE,kBAAkB;SAChC;KACF;IACD,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,OAAO,uBAA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AE,oBAAoB,CAAC,6BAA6B;oBACjF,wBAAwB,EAAE,oBAAoB,CAAC,wBAAwB;oBACvE,oBAAoB,EAAE,oBAAoB,CAAC,oBAAoB;iBAChE;gBACD,gBAAgB,EAAE;oBAChB,YAAY,EAAE,eAAe,CAAC,YAAY;oBAC1C,cAAc,EAAE,eAAe,CAAC,cAAc;oBAC9C,cAAc,EAAE,eAAe,CAAC,cAAc;oBAC9C,mCAAmC,EAAE,eAAe,CAAC,mCAAmC;oBACxF,YAAY,EAAE,eAAe,CAAC,YAAY;oBAC1C,4BAA4B,EAAE,eAAe,CAAC,4BAA4B;iBAC3E;gBACD,kBAAkB,EAAE;oBAClB,KAAK,EAAE,iBAAiB,CAAC,KAAK;oBAC9B,MAAM,EAAE,iBAAiB,CAAC,MAAM;oBAChC,QAAQ,EAAE,iBAAiB,CAAC,QAAQ;oBACpC,OAAO,EAAE,iBAAiB,CAAC,MAAM;oBACjC,WAAW,EAAE,iBAAiB,CAAC,UAAU;oBACzC,MAAM,EAAE,iBAAiB,CAAC,MAAM;iBACjC;gBACD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;aACpC,CAAC;YAEF,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;CACF"}
|
package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/migrate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/database/sqlite/migrate.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/database/sqlite/migrate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA6CH,iBAAS,eAAe,SAyTvB;AAeD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { computeL2Norm, decodeFloat32Embedding, migrateJsonEmbeddingToBlob, shou
|
|
|
9
9
|
import { PIIMasker } from '../../../shared/utils/pii-masker.js';
|
|
10
10
|
import { logger } from '../../../shared/utils/logger.js';
|
|
11
11
|
import { runDatabaseIntegrityPreflight } from './db-integrity-preflight.js';
|
|
12
|
+
import { ensureMemoryEmbeddingContentHash } from '../../../shared/utils/ensure-memory-embedding-content-hash.js';
|
|
12
13
|
import { ensureMemoryEmbeddingMetadataDefaults } from './ensure-memory-embedding-metadata-defaults.js';
|
|
13
14
|
import { checkVecCardinality, listExistingVecTables, reconcileVecDistanceMetric, recreateVecTriggers } from './vec-schema.js';
|
|
14
15
|
function isDuplicateColumnError(err) {
|
|
@@ -98,6 +99,7 @@ function migrateDatabase() {
|
|
|
98
99
|
normalized BOOLEAN DEFAULT FALSE,
|
|
99
100
|
version INTEGER DEFAULT 1,
|
|
100
101
|
created_by TEXT DEFAULT 'system',
|
|
102
|
+
content_hash TEXT,
|
|
101
103
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
102
104
|
FOREIGN KEY (memory_id) REFERENCES memory_item(id) ON DELETE CASCADE,
|
|
103
105
|
UNIQUE(memory_id, embedding_provider, projection_type)
|
|
@@ -111,6 +113,7 @@ function migrateDatabase() {
|
|
|
111
113
|
const hasModel = columnInfo.some(column => column.name === 'model');
|
|
112
114
|
const hasCreatedBy = columnInfo.some(column => column.name === 'created_by');
|
|
113
115
|
const hasCreatedAt = columnInfo.some(column => column.name === 'created_at');
|
|
116
|
+
const hasContentHashColumn = columnInfo.some(column => column.name === 'content_hash');
|
|
114
117
|
const hasId = columnInfo.some(column => column.name === 'id');
|
|
115
118
|
// #809: JSON TEXT를 BLOB 컬럼에 그대로 SELECT 복사하지 않고 JS에서 변환
|
|
116
119
|
const selectSql = `
|
|
@@ -123,6 +126,7 @@ function migrateDatabase() {
|
|
|
123
126
|
${hasDimensions ? 'dimensions' : 'dim AS dimensions'},
|
|
124
127
|
${hasModel ? 'model' : 'NULL AS model'},
|
|
125
128
|
${hasCreatedBy ? 'created_by' : "'system' AS created_by"},
|
|
129
|
+
${hasContentHashColumn ? 'content_hash' : 'NULL AS content_hash'},
|
|
126
130
|
${hasCreatedAt ? 'created_at' : 'CURRENT_TIMESTAMP AS created_at'}
|
|
127
131
|
FROM memory_embedding
|
|
128
132
|
`;
|
|
@@ -140,6 +144,7 @@ function migrateDatabase() {
|
|
|
140
144
|
normalized,
|
|
141
145
|
version,
|
|
142
146
|
created_by,
|
|
147
|
+
content_hash,
|
|
143
148
|
created_at
|
|
144
149
|
) VALUES (
|
|
145
150
|
@id,
|
|
@@ -154,6 +159,7 @@ function migrateDatabase() {
|
|
|
154
159
|
@normalized,
|
|
155
160
|
1,
|
|
156
161
|
@created_by,
|
|
162
|
+
@content_hash,
|
|
157
163
|
@created_at
|
|
158
164
|
)
|
|
159
165
|
`);
|
|
@@ -167,6 +173,7 @@ function migrateDatabase() {
|
|
|
167
173
|
: 'tfidf',
|
|
168
174
|
model: row.model,
|
|
169
175
|
created_by: row.created_by && row.created_by !== '' ? row.created_by : 'system',
|
|
176
|
+
content_hash: row.content_hash,
|
|
170
177
|
created_at: row.created_at,
|
|
171
178
|
};
|
|
172
179
|
if (Buffer.isBuffer(row.embedding)) {
|
|
@@ -215,6 +222,7 @@ function migrateDatabase() {
|
|
|
215
222
|
else {
|
|
216
223
|
logger.info('✅ memory_embedding 테이블은 최신 구조입니다');
|
|
217
224
|
}
|
|
225
|
+
ensureMemoryEmbeddingContentHash(db);
|
|
218
226
|
logger.info('🧾 임베딩 인덱스 및 트리거 정비 중...');
|
|
219
227
|
db.exec(`
|
|
220
228
|
CREATE INDEX IF NOT EXISTS idx_memory_embedding_memory_id ON memory_embedding(memory_id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../../src/infrastructure/database/sqlite/migrate.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AACvG,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,SAAS,sBAAsB,CAAC,GAAY;IAC1C,OAAO,GAAG,YAAY,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC;AAC/E,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,EAAqB;IAC7C,IAAI,CAAC;QACH,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvD,MAAM,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,YAAY,CAAsC,CAAC;QAC/F,EAAE,CAAC,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,oDAAoD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ACzF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type Database from 'better-sqlite3';
|
|
2
|
+
import type { Migration } from '../types.js';
|
|
3
|
+
export declare class NarrowLegacyVecAllowlistMigration implements Migration {
|
|
4
|
+
version: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
validateBefore(db: Database.Database): Promise<void>;
|
|
8
|
+
up(db: Database.Database): Promise<void>;
|
|
9
|
+
down(db: Database.Database): Promise<void>;
|
|
10
|
+
validateAfter(db: Database.Database): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export default NarrowLegacyVecAllowlistMigration;
|
|
13
|
+
//# sourceMappingURL=053-narrow-legacy-vec-allowlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"053-narrow-legacy-vec-allowlist.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/database/sqlite/migration/migrations/053-narrow-legacy-vec-allowlist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAW3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAsD7C,qBAAa,iCAAkC,YAAW,SAAS;IACjE,OAAO,SAAU;IACjB,IAAI,SAAiC;IACrC,WAAW,SACwF;IAE7F,cAAc,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAMpD,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBxC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB1C,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CA0C1D;AAED,eAAe,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { logger } from '../../../../../shared/utils/logger.js';
|
|
2
|
+
import { VEC_TABLES, checkVecCardinality, evictNonMembers, listExistingVecTables, recreateVecTriggers, repopulateVecTable, } from '../../vec-schema.js';
|
|
3
|
+
/** #1377 이전 저장소 술어. 라이브에 남은 `dimensions = 384` 단독 트리거가 아니다. */
|
|
4
|
+
const LEGACY_CATCHALL_PREDICATES = [
|
|
5
|
+
'dimensions = 384',
|
|
6
|
+
"projection_type NOT LIKE 'window:%'",
|
|
7
|
+
];
|
|
8
|
+
const LEGACY_CATCHALL_FILTER = LEGACY_CATCHALL_PREDICATES.join(' AND ');
|
|
9
|
+
const LEGACY_ALLOWLIST_SQL = "embedding_provider IN ('tfidf', 'lightweight')";
|
|
10
|
+
const LEGACY_CATCHALL_TRIGGER_SQL = "NEW.dimensions = 384 AND NEW.projection_type NOT LIKE 'window:%'";
|
|
11
|
+
function isQueryable(db, table) {
|
|
12
|
+
try {
|
|
13
|
+
db.prepare(`SELECT rowid FROM ${table} LIMIT 1`).get();
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function tableExists(db, name) {
|
|
21
|
+
return Boolean(db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'table' AND name = ?").get(name));
|
|
22
|
+
}
|
|
23
|
+
function withLegacyCatchall(tables) {
|
|
24
|
+
return tables.map(table => {
|
|
25
|
+
if (table.name !== 'memory_item_vec') {
|
|
26
|
+
return table;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
...table,
|
|
30
|
+
predicates: LEGACY_CATCHALL_PREDICATES,
|
|
31
|
+
filter: LEGACY_CATCHALL_FILTER,
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function logLegacyMembership(db) {
|
|
36
|
+
const rows = db
|
|
37
|
+
.prepare(`SELECT embedding_provider AS provider, projection_type AS projection, COUNT(*) AS count
|
|
38
|
+
FROM memory_embedding
|
|
39
|
+
WHERE id IN (SELECT rowid FROM memory_item_vec)
|
|
40
|
+
GROUP BY 1, 2`)
|
|
41
|
+
.all();
|
|
42
|
+
logger.info('narrow-legacy-vec-allowlist: legacy membership', { histogram: rows });
|
|
43
|
+
}
|
|
44
|
+
export class NarrowLegacyVecAllowlistMigration {
|
|
45
|
+
version = '53.0';
|
|
46
|
+
name = 'narrow-legacy-vec-allowlist';
|
|
47
|
+
description = 'Keep memory_item_vec for tfidf/lightweight 384 native rows and evict every other rowid (#1377)';
|
|
48
|
+
async validateBefore(db) {
|
|
49
|
+
if (!tableExists(db, 'memory_embedding')) {
|
|
50
|
+
throw new Error('Migration 053 requires the memory_embedding table');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async up(db) {
|
|
54
|
+
if (!isQueryable(db, 'memory_item_vec')) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
logLegacyMembership(db);
|
|
58
|
+
const existing = listExistingVecTables(db);
|
|
59
|
+
recreateVecTriggers(db, existing);
|
|
60
|
+
const legacy = VEC_TABLES.find(table => table.name === 'memory_item_vec');
|
|
61
|
+
if (!legacy) {
|
|
62
|
+
throw new Error('memory_item_vec is missing from VEC_TABLES');
|
|
63
|
+
}
|
|
64
|
+
const deleted = evictNonMembers(db, legacy);
|
|
65
|
+
logger.info('narrow-legacy-vec-allowlist: evicted non-members', { deleted });
|
|
66
|
+
const minilm = existing.find(table => table.name === 'memory_item_vec_minilm');
|
|
67
|
+
if (minilm) {
|
|
68
|
+
repopulateVecTable(db, minilm);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async down(db) {
|
|
72
|
+
if (!isQueryable(db, 'memory_item_vec')) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const existing = withLegacyCatchall(listExistingVecTables(db));
|
|
76
|
+
recreateVecTriggers(db, existing);
|
|
77
|
+
// vec0 는 기존 rowid 에 INSERT OR IGNORE 를 주면 UNIQUE 로 실패한다.
|
|
78
|
+
db.exec(`INSERT INTO memory_item_vec(rowid, embedding) ` +
|
|
79
|
+
`SELECT id, embedding FROM memory_embedding WHERE ${LEGACY_CATCHALL_FILTER} ` +
|
|
80
|
+
`AND id NOT IN (SELECT rowid FROM memory_item_vec)`);
|
|
81
|
+
if (tableExists(db, 'memento_schema_version')) {
|
|
82
|
+
db.prepare('DELETE FROM memento_schema_version WHERE version = ?').run(this.version);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async validateAfter(db) {
|
|
86
|
+
if (!isQueryable(db, 'memory_item_vec')) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const report = checkVecCardinality(db);
|
|
90
|
+
for (const name of ['memory_item_vec', 'memory_item_vec_minilm']) {
|
|
91
|
+
const row = report.find(item => item.table === name);
|
|
92
|
+
if (!row) {
|
|
93
|
+
if (name === 'memory_item_vec_minilm') {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
throw new Error(`${name} missing from cardinality report`);
|
|
97
|
+
}
|
|
98
|
+
if (!row.matched) {
|
|
99
|
+
throw new Error(`${name} cardinality mismatch: expected ${row.expected}, actual ${row.actual}`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const minilmInLegacy = db
|
|
103
|
+
.prepare(`SELECT COUNT(*) AS count FROM memory_item_vec
|
|
104
|
+
WHERE rowid IN (SELECT id FROM memory_embedding WHERE embedding_provider = 'minilm')`)
|
|
105
|
+
.get();
|
|
106
|
+
if (minilmInLegacy.count !== 0) {
|
|
107
|
+
throw new Error(`Migration 053 left ${minilmInLegacy.count} minilm rowids in memory_item_vec`);
|
|
108
|
+
}
|
|
109
|
+
const insertTrigger = db
|
|
110
|
+
.prepare("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = 'memory_embedding_vec_insert'")
|
|
111
|
+
.get();
|
|
112
|
+
const sql = insertTrigger?.sql ?? '';
|
|
113
|
+
if (!sql.includes(LEGACY_ALLOWLIST_SQL)) {
|
|
114
|
+
throw new Error('Migration 053 did not install the legacy provider allowlist');
|
|
115
|
+
}
|
|
116
|
+
if (sql.includes(LEGACY_CATCHALL_TRIGGER_SQL)) {
|
|
117
|
+
throw new Error('Migration 053 left the legacy dimension catch-all trigger');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export default NarrowLegacyVecAllowlistMigration;
|
|
122
|
+
//# sourceMappingURL=053-narrow-legacy-vec-allowlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"053-narrow-legacy-vec-allowlist.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/database/sqlite/migration/migrations/053-narrow-legacy-vec-allowlist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EACL,UAAU,EAEV,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAG7B,+DAA+D;AAC/D,MAAM,0BAA0B,GAAG;IACjC,kBAAkB;IAClB,qCAAqC;CAC7B,CAAC;AAEX,MAAM,sBAAsB,GAAG,0BAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAExE,MAAM,oBAAoB,GAAG,gDAAgD,CAAC;AAC9E,MAAM,2BAA2B,GAC/B,kEAAkE,CAAC;AAErE,SAAS,WAAW,CAAC,EAAqB,EAAE,KAAa;IACvD,IAAI,CAAC;QACH,EAAE,CAAC,OAAO,CAAC,qBAAqB,KAAK,UAAU,CAAC,CAAC,GAAG,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,EAAqB,EAAE,IAAY;IACt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AC;QAC/E,CAAC;IACH,CAAC;CACF;AAED,eAAe,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type Database from 'better-sqlite3';
|
|
2
|
+
import type { Migration } from '../types.js';
|
|
3
|
+
export declare class MemoryEmbeddingContentHashMigration implements Migration {
|
|
4
|
+
version: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
validateBefore(db: Database.Database): Promise<void>;
|
|
8
|
+
up(db: Database.Database): Promise<void>;
|
|
9
|
+
down(db: Database.Database): Promise<void>;
|
|
10
|
+
validateAfter(db: Database.Database): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export default MemoryEmbeddingContentHashMigration;
|
|
13
|
+
//# sourceMappingURL=054-memory-embedding-content-hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"054-memory-embedding-content-hash.d.ts","sourceRoot":"","sources":["../../../../../../src/infrastructure/database/sqlite/migration/migrations/054-memory-embedding-content-hash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQ7C,qBAAa,mCAAoC,YAAW,SAAS;IACnE,OAAO,SAAU;IACjB,IAAI,SAAmC;IACvC,WAAW,SAA+F;IAEpG,cAAc,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IASpD,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1C,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CAW1D;AAED,eAAe,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ensureMemoryEmbeddingContentHash } from '../../../../../shared/utils/ensure-memory-embedding-content-hash.js';
|
|
2
|
+
function hasColumn(db, table, column) {
|
|
3
|
+
return db.prepare(`PRAGMA table_info(${table})`).all().some(item => item.name === column);
|
|
4
|
+
}
|
|
5
|
+
export class MemoryEmbeddingContentHashMigration {
|
|
6
|
+
version = '54.0';
|
|
7
|
+
name = 'memory-embedding-content-hash';
|
|
8
|
+
description = 'Track source content hashes and invalidate embeddings when memory content changes (#1391)';
|
|
9
|
+
async validateBefore(db) {
|
|
10
|
+
if (!db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='memory_embedding'").get()) {
|
|
11
|
+
throw new Error('Migration 054 requires the memory_embedding table');
|
|
12
|
+
}
|
|
13
|
+
if (!db.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='memory_item'").get()) {
|
|
14
|
+
throw new Error('Migration 054 requires the memory_item table');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async up(db) {
|
|
18
|
+
ensureMemoryEmbeddingContentHash(db);
|
|
19
|
+
}
|
|
20
|
+
async down(db) {
|
|
21
|
+
db.exec('DROP TRIGGER IF EXISTS memory_item_embedding_content_update');
|
|
22
|
+
if (hasColumn(db, 'memory_embedding', 'content_hash')) {
|
|
23
|
+
db.exec('ALTER TABLE memory_embedding DROP COLUMN content_hash');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async validateAfter(db) {
|
|
27
|
+
if (!hasColumn(db, 'memory_embedding', 'content_hash')) {
|
|
28
|
+
throw new Error('Migration 054 did not add memory_embedding.content_hash');
|
|
29
|
+
}
|
|
30
|
+
const trigger = db.prepare("SELECT 1 FROM sqlite_master WHERE type='trigger' AND name='memory_item_embedding_content_update'").get();
|
|
31
|
+
if (!trigger) {
|
|
32
|
+
throw new Error('Migration 054 did not install content invalidation trigger');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export default MemoryEmbeddingContentHashMigration;
|
|
37
|
+
//# sourceMappingURL=054-memory-embedding-content-hash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"054-memory-embedding-content-hash.js","sourceRoot":"","sources":["../../../../../../src/infrastructure/database/sqlite/migration/migrations/054-memory-embedding-content-hash.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,qEAAqE,CAAC;AAGvH,SAAS,SAAS,CAAC,EAAqB,EAAE,KAAa,EAAE,MAAc;IACrE,OAAQ,EAAE,CAAC,OAAO,CAAC,qBAAqB,KAAK,GAAG,CAAC,CAAC,GAAG,EAA8B,CAAC,IAAI,CACtF,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM,CAC7B,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,mCAAmC;IAC9C,OAAO,GAAG,MAAM,CAAC;IACjB,IAAI,GAAG,+BAA+B,CAAC;IACvC,WAAW,GAAG,2FAA2F,CAAC;IAE1G,KAAK,CAAC,cAAc,CAAC,EAAqB;QACxC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,4EAA4E,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;YACpG,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,uEAAuE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;YAC/F,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,EAAE,CAAC,EAAqB;QAC5B,gCAAgC,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAqB;QAC9B,EAAE,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;QACvE,IAAI,SAAS,CAAC,EAAE,EAAE,kBAAkB,EAAE,cAAc,CAAC,EAAE,CAAC;YACtD,EAAE,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,EAAqB;QACvC,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,kBAAkB,EAAE,cAAc,CAAC,EAAE,CAAC;YACvD,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;QACD,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CACxB,kGAAkG,CACnG,CAAC,GAAG,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;CACF;AAED,eAAe,mCAAmC,CAAC"}
|
|
@@ -21,12 +21,7 @@ export interface VecTableConfig {
|
|
|
21
21
|
/** predicates를 AND로 묶은 memory_embedding 필터 */
|
|
22
22
|
filter: string;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
* 대상 vec 테이블 전체.
|
|
26
|
-
*
|
|
27
|
-
* `memory_item_vec`는 legacy 384 공용 테이블이라 provider 전용이 아니며,
|
|
28
|
-
* dimensions=384인 native·기타 행만 받는다(윈도 행 제외, 제공자별 1:1 비교 대상이 아님).
|
|
29
|
-
*/
|
|
24
|
+
/** 대상 vec 테이블 전체. */
|
|
30
25
|
export declare const VEC_TABLES: readonly VecTableConfig[];
|
|
31
26
|
export declare function buildVecTableDdl(config: VecTableConfig): string;
|
|
32
27
|
/**
|
|
@@ -45,6 +40,7 @@ export declare function listExistingVecTables(db: Database.Database): VecTableCo
|
|
|
45
40
|
* vec 테이블을 filter 조건에 맞는 memory_embedding 행으로 재적재한다.
|
|
46
41
|
*/
|
|
47
42
|
export declare function repopulateVecTable(db: Database.Database, config: VecTableConfig): void;
|
|
43
|
+
export declare function evictNonMembers(db: Database.Database, table: VecTableConfig): number;
|
|
48
44
|
/**
|
|
49
45
|
* metric이 cosine이 아닌 vec 테이블을 재생성하고 재적재한다.
|
|
50
46
|
*
|
package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/vec-schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vec-schema.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/database/sqlite/vec-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAI3C,eAAO,MAAM,mBAAmB,UAAgC,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;CAChB;AAqCD
|
|
1
|
+
{"version":3,"file":"vec-schema.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/database/sqlite/vec-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAI3C,eAAO,MAAM,mBAAmB,UAAgC,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;CAChB;AAqCD,qBAAqB;AACrB,eAAO,MAAM,UAAU,EAAE,SAAS,cAAc,EAW/C,CAAC;AAUF,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAM/D;AAKD;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAK/E;AAED,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf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legacy 384 공용 테이블이라 provider 전용이 아니며,
|
|
49
|
-
* dimensions=384인 native·기타 행만 받는다(윈도 행 제외, 제공자별 1:1 비교 대상이 아님).
|
|
50
|
-
*/
|
|
45
|
+
/** 대상 vec 테이블 전체. */
|
|
51
46
|
export const VEC_TABLES = [
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
vecTable('memory_item_vec', 384, [
|
|
48
|
+
"embedding_provider IN ('tfidf', 'lightweight')",
|
|
49
|
+
'dimensions = 384',
|
|
50
|
+
"projection_type = 'native'",
|
|
51
|
+
]),
|
|
54
52
|
vecTable('memory_item_vec_tfidf', 512, nativeProviderPredicates('tfidf', 512)),
|
|
55
53
|
vecTable('memory_item_vec_minilm', 384, minilmProviderPredicates(384)),
|
|
56
54
|
vecTable('memory_item_vec_openai', 1536, nativeProviderPredicates('openai', 1536)),
|
|
@@ -132,8 +130,18 @@ export function listExistingVecTables(db) {
|
|
|
132
130
|
*/
|
|
133
131
|
export function repopulateVecTable(db, config) {
|
|
134
132
|
assertAllowedVecTable(config.name);
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
// vec0 는 기존 rowid 에 INSERT OR IGNORE 를 주면 UNIQUE 로 실패한다. 없는 행만 넣는다.
|
|
134
|
+
db.exec(`INSERT INTO ${config.name}(rowid, embedding) ` +
|
|
135
|
+
`SELECT id, embedding FROM memory_embedding WHERE ${config.filter} ` +
|
|
136
|
+
`AND id NOT IN (SELECT rowid FROM ${config.name})`);
|
|
137
|
+
}
|
|
138
|
+
export function evictNonMembers(db, table) {
|
|
139
|
+
assertAllowedVecTable(table.name);
|
|
140
|
+
const result = db
|
|
141
|
+
.prepare(`DELETE FROM ${table.name} WHERE rowid NOT IN (` +
|
|
142
|
+
`SELECT id FROM memory_embedding WHERE ${table.filter})`)
|
|
143
|
+
.run();
|
|
144
|
+
return result.changes;
|
|
137
145
|
}
|
|
138
146
|
/**
|
|
139
147
|
* metric이 cosine이 아닌 vec 테이블을 재생성하고 재적재한다.
|
package/dist/node_modules/@memento/core/dist/infrastructure/database/sqlite/vec-schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vec-schema.js","sourceRoot":"","sources":["../../../../src/infrastructure/database/sqlite/vec-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAE1F,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAcjE,SAAS,QAAQ,CAAC,IAAY,EAAE,SAAiB,EAAE,UAA6B;IAC9E,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;AAC3E,CAAC;AAED,SAAS,wBAAwB,CAAC,QAAgB,EAAE,SAAiB;IACnE,OAAO;QACL,yBAAyB,QAAQ,GAAG;QACpC,gBAAgB,SAAS,EAAE;QAC3B,4BAA4B;KAC7B,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,6BAA6B,GAAG;IACpC,QAAQ;IACR,GAAG,uBAAuB;CAC3B,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAExC;;;GAGG;AACH,SAAS,wBAAwB,CAAC,SAAiB;IACjD,OAAO;QACL,+BAA+B;QAC/B,gBAAgB,SAAS,EAAE;QAC3B,uBAAuB,6BAA6B,GAAG;KACxD,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"vec-schema.js","sourceRoot":"","sources":["../../../../src/infrastructure/database/sqlite/vec-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,6BAA6B,EAAE,MAAM,gDAAgD,CAAC;AAC/F,OAAO,EAAE,uBAAuB,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CAAC;QAC9B,MAAM,SAAS,GAAG,EAAE;aACjB,OAAO,CAAC,iCAAiC,KAAK,CAAC,IAAI,EAAE,CAAC;aACtD,GAAG,EAAuB,CAAC;QAE9B,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,QAAQ,EAAE,WAAW,CAAC,KAAK;YAC3B,MAAM,EAAE,SAAS,CAAC,KAAK;YACvB,OAAO,EAAE,WAAW,CAAC,KAAK,KAAK,SAAS,CAAC,KAAK;SAC/C,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -2,5 +2,6 @@ import type Database from 'better-sqlite3';
|
|
|
2
2
|
import type { FailureEvent } from '../../domains/monitoring/services/failure-detector.js';
|
|
3
3
|
import type { ExtractedProceduralMemory } from '../../domains/memory/procedural/procedural-memory-extractor.js';
|
|
4
4
|
import type { ReflectionNotes } from '../../domains/memory/procedural/procedural-memory-extractor.types.js';
|
|
5
|
-
|
|
5
|
+
import { MemoryEmbeddingService } from '../../domains/memory/services/memory-embedding-service.js';
|
|
6
|
+
export declare function createProceduralMemory(db: Database.Database, extracted: ExtractedProceduralMemory, reflectionNote: ReflectionNotes | Record<string, unknown>, event: FailureEvent, existingMemoryIdForVersion?: string, embeddingService?: MemoryEmbeddingService): Promise<string | null>;
|
|
6
7
|
//# sourceMappingURL=reflexion-procedural-create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reflexion-procedural-create.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAChH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sEAAsE,CAAC;
|
|
1
|
+
{"version":3,"file":"reflexion-procedural-create.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/reflexion-procedural-memory-service/reflexion-procedural-create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAG3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uDAAuD,CAAC;AAE1F,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAChH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sEAAsE,CAAC;AAE5G,OAAO,EAAE,sBAAsB,EAAE,MAAM,2DAA2D,CAAC;AAEnG,wBAAsB,sBAAsB,CAC1C,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,SAAS,EAAE,yBAAyB,EACpC,cAAc,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzD,KAAK,EAAE,YAAY,EACnB,0BAA0B,CAAC,EAAE,MAAM,EACnC,gBAAgB,GAAE,sBAAqD,GACtE,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAsExB"}
|