agentdb 1.6.0 → 2.0.0-alpha.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/README.md +1098 -350
- package/dist/agentdb-advanced.js +2110 -0
- package/dist/agentdb-advanced.min.js +1 -0
- package/dist/agentdb.min.js +4 -4
- package/dist/backends/GraphBackend.d.ts +196 -0
- package/dist/backends/GraphBackend.d.ts.map +1 -0
- package/dist/backends/GraphBackend.js +33 -0
- package/dist/backends/GraphBackend.js.map +1 -0
- package/dist/backends/LearningBackend.d.ts +148 -0
- package/dist/backends/LearningBackend.d.ts.map +1 -0
- package/dist/backends/LearningBackend.js +27 -0
- package/dist/backends/LearningBackend.js.map +1 -0
- package/dist/backends/VectorBackend.d.ts +119 -0
- package/dist/backends/VectorBackend.d.ts.map +1 -0
- package/dist/backends/VectorBackend.js +14 -0
- package/dist/backends/VectorBackend.js.map +1 -0
- package/dist/backends/detector.d.ts +81 -0
- package/dist/backends/detector.d.ts.map +1 -0
- package/dist/backends/detector.js +192 -0
- package/dist/backends/detector.js.map +1 -0
- package/dist/backends/factory.d.ts +50 -0
- package/dist/backends/factory.d.ts.map +1 -0
- package/dist/backends/factory.js +161 -0
- package/dist/backends/factory.js.map +1 -0
- package/dist/backends/graph/GraphDatabaseAdapter.d.ts +139 -0
- package/dist/backends/graph/GraphDatabaseAdapter.d.ts.map +1 -0
- package/dist/backends/graph/GraphDatabaseAdapter.js +194 -0
- package/dist/backends/graph/GraphDatabaseAdapter.js.map +1 -0
- package/dist/backends/hnswlib/HNSWLibBackend.d.ts +92 -0
- package/dist/backends/hnswlib/HNSWLibBackend.d.ts.map +1 -0
- package/dist/backends/hnswlib/HNSWLibBackend.js +316 -0
- package/dist/backends/hnswlib/HNSWLibBackend.js.map +1 -0
- package/dist/backends/hnswlib/index.d.ts +7 -0
- package/dist/backends/hnswlib/index.d.ts.map +1 -0
- package/dist/backends/hnswlib/index.js +7 -0
- package/dist/backends/hnswlib/index.js.map +1 -0
- package/dist/backends/index.d.ts +14 -0
- package/dist/backends/index.d.ts.map +1 -0
- package/dist/backends/index.js +13 -0
- package/dist/backends/index.js.map +1 -0
- package/dist/backends/ruvector/RuVectorBackend.d.ts +75 -0
- package/dist/backends/ruvector/RuVectorBackend.d.ts.map +1 -0
- package/dist/backends/ruvector/RuVectorBackend.js +198 -0
- package/dist/backends/ruvector/RuVectorBackend.js.map +1 -0
- package/dist/backends/ruvector/RuVectorLearning.d.ts +104 -0
- package/dist/backends/ruvector/RuVectorLearning.d.ts.map +1 -0
- package/dist/backends/ruvector/RuVectorLearning.js +177 -0
- package/dist/backends/ruvector/RuVectorLearning.js.map +1 -0
- package/dist/backends/ruvector/index.d.ts +9 -0
- package/dist/backends/ruvector/index.d.ts.map +1 -0
- package/dist/backends/ruvector/index.js +8 -0
- package/dist/backends/ruvector/index.js.map +1 -0
- package/dist/browser/AdvancedFeatures.d.ts +144 -0
- package/dist/browser/AdvancedFeatures.d.ts.map +1 -0
- package/dist/browser/AdvancedFeatures.js +430 -0
- package/dist/browser/AdvancedFeatures.js.map +1 -0
- package/dist/browser/HNSWIndex.d.ts +117 -0
- package/dist/browser/HNSWIndex.d.ts.map +1 -0
- package/dist/browser/HNSWIndex.js +402 -0
- package/dist/browser/HNSWIndex.js.map +1 -0
- package/dist/browser/ProductQuantization.d.ts +107 -0
- package/dist/browser/ProductQuantization.d.ts.map +1 -0
- package/dist/browser/ProductQuantization.js +337 -0
- package/dist/browser/ProductQuantization.js.map +1 -0
- package/dist/browser/browser/AdvancedFeatures.d.ts +144 -0
- package/dist/browser/browser/AdvancedFeatures.d.ts.map +1 -0
- package/dist/browser/browser/AdvancedFeatures.js +427 -0
- package/dist/browser/browser/HNSWIndex.d.ts +117 -0
- package/dist/browser/browser/HNSWIndex.d.ts.map +1 -0
- package/dist/browser/browser/HNSWIndex.js +402 -0
- package/dist/browser/browser/ProductQuantization.d.ts +107 -0
- package/dist/browser/browser/ProductQuantization.d.ts.map +1 -0
- package/dist/browser/browser/ProductQuantization.js +348 -0
- package/dist/browser/browser/index.d.ts +223 -0
- package/dist/browser/browser/index.d.ts.map +1 -0
- package/dist/browser/browser/index.js +233 -0
- package/dist/browser/index.d.ts +223 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +225 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/cli/agentdb-cli.d.ts.map +1 -1
- package/dist/cli/agentdb-cli.js +130 -8
- package/dist/cli/agentdb-cli.js.map +1 -1
- package/dist/cli/agentdb.db +0 -0
- package/dist/cli/commands/init.d.ts +12 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +115 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/install-embeddings.d.ts +10 -0
- package/dist/cli/commands/install-embeddings.d.ts.map +1 -0
- package/dist/cli/commands/install-embeddings.js +68 -0
- package/dist/cli/commands/install-embeddings.js.map +1 -0
- package/dist/cli/commands/migrate.d.ts +15 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -0
- package/dist/cli/commands/migrate.js +425 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- package/dist/cli/commands/status.d.ts +10 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +129 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/controllers/CausalRecall.d.ts +3 -1
- package/dist/controllers/CausalRecall.d.ts.map +1 -1
- package/dist/controllers/CausalRecall.js +35 -4
- package/dist/controllers/CausalRecall.js.map +1 -1
- package/dist/controllers/ExplainableRecall.d.ts +24 -0
- package/dist/controllers/ExplainableRecall.d.ts.map +1 -1
- package/dist/controllers/ExplainableRecall.js +102 -5
- package/dist/controllers/ExplainableRecall.js.map +1 -1
- package/dist/controllers/HNSWIndex.d.ts +128 -0
- package/dist/controllers/HNSWIndex.d.ts.map +1 -0
- package/dist/controllers/HNSWIndex.js +361 -0
- package/dist/controllers/HNSWIndex.js.map +1 -0
- package/dist/controllers/NightlyLearner.d.ts.map +1 -1
- package/dist/controllers/NightlyLearner.js +7 -4
- package/dist/controllers/NightlyLearner.js.map +1 -1
- package/dist/controllers/ReasoningBank.d.ts +101 -2
- package/dist/controllers/ReasoningBank.d.ts.map +1 -1
- package/dist/controllers/ReasoningBank.js +196 -4
- package/dist/controllers/ReasoningBank.js.map +1 -1
- package/dist/controllers/ReflexionMemory.d.ts +41 -1
- package/dist/controllers/ReflexionMemory.d.ts.map +1 -1
- package/dist/controllers/ReflexionMemory.js +282 -5
- package/dist/controllers/ReflexionMemory.js.map +1 -1
- package/dist/controllers/SkillLibrary.d.ts +27 -9
- package/dist/controllers/SkillLibrary.d.ts.map +1 -1
- package/dist/controllers/SkillLibrary.js +136 -47
- package/dist/controllers/SkillLibrary.js.map +1 -1
- package/dist/controllers/index.d.ts +2 -0
- package/dist/controllers/index.d.ts.map +1 -1
- package/dist/controllers/index.js +1 -0
- package/dist/controllers/index.js.map +1 -1
- package/dist/db-fallback.d.ts.map +1 -1
- package/dist/db-fallback.js +100 -29
- package/dist/db-fallback.js.map +1 -1
- package/dist/db-test.d.ts +13 -0
- package/dist/db-test.d.ts.map +1 -0
- package/dist/db-test.js +55 -0
- package/dist/db-test.js.map +1 -0
- package/dist/db-unified.d.ts +76 -0
- package/dist/db-unified.d.ts.map +1 -0
- package/dist/db-unified.js +278 -0
- package/dist/db-unified.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/malp/core/ccc.d.ts +99 -0
- package/dist/malp/core/ccc.d.ts.map +1 -0
- package/dist/malp/core/ccc.js +181 -0
- package/dist/malp/core/ccc.js.map +1 -0
- package/dist/malp/core/index.d.ts +9 -0
- package/dist/malp/core/index.d.ts.map +1 -0
- package/dist/malp/core/index.js +9 -0
- package/dist/malp/core/index.js.map +1 -0
- package/dist/malp/core/linalg.d.ts +101 -0
- package/dist/malp/core/linalg.d.ts.map +1 -0
- package/dist/malp/core/linalg.js +278 -0
- package/dist/malp/core/linalg.js.map +1 -0
- package/dist/malp/core/optimizer.d.ts +68 -0
- package/dist/malp/core/optimizer.d.ts.map +1 -0
- package/dist/malp/core/optimizer.js +160 -0
- package/dist/malp/core/optimizer.js.map +1 -0
- package/dist/malp/index.d.ts +33 -0
- package/dist/malp/index.d.ts.map +1 -0
- package/dist/malp/index.js +37 -0
- package/dist/malp/index.js.map +1 -0
- package/dist/malp/metrics/agreement.d.ts +106 -0
- package/dist/malp/metrics/agreement.d.ts.map +1 -0
- package/dist/malp/metrics/agreement.js +199 -0
- package/dist/malp/metrics/agreement.js.map +1 -0
- package/dist/malp/metrics/comparison.d.ts +93 -0
- package/dist/malp/metrics/comparison.d.ts.map +1 -0
- package/dist/malp/metrics/comparison.js +256 -0
- package/dist/malp/metrics/comparison.js.map +1 -0
- package/dist/malp/metrics/index.d.ts +8 -0
- package/dist/malp/metrics/index.d.ts.map +1 -0
- package/dist/malp/metrics/index.js +8 -0
- package/dist/malp/metrics/index.js.map +1 -0
- package/dist/malp/metrics/performance.d.ts +61 -0
- package/dist/malp/metrics/performance.d.ts.map +1 -0
- package/dist/malp/metrics/performance.js +190 -0
- package/dist/malp/metrics/performance.js.map +1 -0
- package/dist/malp/models/index.d.ts +7 -0
- package/dist/malp/models/index.d.ts.map +1 -0
- package/dist/malp/models/index.js +7 -0
- package/dist/malp/models/index.js.map +1 -0
- package/dist/malp/models/malp.d.ts +116 -0
- package/dist/malp/models/malp.d.ts.map +1 -0
- package/dist/malp/models/malp.js +206 -0
- package/dist/malp/models/malp.js.map +1 -0
- package/dist/malp/models/regressor.d.ts +80 -0
- package/dist/malp/models/regressor.d.ts.map +1 -0
- package/dist/malp/models/regressor.js +229 -0
- package/dist/malp/models/regressor.js.map +1 -0
- package/dist/malp/reasoningbank_validator.d.ts +187 -0
- package/dist/malp/reasoningbank_validator.d.ts.map +1 -0
- package/dist/malp/reasoningbank_validator.js +246 -0
- package/dist/malp/reasoningbank_validator.js.map +1 -0
- package/dist/malp/wasm_bindings.d.ts +344 -0
- package/dist/malp/wasm_bindings.d.ts.map +1 -0
- package/dist/malp/wasm_bindings.js +9 -0
- package/dist/malp/wasm_bindings.js.map +1 -0
- package/dist/mcp/agentdb-mcp-server.js +512 -33
- package/dist/mcp/agentdb-mcp-server.js.map +1 -1
- package/dist/optimizations/BatchOperations.d.ts +42 -0
- package/dist/optimizations/BatchOperations.d.ts.map +1 -1
- package/dist/optimizations/BatchOperations.js +181 -0
- package/dist/optimizations/BatchOperations.js.map +1 -1
- package/dist/optimizations/ToolCache.d.ts +137 -0
- package/dist/optimizations/ToolCache.d.ts.map +1 -0
- package/dist/optimizations/ToolCache.js +281 -0
- package/dist/optimizations/ToolCache.js.map +1 -0
- package/dist/security/input-validation.d.ts +24 -0
- package/dist/security/input-validation.d.ts.map +1 -1
- package/dist/security/input-validation.js +106 -0
- package/dist/security/input-validation.js.map +1 -1
- package/dist/security/limits.d.ts +150 -0
- package/dist/security/limits.d.ts.map +1 -0
- package/dist/security/limits.js +288 -0
- package/dist/security/limits.js.map +1 -0
- package/dist/security/path-security.d.ts +100 -0
- package/dist/security/path-security.d.ts.map +1 -0
- package/dist/security/path-security.js +337 -0
- package/dist/security/path-security.js.map +1 -0
- package/dist/security/validation.d.ts +95 -0
- package/dist/security/validation.d.ts.map +1 -0
- package/dist/security/validation.js +315 -0
- package/dist/security/validation.js.map +1 -0
- package/dist/simulation/cli.d.ts +9 -0
- package/dist/simulation/cli.d.ts.map +1 -0
- package/dist/simulation/cli.js +68 -0
- package/dist/simulation/cli.js.map +1 -0
- package/dist/simulation/runner.d.ts +21 -0
- package/dist/simulation/runner.d.ts.map +1 -0
- package/dist/simulation/runner.js +241 -0
- package/dist/simulation/runner.js.map +1 -0
- package/dist/simulation/scenarios/aidefence-integration.d.ts +24 -0
- package/dist/simulation/scenarios/aidefence-integration.d.ts.map +1 -0
- package/dist/simulation/scenarios/aidefence-integration.js +124 -0
- package/dist/simulation/scenarios/aidefence-integration.js.map +1 -0
- package/dist/simulation/scenarios/bmssp-integration.d.ts +23 -0
- package/dist/simulation/scenarios/bmssp-integration.d.ts.map +1 -0
- package/dist/simulation/scenarios/bmssp-integration.js +104 -0
- package/dist/simulation/scenarios/bmssp-integration.js.map +1 -0
- package/dist/simulation/scenarios/causal-reasoning.d.ts +16 -0
- package/dist/simulation/scenarios/causal-reasoning.d.ts.map +1 -0
- package/dist/simulation/scenarios/causal-reasoning.js +108 -0
- package/dist/simulation/scenarios/causal-reasoning.js.map +1 -0
- package/dist/simulation/scenarios/consciousness-explorer.d.ts +25 -0
- package/dist/simulation/scenarios/consciousness-explorer.d.ts.map +1 -0
- package/dist/simulation/scenarios/consciousness-explorer.js +108 -0
- package/dist/simulation/scenarios/consciousness-explorer.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.d.ts +135 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.js +158 -0
- package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/index.d.ts +14 -0
- package/dist/simulation/scenarios/domain-examples/index.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/index.js +14 -0
- package/dist/simulation/scenarios/domain-examples/index.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.d.ts +178 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.js +218 -0
- package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.d.ts +122 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.js +129 -0
- package/dist/simulation/scenarios/domain-examples/medical-imaging.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.d.ts +166 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.js +161 -0
- package/dist/simulation/scenarios/domain-examples/robotics-navigation.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.d.ts +151 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.js +187 -0
- package/dist/simulation/scenarios/domain-examples/scientific-research.js.map +1 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.d.ts +102 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.d.ts.map +1 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.js +100 -0
- package/dist/simulation/scenarios/domain-examples/trading-systems.js.map +1 -0
- package/dist/simulation/scenarios/goalie-integration.d.ts +24 -0
- package/dist/simulation/scenarios/goalie-integration.d.ts.map +1 -0
- package/dist/simulation/scenarios/goalie-integration.js +121 -0
- package/dist/simulation/scenarios/goalie-integration.js.map +1 -0
- package/dist/simulation/scenarios/graph-traversal.d.ts +17 -0
- package/dist/simulation/scenarios/graph-traversal.d.ts.map +1 -0
- package/dist/simulation/scenarios/graph-traversal.js +101 -0
- package/dist/simulation/scenarios/graph-traversal.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.d.ts +45 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.js +435 -0
- package/dist/simulation/scenarios/latent-space/attention-analysis.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.d.ts +55 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.js +606 -0
- package/dist/simulation/scenarios/latent-space/clustering-analysis.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.d.ts +74 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.js +391 -0
- package/dist/simulation/scenarios/latent-space/hnsw-exploration.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.d.ts +51 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.js +536 -0
- package/dist/simulation/scenarios/latent-space/hypergraph-exploration.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/index.d.ts +35 -0
- package/dist/simulation/scenarios/latent-space/index.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/index.js +35 -0
- package/dist/simulation/scenarios/latent-space/index.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.d.ts +52 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.js +472 -0
- package/dist/simulation/scenarios/latent-space/neural-augmentation.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.d.ts +53 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.js +391 -0
- package/dist/simulation/scenarios/latent-space/quantum-hybrid.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.d.ts +52 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.js +514 -0
- package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.js.map +1 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.d.ts +53 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.d.ts.map +1 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.js +595 -0
- package/dist/simulation/scenarios/latent-space/traversal-optimization.js.map +1 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.d.ts +18 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.d.ts.map +1 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.js +132 -0
- package/dist/simulation/scenarios/lean-agentic-swarm.js.map +1 -0
- package/dist/simulation/scenarios/multi-agent-swarm.d.ts +17 -0
- package/dist/simulation/scenarios/multi-agent-swarm.d.ts.map +1 -0
- package/dist/simulation/scenarios/multi-agent-swarm.js +111 -0
- package/dist/simulation/scenarios/multi-agent-swarm.js.map +1 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.d.ts +23 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.d.ts.map +1 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.js +98 -0
- package/dist/simulation/scenarios/psycho-symbolic-reasoner.js.map +1 -0
- package/dist/simulation/scenarios/reflexion-learning.d.ts +16 -0
- package/dist/simulation/scenarios/reflexion-learning.d.ts.map +1 -0
- package/dist/simulation/scenarios/reflexion-learning.js +98 -0
- package/dist/simulation/scenarios/reflexion-learning.js.map +1 -0
- package/dist/simulation/scenarios/research-swarm.d.ts +24 -0
- package/dist/simulation/scenarios/research-swarm.d.ts.map +1 -0
- package/dist/simulation/scenarios/research-swarm.js +146 -0
- package/dist/simulation/scenarios/research-swarm.js.map +1 -0
- package/dist/simulation/scenarios/skill-evolution.d.ts +16 -0
- package/dist/simulation/scenarios/skill-evolution.d.ts.map +1 -0
- package/dist/simulation/scenarios/skill-evolution.js +109 -0
- package/dist/simulation/scenarios/skill-evolution.js.map +1 -0
- package/dist/simulation/scenarios/stock-market-emergence.d.ts +33 -0
- package/dist/simulation/scenarios/stock-market-emergence.d.ts.map +1 -0
- package/dist/simulation/scenarios/stock-market-emergence.js +246 -0
- package/dist/simulation/scenarios/stock-market-emergence.js.map +1 -0
- package/dist/simulation/scenarios/strange-loops.d.ts +18 -0
- package/dist/simulation/scenarios/strange-loops.d.ts.map +1 -0
- package/dist/simulation/scenarios/strange-loops.js +133 -0
- package/dist/simulation/scenarios/strange-loops.js.map +1 -0
- package/dist/simulation/scenarios/sublinear-solver.d.ts +22 -0
- package/dist/simulation/scenarios/sublinear-solver.d.ts.map +1 -0
- package/dist/simulation/scenarios/sublinear-solver.js +82 -0
- package/dist/simulation/scenarios/sublinear-solver.js.map +1 -0
- package/dist/simulation/scenarios/temporal-lead-solver.d.ts +23 -0
- package/dist/simulation/scenarios/temporal-lead-solver.d.ts.map +1 -0
- package/dist/simulation/scenarios/temporal-lead-solver.js +90 -0
- package/dist/simulation/scenarios/temporal-lead-solver.js.map +1 -0
- package/dist/simulation/scenarios/voting-system-consensus.d.ts +27 -0
- package/dist/simulation/scenarios/voting-system-consensus.d.ts.map +1 -0
- package/dist/simulation/scenarios/voting-system-consensus.js +175 -0
- package/dist/simulation/scenarios/voting-system-consensus.js.map +1 -0
- package/dist/simulation/types.d.ts +162 -0
- package/dist/simulation/types.d.ts.map +1 -0
- package/dist/simulation/types.js +5 -0
- package/dist/simulation/types.js.map +1 -0
- package/dist/simulation/utils/PerformanceOptimizer.d.ts +115 -0
- package/dist/simulation/utils/PerformanceOptimizer.d.ts.map +1 -0
- package/dist/simulation/utils/PerformanceOptimizer.js +223 -0
- package/dist/simulation/utils/PerformanceOptimizer.js.map +1 -0
- package/dist/src/backends/GraphBackend.d.ts +196 -0
- package/dist/src/backends/GraphBackend.d.ts.map +1 -0
- package/dist/src/backends/GraphBackend.js +33 -0
- package/dist/src/backends/GraphBackend.js.map +1 -0
- package/dist/src/backends/LearningBackend.d.ts +148 -0
- package/dist/src/backends/LearningBackend.d.ts.map +1 -0
- package/dist/src/backends/LearningBackend.js +27 -0
- package/dist/src/backends/LearningBackend.js.map +1 -0
- package/dist/src/backends/VectorBackend.d.ts +119 -0
- package/dist/src/backends/VectorBackend.d.ts.map +1 -0
- package/dist/src/backends/VectorBackend.js +14 -0
- package/dist/src/backends/VectorBackend.js.map +1 -0
- package/dist/src/backends/detector.d.ts +81 -0
- package/dist/src/backends/detector.d.ts.map +1 -0
- package/dist/src/backends/detector.js +192 -0
- package/dist/src/backends/detector.js.map +1 -0
- package/dist/src/backends/factory.d.ts +50 -0
- package/dist/src/backends/factory.d.ts.map +1 -0
- package/dist/src/backends/factory.js +161 -0
- package/dist/src/backends/factory.js.map +1 -0
- package/dist/src/backends/graph/GraphDatabaseAdapter.d.ts +151 -0
- package/dist/src/backends/graph/GraphDatabaseAdapter.d.ts.map +1 -0
- package/dist/src/backends/graph/GraphDatabaseAdapter.js +224 -0
- package/dist/src/backends/graph/GraphDatabaseAdapter.js.map +1 -0
- package/dist/src/backends/hnswlib/HNSWLibBackend.d.ts +92 -0
- package/dist/src/backends/hnswlib/HNSWLibBackend.d.ts.map +1 -0
- package/dist/src/backends/hnswlib/HNSWLibBackend.js +316 -0
- package/dist/src/backends/hnswlib/HNSWLibBackend.js.map +1 -0
- package/dist/src/backends/hnswlib/index.d.ts +7 -0
- package/dist/src/backends/hnswlib/index.d.ts.map +1 -0
- package/dist/src/backends/hnswlib/index.js +7 -0
- package/dist/src/backends/hnswlib/index.js.map +1 -0
- package/dist/src/backends/index.d.ts +14 -0
- package/dist/src/backends/index.d.ts.map +1 -0
- package/dist/src/backends/index.js +13 -0
- package/dist/src/backends/index.js.map +1 -0
- package/dist/src/backends/ruvector/RuVectorBackend.d.ts +75 -0
- package/dist/src/backends/ruvector/RuVectorBackend.d.ts.map +1 -0
- package/dist/src/backends/ruvector/RuVectorBackend.js +198 -0
- package/dist/src/backends/ruvector/RuVectorBackend.js.map +1 -0
- package/dist/src/backends/ruvector/RuVectorLearning.d.ts +104 -0
- package/dist/src/backends/ruvector/RuVectorLearning.d.ts.map +1 -0
- package/dist/src/backends/ruvector/RuVectorLearning.js +177 -0
- package/dist/src/backends/ruvector/RuVectorLearning.js.map +1 -0
- package/dist/src/backends/ruvector/index.d.ts +9 -0
- package/dist/src/backends/ruvector/index.d.ts.map +1 -0
- package/dist/src/backends/ruvector/index.js +8 -0
- package/dist/src/backends/ruvector/index.js.map +1 -0
- package/dist/src/benchmarks/wasm-vector-benchmark.d.ts +10 -0
- package/dist/src/benchmarks/wasm-vector-benchmark.d.ts.map +1 -0
- package/dist/src/benchmarks/wasm-vector-benchmark.js +196 -0
- package/dist/src/benchmarks/wasm-vector-benchmark.js.map +1 -0
- package/dist/src/browser/AdvancedFeatures.d.ts +144 -0
- package/dist/src/browser/AdvancedFeatures.d.ts.map +1 -0
- package/dist/src/browser/AdvancedFeatures.js +430 -0
- package/dist/src/browser/AdvancedFeatures.js.map +1 -0
- package/dist/src/browser/HNSWIndex.d.ts +117 -0
- package/dist/src/browser/HNSWIndex.d.ts.map +1 -0
- package/dist/src/browser/HNSWIndex.js +402 -0
- package/dist/src/browser/HNSWIndex.js.map +1 -0
- package/dist/src/browser/ProductQuantization.d.ts +107 -0
- package/dist/src/browser/ProductQuantization.d.ts.map +1 -0
- package/dist/src/browser/ProductQuantization.js +337 -0
- package/dist/src/browser/ProductQuantization.js.map +1 -0
- package/dist/src/browser/index.d.ts +223 -0
- package/dist/src/browser/index.d.ts.map +1 -0
- package/dist/src/browser/index.js +225 -0
- package/dist/src/browser/index.js.map +1 -0
- package/dist/src/cli/agentdb-cli.d.ts +154 -0
- package/dist/src/cli/agentdb-cli.d.ts.map +1 -0
- package/dist/src/cli/agentdb-cli.js +2273 -0
- package/dist/src/cli/agentdb-cli.js.map +1 -0
- package/dist/src/cli/commands/init.d.ts +12 -0
- package/dist/src/cli/commands/init.d.ts.map +1 -0
- package/dist/src/cli/commands/init.js +115 -0
- package/dist/src/cli/commands/init.js.map +1 -0
- package/dist/src/cli/commands/install-embeddings.d.ts +10 -0
- package/dist/src/cli/commands/install-embeddings.d.ts.map +1 -0
- package/dist/src/cli/commands/install-embeddings.js +68 -0
- package/dist/src/cli/commands/install-embeddings.js.map +1 -0
- package/dist/src/cli/commands/migrate.d.ts +15 -0
- package/dist/src/cli/commands/migrate.d.ts.map +1 -0
- package/dist/src/cli/commands/migrate.js +425 -0
- package/dist/src/cli/commands/migrate.js.map +1 -0
- package/dist/src/cli/commands/simulate-custom.d.ts +26 -0
- package/dist/src/cli/commands/simulate-custom.d.ts.map +1 -0
- package/dist/src/cli/commands/simulate-custom.js +207 -0
- package/dist/src/cli/commands/simulate-custom.js.map +1 -0
- package/dist/src/cli/commands/simulate-report.d.ts +15 -0
- package/dist/src/cli/commands/simulate-report.d.ts.map +1 -0
- package/dist/src/cli/commands/simulate-report.js +136 -0
- package/dist/src/cli/commands/simulate-report.js.map +1 -0
- package/dist/src/cli/commands/simulate-wizard.d.ts +6 -0
- package/dist/src/cli/commands/simulate-wizard.d.ts.map +1 -0
- package/dist/src/cli/commands/simulate-wizard.js +352 -0
- package/dist/src/cli/commands/simulate-wizard.js.map +1 -0
- package/dist/src/cli/commands/simulate.d.ts +7 -0
- package/dist/src/cli/commands/simulate.d.ts.map +1 -0
- package/dist/src/cli/commands/simulate.js +100 -0
- package/dist/src/cli/commands/simulate.js.map +1 -0
- package/dist/src/cli/commands/status.d.ts +10 -0
- package/dist/src/cli/commands/status.d.ts.map +1 -0
- package/dist/src/cli/commands/status.js +129 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/lib/config-manager.d.ts +110 -0
- package/dist/src/cli/lib/config-manager.d.ts.map +1 -0
- package/dist/src/cli/lib/config-manager.js +512 -0
- package/dist/src/cli/lib/config-manager.js.map +1 -0
- package/dist/src/cli/lib/config-validator.d.ts +43 -0
- package/dist/src/cli/lib/config-validator.d.ts.map +1 -0
- package/dist/src/cli/lib/config-validator.js +217 -0
- package/dist/src/cli/lib/config-validator.js.map +1 -0
- package/dist/src/cli/lib/health-monitor.d.ts +149 -0
- package/dist/src/cli/lib/health-monitor.d.ts.map +1 -0
- package/dist/src/cli/lib/health-monitor.js +380 -0
- package/dist/src/cli/lib/health-monitor.js.map +1 -0
- package/dist/src/cli/lib/help-formatter.d.ts +38 -0
- package/dist/src/cli/lib/help-formatter.d.ts.map +1 -0
- package/dist/src/cli/lib/help-formatter.js +357 -0
- package/dist/src/cli/lib/help-formatter.js.map +1 -0
- package/dist/src/cli/lib/history-tracker.d.ts +103 -0
- package/dist/src/cli/lib/history-tracker.d.ts.map +1 -0
- package/dist/src/cli/lib/history-tracker.js +346 -0
- package/dist/src/cli/lib/history-tracker.js.map +1 -0
- package/dist/src/cli/lib/report-generator.d.ts +24 -0
- package/dist/src/cli/lib/report-generator.d.ts.map +1 -0
- package/dist/src/cli/lib/report-generator.js +417 -0
- package/dist/src/cli/lib/report-generator.js.map +1 -0
- package/dist/src/cli/lib/report-store.d.ts +116 -0
- package/dist/src/cli/lib/report-store.d.ts.map +1 -0
- package/dist/src/cli/lib/report-store.js +464 -0
- package/dist/src/cli/lib/report-store.js.map +1 -0
- package/dist/src/cli/lib/simulation-registry.d.ts +165 -0
- package/dist/src/cli/lib/simulation-registry.d.ts.map +1 -0
- package/dist/src/cli/lib/simulation-registry.js +332 -0
- package/dist/src/cli/lib/simulation-registry.js.map +1 -0
- package/dist/src/cli/lib/simulation-runner.d.ts +90 -0
- package/dist/src/cli/lib/simulation-runner.d.ts.map +1 -0
- package/dist/src/cli/lib/simulation-runner.js +211 -0
- package/dist/src/cli/lib/simulation-runner.js.map +1 -0
- package/dist/src/controllers/CausalMemoryGraph.d.ts +127 -0
- package/dist/src/controllers/CausalMemoryGraph.d.ts.map +1 -0
- package/dist/src/controllers/CausalMemoryGraph.js +354 -0
- package/dist/src/controllers/CausalMemoryGraph.js.map +1 -0
- package/dist/src/controllers/CausalRecall.d.ts +139 -0
- package/dist/src/controllers/CausalRecall.d.ts.map +1 -0
- package/dist/src/controllers/CausalRecall.js +356 -0
- package/dist/src/controllers/CausalRecall.js.map +1 -0
- package/dist/src/controllers/ContextSynthesizer.d.ts +65 -0
- package/dist/src/controllers/ContextSynthesizer.d.ts.map +1 -0
- package/dist/src/controllers/ContextSynthesizer.js +208 -0
- package/dist/src/controllers/ContextSynthesizer.js.map +1 -0
- package/dist/src/controllers/EmbeddingService.d.ts +37 -0
- package/dist/src/controllers/EmbeddingService.d.ts.map +1 -0
- package/dist/src/controllers/EmbeddingService.js +136 -0
- package/dist/src/controllers/EmbeddingService.js.map +1 -0
- package/dist/src/controllers/EnhancedEmbeddingService.d.ts +50 -0
- package/dist/src/controllers/EnhancedEmbeddingService.d.ts.map +1 -0
- package/dist/src/controllers/EnhancedEmbeddingService.js +119 -0
- package/dist/src/controllers/EnhancedEmbeddingService.js.map +1 -0
- package/dist/src/controllers/ExplainableRecall.d.ts +163 -0
- package/dist/src/controllers/ExplainableRecall.d.ts.map +1 -0
- package/dist/src/controllers/ExplainableRecall.js +485 -0
- package/dist/src/controllers/ExplainableRecall.js.map +1 -0
- package/dist/src/controllers/HNSWIndex.d.ts +128 -0
- package/dist/src/controllers/HNSWIndex.d.ts.map +1 -0
- package/dist/src/controllers/HNSWIndex.js +361 -0
- package/dist/src/controllers/HNSWIndex.js.map +1 -0
- package/dist/src/controllers/LearningSystem.d.ts +195 -0
- package/dist/src/controllers/LearningSystem.d.ts.map +1 -0
- package/dist/src/controllers/LearningSystem.js +929 -0
- package/dist/src/controllers/LearningSystem.js.map +1 -0
- package/dist/src/controllers/MMRDiversityRanker.d.ts +50 -0
- package/dist/src/controllers/MMRDiversityRanker.d.ts.map +1 -0
- package/dist/src/controllers/MMRDiversityRanker.js +130 -0
- package/dist/src/controllers/MMRDiversityRanker.js.map +1 -0
- package/dist/src/controllers/MetadataFilter.d.ts +70 -0
- package/dist/src/controllers/MetadataFilter.d.ts.map +1 -0
- package/dist/src/controllers/MetadataFilter.js +243 -0
- package/dist/src/controllers/MetadataFilter.js.map +1 -0
- package/dist/src/controllers/NightlyLearner.d.ts +114 -0
- package/dist/src/controllers/NightlyLearner.d.ts.map +1 -0
- package/dist/src/controllers/NightlyLearner.js +394 -0
- package/dist/src/controllers/NightlyLearner.js.map +1 -0
- package/dist/src/controllers/QUICClient.d.ts +109 -0
- package/dist/src/controllers/QUICClient.d.ts.map +1 -0
- package/dist/src/controllers/QUICClient.js +299 -0
- package/dist/src/controllers/QUICClient.js.map +1 -0
- package/dist/src/controllers/QUICServer.d.ts +121 -0
- package/dist/src/controllers/QUICServer.d.ts.map +1 -0
- package/dist/src/controllers/QUICServer.js +383 -0
- package/dist/src/controllers/QUICServer.js.map +1 -0
- package/dist/src/controllers/ReasoningBank.d.ts +196 -0
- package/dist/src/controllers/ReasoningBank.d.ts.map +1 -0
- package/dist/src/controllers/ReasoningBank.js +494 -0
- package/dist/src/controllers/ReasoningBank.js.map +1 -0
- package/dist/src/controllers/ReflexionMemory.d.ts +125 -0
- package/dist/src/controllers/ReflexionMemory.d.ts.map +1 -0
- package/dist/src/controllers/ReflexionMemory.js +654 -0
- package/dist/src/controllers/ReflexionMemory.js.map +1 -0
- package/dist/src/controllers/SkillLibrary.d.ts +150 -0
- package/dist/src/controllers/SkillLibrary.d.ts.map +1 -0
- package/dist/src/controllers/SkillLibrary.js +608 -0
- package/dist/src/controllers/SkillLibrary.js.map +1 -0
- package/dist/src/controllers/SyncCoordinator.d.ts +120 -0
- package/dist/src/controllers/SyncCoordinator.d.ts.map +1 -0
- package/dist/src/controllers/SyncCoordinator.js +441 -0
- package/dist/src/controllers/SyncCoordinator.js.map +1 -0
- package/dist/src/controllers/WASMVectorSearch.d.ts +89 -0
- package/dist/src/controllers/WASMVectorSearch.d.ts.map +1 -0
- package/dist/src/controllers/WASMVectorSearch.js +234 -0
- package/dist/src/controllers/WASMVectorSearch.js.map +1 -0
- package/dist/src/controllers/frontier-index.d.ts +14 -0
- package/dist/src/controllers/frontier-index.d.ts.map +1 -0
- package/dist/src/controllers/frontier-index.js +10 -0
- package/dist/src/controllers/frontier-index.js.map +1 -0
- package/dist/src/controllers/index.d.ts +30 -0
- package/dist/src/controllers/index.d.ts.map +1 -0
- package/dist/src/controllers/index.js +18 -0
- package/dist/src/controllers/index.js.map +1 -0
- package/dist/src/db-fallback.d.ts +26 -0
- package/dist/src/db-fallback.d.ts.map +1 -0
- package/dist/src/db-fallback.js +264 -0
- package/dist/src/db-fallback.js.map +1 -0
- package/dist/src/db-test.d.ts +13 -0
- package/dist/src/db-test.d.ts.map +1 -0
- package/dist/src/db-test.js +55 -0
- package/dist/src/db-test.js.map +1 -0
- package/dist/src/db-unified.d.ts +76 -0
- package/dist/src/db-unified.d.ts.map +1 -0
- package/dist/src/db-unified.js +279 -0
- package/dist/src/db-unified.js.map +1 -0
- package/dist/src/examples/quic-sync-example.d.ts +9 -0
- package/dist/src/examples/quic-sync-example.d.ts.map +1 -0
- package/dist/src/examples/quic-sync-example.js +169 -0
- package/dist/src/examples/quic-sync-example.js.map +1 -0
- package/dist/src/examples/wasm-vector-usage.d.ts +12 -0
- package/dist/src/examples/wasm-vector-usage.d.ts.map +1 -0
- package/dist/src/examples/wasm-vector-usage.js +190 -0
- package/dist/src/examples/wasm-vector-usage.js.map +1 -0
- package/dist/src/index.d.ts +28 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +35 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/mcp/agentdb-mcp-server.d.ts +8 -0
- package/dist/src/mcp/agentdb-mcp-server.d.ts.map +1 -0
- package/dist/src/mcp/agentdb-mcp-server.js +2116 -0
- package/dist/src/mcp/agentdb-mcp-server.js.map +1 -0
- package/dist/src/mcp/learning-tools-handlers.d.ts +16 -0
- package/dist/src/mcp/learning-tools-handlers.d.ts.map +1 -0
- package/dist/src/mcp/learning-tools-handlers.js +105 -0
- package/dist/src/mcp/learning-tools-handlers.js.map +1 -0
- package/dist/src/optimizations/BatchOperations.d.ts +109 -0
- package/dist/src/optimizations/BatchOperations.d.ts.map +1 -0
- package/dist/src/optimizations/BatchOperations.js +407 -0
- package/dist/src/optimizations/BatchOperations.js.map +1 -0
- package/dist/src/optimizations/QueryOptimizer.d.ts +83 -0
- package/dist/src/optimizations/QueryOptimizer.d.ts.map +1 -0
- package/dist/src/optimizations/QueryOptimizer.js +228 -0
- package/dist/src/optimizations/QueryOptimizer.js.map +1 -0
- package/dist/src/optimizations/ToolCache.d.ts +137 -0
- package/dist/src/optimizations/ToolCache.d.ts.map +1 -0
- package/dist/src/optimizations/ToolCache.js +281 -0
- package/dist/src/optimizations/ToolCache.js.map +1 -0
- package/dist/src/optimizations/index.d.ts +10 -0
- package/dist/src/optimizations/index.d.ts.map +1 -0
- package/dist/src/optimizations/index.js +8 -0
- package/dist/src/optimizations/index.js.map +1 -0
- package/dist/src/security/input-validation.d.ts +109 -0
- package/dist/src/security/input-validation.d.ts.map +1 -0
- package/dist/src/security/input-validation.js +398 -0
- package/dist/src/security/input-validation.js.map +1 -0
- package/dist/src/security/limits.d.ts +150 -0
- package/dist/src/security/limits.d.ts.map +1 -0
- package/dist/src/security/limits.js +288 -0
- package/dist/src/security/limits.js.map +1 -0
- package/dist/src/security/path-security.d.ts +100 -0
- package/dist/src/security/path-security.d.ts.map +1 -0
- package/dist/src/security/path-security.js +337 -0
- package/dist/src/security/path-security.js.map +1 -0
- package/dist/src/security/validation.d.ts +95 -0
- package/dist/src/security/validation.d.ts.map +1 -0
- package/dist/src/security/validation.js +315 -0
- package/dist/src/security/validation.js.map +1 -0
- package/dist/src/services/LLMRouter.d.ts +84 -0
- package/dist/src/services/LLMRouter.d.ts.map +1 -0
- package/dist/src/services/LLMRouter.js +329 -0
- package/dist/src/services/LLMRouter.js.map +1 -0
- package/dist/src/types/quic.d.ts +518 -0
- package/dist/src/types/quic.d.ts.map +1 -0
- package/dist/src/types/quic.js +272 -0
- package/dist/src/types/quic.js.map +1 -0
- package/dist/src/utils/NodeIdMapper.d.ts +38 -0
- package/dist/src/utils/NodeIdMapper.d.ts.map +1 -0
- package/dist/src/utils/NodeIdMapper.js +57 -0
- package/dist/src/utils/NodeIdMapper.js.map +1 -0
- package/package.json +15 -3
- package/scripts/README.md +314 -0
- package/src/backends/GraphBackend.ts +290 -0
- package/src/backends/LearningBackend.ts +210 -0
- package/src/backends/README.md +389 -0
- package/src/backends/VectorBackend.ts +145 -0
- package/src/backends/detector.ts +283 -0
- package/src/backends/factory.ts +193 -0
- package/src/backends/graph/GraphDatabaseAdapter.ts +334 -0
- package/src/backends/hnswlib/HNSWLibBackend.ts +413 -0
- package/src/backends/hnswlib/index.ts +7 -0
- package/src/backends/index.ts +32 -0
- package/src/backends/ruvector/RuVectorBackend.ts +232 -0
- package/src/backends/ruvector/RuVectorLearning.ts +242 -0
- package/src/backends/ruvector/index.ts +9 -0
- package/src/backends/ruvector/types.d.ts +64 -0
- package/src/browser/AdvancedFeatures.ts +565 -0
- package/src/browser/HNSWIndex.ts +494 -0
- package/src/browser/ProductQuantization.ts +419 -0
- package/src/browser/index.ts +301 -0
- package/src/cli/agentdb-cli.ts +131 -8
- package/src/cli/commands/init.ts +148 -0
- package/src/cli/commands/install-embeddings.ts +81 -0
- package/src/cli/commands/migrate.ts +545 -0
- package/src/cli/commands/simulate-custom.ts +232 -0
- package/src/cli/commands/simulate-report.ts +171 -0
- package/src/cli/commands/simulate-wizard.ts +379 -0
- package/src/cli/commands/simulate.ts +115 -0
- package/src/cli/commands/status.ts +156 -0
- package/src/cli/lib/config-manager.ts +627 -0
- package/src/cli/lib/config-validator.ts +261 -0
- package/src/cli/lib/health-monitor.ts +513 -0
- package/src/cli/lib/help-formatter.ts +406 -0
- package/src/cli/lib/history-tracker.ts +497 -0
- package/src/cli/lib/report-generator.ts +455 -0
- package/src/cli/lib/report-store.ts +582 -0
- package/src/cli/lib/simulation-registry.ts +502 -0
- package/src/cli/lib/simulation-runner.ts +291 -0
- package/src/cli/tests/agentdb-cli.test.ts +58 -0
- package/src/controllers/CausalMemoryGraph.ts +42 -2
- package/src/controllers/CausalRecall.ts +41 -4
- package/src/controllers/ExplainableRecall.ts +123 -5
- package/src/controllers/HNSWIndex.ts +495 -0
- package/src/controllers/NightlyLearner.ts +8 -4
- package/src/controllers/ReasoningBank.ts +268 -5
- package/src/controllers/ReflexionMemory.ts +531 -6
- package/src/controllers/SkillLibrary.ts +234 -60
- package/src/controllers/index.ts +2 -0
- package/src/db-fallback.ts +103 -35
- package/src/db-test.ts +59 -0
- package/src/db-unified.ts +327 -0
- package/src/index.ts +2 -1
- package/src/mcp/agentdb-mcp-server.ts +544 -38
- package/src/optimizations/BatchOperations.ts +270 -0
- package/src/optimizations/ToolCache.ts +355 -0
- package/src/security/input-validation.ts +166 -0
- package/src/security/limits.ts +375 -0
- package/src/security/path-security.ts +436 -0
- package/src/security/validation.ts +556 -0
- package/src/services/LLMRouter.ts +406 -0
- package/src/types/xenova-transformers.d.ts +26 -0
- package/src/utils/NodeIdMapper.ts +64 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GraphBackend Interface - Graph database capabilities (Optional)
|
|
3
|
+
*
|
|
4
|
+
* Provides property graph storage and Cypher-like query capabilities.
|
|
5
|
+
* Available when @ruvector/graph-node is installed.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Node and relationship management
|
|
9
|
+
* - Cypher query execution
|
|
10
|
+
* - Graph traversal and pattern matching
|
|
11
|
+
* - Integration with vector search
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Graph node representation
|
|
15
|
+
*/
|
|
16
|
+
export interface GraphNode {
|
|
17
|
+
/** Unique node identifier */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Node labels (types) */
|
|
20
|
+
labels: string[];
|
|
21
|
+
/** Node properties */
|
|
22
|
+
properties: Record<string, any>;
|
|
23
|
+
/** Optional vector embedding for hybrid search */
|
|
24
|
+
embedding?: Float32Array;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Graph relationship representation
|
|
28
|
+
*/
|
|
29
|
+
export interface GraphRelationship {
|
|
30
|
+
/** Unique relationship identifier */
|
|
31
|
+
id: string;
|
|
32
|
+
/** Source node ID */
|
|
33
|
+
from: string;
|
|
34
|
+
/** Target node ID */
|
|
35
|
+
to: string;
|
|
36
|
+
/** Relationship type */
|
|
37
|
+
type: string;
|
|
38
|
+
/** Relationship properties */
|
|
39
|
+
properties?: Record<string, any>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Cypher query result
|
|
43
|
+
*/
|
|
44
|
+
export interface QueryResult {
|
|
45
|
+
/** Result rows */
|
|
46
|
+
rows: Record<string, any>[];
|
|
47
|
+
/** Result columns */
|
|
48
|
+
columns: string[];
|
|
49
|
+
/** Number of rows returned */
|
|
50
|
+
count: number;
|
|
51
|
+
/** Query execution time in milliseconds */
|
|
52
|
+
executionTime: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Graph traversal options
|
|
56
|
+
*/
|
|
57
|
+
export interface TraversalOptions {
|
|
58
|
+
/** Maximum traversal depth */
|
|
59
|
+
maxDepth?: number;
|
|
60
|
+
/** Relationship types to follow (empty = all) */
|
|
61
|
+
relationshipTypes?: string[];
|
|
62
|
+
/** Node label filter */
|
|
63
|
+
nodeLabels?: string[];
|
|
64
|
+
/** Direction: 'outgoing', 'incoming', 'both' */
|
|
65
|
+
direction?: 'outgoing' | 'incoming' | 'both';
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Graph statistics
|
|
69
|
+
*/
|
|
70
|
+
export interface GraphStats {
|
|
71
|
+
/** Total number of nodes */
|
|
72
|
+
nodeCount: number;
|
|
73
|
+
/** Total number of relationships */
|
|
74
|
+
relationshipCount: number;
|
|
75
|
+
/** Node label distribution */
|
|
76
|
+
nodeLabelCounts: Record<string, number>;
|
|
77
|
+
/** Relationship type distribution */
|
|
78
|
+
relationshipTypeCounts: Record<string, number>;
|
|
79
|
+
/** Estimated memory usage in bytes */
|
|
80
|
+
memoryUsage: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* GraphBackend - Optional graph database interface
|
|
84
|
+
*
|
|
85
|
+
* Implementations:
|
|
86
|
+
* - RuVectorGraph: Native Rust graph with @ruvector/graph-node
|
|
87
|
+
* - MockGraphBackend: No-op implementation for testing
|
|
88
|
+
*/
|
|
89
|
+
export interface GraphBackend {
|
|
90
|
+
/**
|
|
91
|
+
* Execute a Cypher query
|
|
92
|
+
*
|
|
93
|
+
* @param cypher - Cypher query string
|
|
94
|
+
* @param params - Query parameters
|
|
95
|
+
* @returns Query result with rows and metadata
|
|
96
|
+
*/
|
|
97
|
+
execute(cypher: string, params?: Record<string, any>): Promise<QueryResult>;
|
|
98
|
+
/**
|
|
99
|
+
* Create a new node
|
|
100
|
+
*
|
|
101
|
+
* @param labels - Node labels (types)
|
|
102
|
+
* @param properties - Node properties
|
|
103
|
+
* @returns Created node ID
|
|
104
|
+
*/
|
|
105
|
+
createNode(labels: string[], properties: Record<string, any>): Promise<string>;
|
|
106
|
+
/**
|
|
107
|
+
* Get a node by ID
|
|
108
|
+
*
|
|
109
|
+
* @param id - Node identifier
|
|
110
|
+
* @returns Node or null if not found
|
|
111
|
+
*/
|
|
112
|
+
getNode(id: string): Promise<GraphNode | null>;
|
|
113
|
+
/**
|
|
114
|
+
* Update node properties
|
|
115
|
+
*
|
|
116
|
+
* @param id - Node identifier
|
|
117
|
+
* @param properties - Properties to update
|
|
118
|
+
* @returns True if updated, false if not found
|
|
119
|
+
*/
|
|
120
|
+
updateNode(id: string, properties: Record<string, any>): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Delete a node and its relationships
|
|
123
|
+
*
|
|
124
|
+
* @param id - Node identifier
|
|
125
|
+
* @returns True if deleted, false if not found
|
|
126
|
+
*/
|
|
127
|
+
deleteNode(id: string): Promise<boolean>;
|
|
128
|
+
/**
|
|
129
|
+
* Create a relationship between nodes
|
|
130
|
+
*
|
|
131
|
+
* @param from - Source node ID
|
|
132
|
+
* @param to - Target node ID
|
|
133
|
+
* @param type - Relationship type
|
|
134
|
+
* @param properties - Optional relationship properties
|
|
135
|
+
* @returns Created relationship ID
|
|
136
|
+
*/
|
|
137
|
+
createRelationship(from: string, to: string, type: string, properties?: Record<string, any>): Promise<string>;
|
|
138
|
+
/**
|
|
139
|
+
* Get a relationship by ID
|
|
140
|
+
*
|
|
141
|
+
* @param id - Relationship identifier
|
|
142
|
+
* @returns Relationship or null if not found
|
|
143
|
+
*/
|
|
144
|
+
getRelationship(id: string): Promise<GraphRelationship | null>;
|
|
145
|
+
/**
|
|
146
|
+
* Delete a relationship
|
|
147
|
+
*
|
|
148
|
+
* @param id - Relationship identifier
|
|
149
|
+
* @returns True if deleted, false if not found
|
|
150
|
+
*/
|
|
151
|
+
deleteRelationship(id: string): Promise<boolean>;
|
|
152
|
+
/**
|
|
153
|
+
* Traverse the graph from a starting node
|
|
154
|
+
*
|
|
155
|
+
* @param startId - Starting node ID
|
|
156
|
+
* @param pattern - Traversal pattern (e.g., "()-[:RELATES_TO]->(:Entity)")
|
|
157
|
+
* @param options - Traversal options
|
|
158
|
+
* @returns Array of nodes found during traversal
|
|
159
|
+
*/
|
|
160
|
+
traverse(startId: string, pattern: string, options?: TraversalOptions): Promise<GraphNode[]>;
|
|
161
|
+
/**
|
|
162
|
+
* Find shortest path between two nodes
|
|
163
|
+
*
|
|
164
|
+
* @param fromId - Source node ID
|
|
165
|
+
* @param toId - Target node ID
|
|
166
|
+
* @param options - Traversal options
|
|
167
|
+
* @returns Array of nodes representing the path, or empty if no path exists
|
|
168
|
+
*/
|
|
169
|
+
shortestPath(fromId: string, toId: string, options?: TraversalOptions): Promise<GraphNode[]>;
|
|
170
|
+
/**
|
|
171
|
+
* Find nodes similar to a query vector within a graph context
|
|
172
|
+
*
|
|
173
|
+
* Combines vector similarity search with graph structure
|
|
174
|
+
*
|
|
175
|
+
* @param query - Query vector
|
|
176
|
+
* @param k - Number of results
|
|
177
|
+
* @param contextNodeId - Optional context node for graph-based filtering
|
|
178
|
+
* @returns Array of nodes sorted by similarity
|
|
179
|
+
*/
|
|
180
|
+
vectorSearch(query: Float32Array, k: number, contextNodeId?: string): Promise<GraphNode[]>;
|
|
181
|
+
/**
|
|
182
|
+
* Get graph statistics
|
|
183
|
+
*
|
|
184
|
+
* @returns Current statistics of the graph
|
|
185
|
+
*/
|
|
186
|
+
getStats(): GraphStats;
|
|
187
|
+
/**
|
|
188
|
+
* Clear the entire graph
|
|
189
|
+
*/
|
|
190
|
+
clear(): Promise<void>;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Type guard to check if an object implements GraphBackend
|
|
194
|
+
*/
|
|
195
|
+
export declare function isGraphBackend(obj: any): obj is GraphBackend;
|
|
196
|
+
//# sourceMappingURL=GraphBackend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphBackend.d.ts","sourceRoot":"","sources":["../../../src/backends/GraphBackend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IAEX,0BAA0B;IAC1B,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,sBAAsB;IACtB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEhC,kDAAkD;IAClD,SAAS,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IAEX,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IAEb,qBAAqB;IACrB,EAAE,EAAE,MAAM,CAAC;IAEX,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IAE5B,qBAAqB;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IAEd,2CAA2C;IAC3C,aAAa,EAAE,M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
+
*
|
|
4
|
+
* Provides property graph storage and Cypher-like query capabilities.
|
|
5
|
+
* Available when @ruvector/graph-node is installed.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Node and relationship management
|
|
9
|
+
* - Cypher query execution
|
|
10
|
+
* - Graph traversal and pattern matching
|
|
11
|
+
* - Integration with vector search
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Type guard to check if an object implements GraphBackend
|
|
15
|
+
*/
|
|
16
|
+
export function isGraphBackend(obj) {
|
|
17
|
+
return (typeof obj === 'object' &&
|
|
18
|
+
obj !== null &&
|
|
19
|
+
typeof obj.execute === 'function' &&
|
|
20
|
+
typeof obj.createNode === 'function' &&
|
|
21
|
+
typeof obj.getNode === 'function' &&
|
|
22
|
+
typeof obj.updateNode === 'function' &&
|
|
23
|
+
typeof obj.deleteNode === 'function' &&
|
|
24
|
+
typeof obj.createRelationship === 'function' &&
|
|
25
|
+
typeof obj.getRelationship === 'function' &&
|
|
26
|
+
typeof obj.deleteRelationship === 'function' &&
|
|
27
|
+
typeof obj.traverse === 'function' &&
|
|
28
|
+
typeof obj.shortestPath === 'function' &&
|
|
29
|
+
typeof obj.vectorSearch === 'function' &&
|
|
30
|
+
typeof obj.getStats === 'function' &&
|
|
31
|
+
typeof obj.clear === 'function');
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=GraphBackend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphBackend.js","sourceRoot":"","sources":["../../../src/backends/GraphBackend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAiQH;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAQ;IACrC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU;QACjC,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU;QACpC,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU;QACjC,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU;QACpC,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU;QACpC,OAAO,GAAG,CAAC,kBAAkB,KAAK,UAAU;QAC5C,OAAO,GAAG,CAAC,eAAe,KAAK,UAAU;QACzC,OAAO,GAAG,CAAC,kBAAkB,KAAK,UAAU;QAC5C,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU;QAClC,OAAO,GAAG,CAAC,YAAY,KAAK,UAAU;QACtC,OAAO,GAAG,CAAC,YAAY,KAAK,UAAU;QACtC,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU;QAClC,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU,CAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LearningBackend Interface - GNN self-learning capabilities (Optional)
|
|
3
|
+
*
|
|
4
|
+
* Provides Graph Neural Network (GNN) based learning for query enhancement
|
|
5
|
+
* and adaptive pattern recognition. Available when @ruvector/gnn is installed.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Query enhancement using attention mechanisms
|
|
9
|
+
* - Automatic learning from search patterns
|
|
10
|
+
* - Model persistence and versioning
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Learning backend configuration
|
|
14
|
+
*/
|
|
15
|
+
export interface LearningConfig {
|
|
16
|
+
/** Enable learning features */
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
/** Input dimension (must match vector dimension) */
|
|
19
|
+
inputDim: number;
|
|
20
|
+
/** Output dimension (defaults to inputDim) */
|
|
21
|
+
outputDim?: number;
|
|
22
|
+
/** Number of attention heads for GNN */
|
|
23
|
+
heads?: number;
|
|
24
|
+
/** Learning rate for training */
|
|
25
|
+
learningRate?: number;
|
|
26
|
+
/** Batch size for training */
|
|
27
|
+
batchSize?: number;
|
|
28
|
+
/** Path for model persistence */
|
|
29
|
+
modelPath?: string;
|
|
30
|
+
/** Auto-train interval in seconds (0 = disabled) */
|
|
31
|
+
autoTrainInterval?: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Training sample for supervised learning
|
|
35
|
+
*/
|
|
36
|
+
export interface TrainingSample {
|
|
37
|
+
/** Input embedding */
|
|
38
|
+
embedding: Float32Array;
|
|
39
|
+
/** Label or class (for classification) */
|
|
40
|
+
label: number;
|
|
41
|
+
/** Sample weight (importance) */
|
|
42
|
+
weight?: number;
|
|
43
|
+
/** Additional context for learning */
|
|
44
|
+
context?: Record<string, any>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Training result metrics
|
|
48
|
+
*/
|
|
49
|
+
export interface TrainingResult {
|
|
50
|
+
/** Number of training epochs completed */
|
|
51
|
+
epochs: number;
|
|
52
|
+
/** Final loss value */
|
|
53
|
+
finalLoss: number;
|
|
54
|
+
/** Improvement percentage from initial loss */
|
|
55
|
+
improvement: number;
|
|
56
|
+
/** Training duration in milliseconds */
|
|
57
|
+
duration: number;
|
|
58
|
+
/** Additional metrics */
|
|
59
|
+
metrics?: Record<string, number>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Learning backend statistics
|
|
63
|
+
*/
|
|
64
|
+
export interface LearningStats {
|
|
65
|
+
/** Whether learning is enabled */
|
|
66
|
+
enabled: boolean;
|
|
67
|
+
/** Number of samples collected */
|
|
68
|
+
samplesCollected: number;
|
|
69
|
+
/** Timestamp of last training (null if never trained) */
|
|
70
|
+
lastTrainingTime: number | null;
|
|
71
|
+
/** Current model version */
|
|
72
|
+
modelVersion: number;
|
|
73
|
+
/** Average training loss */
|
|
74
|
+
avgLoss?: number;
|
|
75
|
+
/** Model accuracy (if applicable) */
|
|
76
|
+
accuracy?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* LearningBackend - Optional GNN-based learning interface
|
|
80
|
+
*
|
|
81
|
+
* Implementations:
|
|
82
|
+
* - RuVectorLearning: Native Rust GNN with @ruvector/gnn
|
|
83
|
+
* - MockLearningBackend: No-op implementation for testing
|
|
84
|
+
*/
|
|
85
|
+
export interface LearningBackend {
|
|
86
|
+
/**
|
|
87
|
+
* Enhance query vector using GNN attention mechanism
|
|
88
|
+
*
|
|
89
|
+
* Takes a query vector and its k-nearest neighbors, applies graph attention,
|
|
90
|
+
* and returns an enhanced query vector with better semantic representation.
|
|
91
|
+
*
|
|
92
|
+
* @param query - Query vector to enhance
|
|
93
|
+
* @param neighbors - Neighbor vectors for context
|
|
94
|
+
* @param weights - Importance weights for each neighbor (0-1)
|
|
95
|
+
* @returns Enhanced query vector
|
|
96
|
+
*/
|
|
97
|
+
enhance(query: Float32Array, neighbors: Float32Array[], weights: number[]): Float32Array;
|
|
98
|
+
/**
|
|
99
|
+
* Add a training sample for future learning
|
|
100
|
+
*
|
|
101
|
+
* Samples are accumulated and used during the next training cycle.
|
|
102
|
+
*
|
|
103
|
+
* @param sample - Training sample with embedding and label
|
|
104
|
+
*/
|
|
105
|
+
addSample(sample: TrainingSample): void;
|
|
106
|
+
/**
|
|
107
|
+
* Train the model on accumulated samples
|
|
108
|
+
*
|
|
109
|
+
* @param options - Training options (epochs, etc.)
|
|
110
|
+
* @returns Training result with metrics
|
|
111
|
+
*/
|
|
112
|
+
train(options?: {
|
|
113
|
+
epochs?: number;
|
|
114
|
+
}): Promise<TrainingResult>;
|
|
115
|
+
/**
|
|
116
|
+
* Clear accumulated training samples
|
|
117
|
+
*/
|
|
118
|
+
clearSamples(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Save trained model to disk
|
|
121
|
+
*
|
|
122
|
+
* @param path - File path to save the model
|
|
123
|
+
* @returns Promise that resolves when model is saved
|
|
124
|
+
*/
|
|
125
|
+
saveModel(path: string): Promise<void>;
|
|
126
|
+
/**
|
|
127
|
+
* Load trained model from disk
|
|
128
|
+
*
|
|
129
|
+
* @param path - File path to load the model from
|
|
130
|
+
* @returns Promise that resolves when model is loaded
|
|
131
|
+
*/
|
|
132
|
+
loadModel(path: string): Promise<void>;
|
|
133
|
+
/**
|
|
134
|
+
* Get learning statistics and metadata
|
|
135
|
+
*
|
|
136
|
+
* @returns Current statistics of the learning backend
|
|
137
|
+
*/
|
|
138
|
+
getStats(): LearningStats;
|
|
139
|
+
/**
|
|
140
|
+
* Reset learning state (clear samples, reset model)
|
|
141
|
+
*/
|
|
142
|
+
reset(): void;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Type guard to check if an object implements LearningBackend
|
|
146
|
+
*/
|
|
147
|
+
export declare function isLearningBackend(obj: any): obj is LearningBackend;
|
|
148
|
+
//# sourceMappingURL=LearningBackend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LearningBackend.d.ts","sourceRoot":"","sources":["../../../src/backends/LearningBackend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,+BAA+B;IAC/B,OAAO,EAAE,OAAO,CAAC;IAEjB,oDAAoD;IACpD,QAAQ,EAAE,MAAM,CAAC;IAEjB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,iCAAiC;IACjC,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,oDAAoD;IACpD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,sBAAsB;IACtB,SAAS,EAAE,YAAY,CAAC;IAExB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IAEd,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM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AAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAMvC;;;;OAIG;IACH,QAAQ,IAAI,aAAa,CAAC;IAE1B;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,IAAI,eAAe,CAalE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LearningBackend Interface - GNN self-learning capabilities (Optional)
|
|
3
|
+
*
|
|
4
|
+
* Provides Graph Neural Network (GNN) based learning for query enhancement
|
|
5
|
+
* and adaptive pattern recognition. Available when @ruvector/gnn is installed.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Query enhancement using attention mechanisms
|
|
9
|
+
* - Automatic learning from search patterns
|
|
10
|
+
* - Model persistence and versioning
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Type guard to check if an object implements LearningBackend
|
|
14
|
+
*/
|
|
15
|
+
export function isLearningBackend(obj) {
|
|
16
|
+
return (typeof obj === 'object' &&
|
|
17
|
+
obj !== null &&
|
|
18
|
+
typeof obj.enhance === 'function' &&
|
|
19
|
+
typeof obj.addSample === 'function' &&
|
|
20
|
+
typeof obj.train === 'function' &&
|
|
21
|
+
typeof obj.clearSamples === 'function' &&
|
|
22
|
+
typeof obj.saveModel === 'function' &&
|
|
23
|
+
typeof obj.loadModel === 'function' &&
|
|
24
|
+
typeof obj.getStats === 'function' &&
|
|
25
|
+
typeof obj.reset === 'function');
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=LearningBackend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LearningBackend.js","sourceRoot":"","sources":["../../../src/backends/LearningBackend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuLH;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAQ;IACxC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,CAAC,OAAO,KAAK,UAAU;QACjC,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU;QACnC,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU;QAC/B,OAAO,GAAG,CAAC,YAAY,KAAK,UAAU;QACtC,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU;QACnC,OAAO,GAAG,CAAC,SAAS,KAAK,UAAU;QACnC,OAAO,GAAG,CAAC,QAAQ,KAAK,UAAU;QAClC,OAAO,GAAG,CAAC,KAAK,KAAK,UAAU,CAChC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VectorBackend - Unified interface for vector database backends
|
|
3
|
+
*
|
|
4
|
+
* Provides abstraction over different vector search implementations
|
|
5
|
+
* (RuVector, hnswlib-node) for AgentDB v2.
|
|
6
|
+
*
|
|
7
|
+
* Design:
|
|
8
|
+
* - String-based IDs for all operations (backends handle label mapping internally)
|
|
9
|
+
* - Consistent SearchResult format across backends
|
|
10
|
+
* - Save/load with metadata persistence
|
|
11
|
+
* - Backend-specific optimizations hidden behind interface
|
|
12
|
+
*/
|
|
13
|
+
export interface VectorConfig {
|
|
14
|
+
/** Vector dimension (e.g., 384, 768, 1536) */
|
|
15
|
+
dimension: number;
|
|
16
|
+
/** Distance metric: 'cosine', 'l2' (Euclidean), 'ip' (inner product) */
|
|
17
|
+
metric: 'cosine' | 'l2' | 'ip';
|
|
18
|
+
/** Maximum number of elements (default: 100000) */
|
|
19
|
+
maxElements?: number;
|
|
20
|
+
/** HNSW M parameter - connections per layer (default: 16) */
|
|
21
|
+
M?: number;
|
|
22
|
+
/** HNSW efConstruction - build quality (default: 200) */
|
|
23
|
+
efConstruction?: number;
|
|
24
|
+
/** HNSW efSearch - search quality (default: 100) */
|
|
25
|
+
efSearch?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface SearchResult {
|
|
28
|
+
/** String ID of the vector */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Raw distance value from backend */
|
|
31
|
+
distance: number;
|
|
32
|
+
/** Normalized similarity (0-1, higher is more similar) */
|
|
33
|
+
similarity: number;
|
|
34
|
+
/** Optional metadata attached to vector */
|
|
35
|
+
metadata?: Record<string, any>;
|
|
36
|
+
}
|
|
37
|
+
export interface SearchOptions {
|
|
38
|
+
/** Minimum similarity threshold (0-1) */
|
|
39
|
+
threshold?: number;
|
|
40
|
+
/** Override efSearch for this query */
|
|
41
|
+
efSearch?: number;
|
|
42
|
+
/** Metadata filters (post-filtering) */
|
|
43
|
+
filter?: Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
export interface VectorStats {
|
|
46
|
+
/** Number of vectors in index */
|
|
47
|
+
count: number;
|
|
48
|
+
/** Vector dimension */
|
|
49
|
+
dimension: number;
|
|
50
|
+
/** Distance metric */
|
|
51
|
+
metric: string;
|
|
52
|
+
/** Backend name */
|
|
53
|
+
backend: 'ruvector' | 'hnswlib';
|
|
54
|
+
/** Memory usage in bytes (0 if not available) */
|
|
55
|
+
memoryUsage: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* VectorBackend - Interface for vector search implementations
|
|
59
|
+
*
|
|
60
|
+
* All backends must:
|
|
61
|
+
* 1. Accept string IDs and handle label mapping internally
|
|
62
|
+
* 2. Normalize distances to similarities (0-1 range)
|
|
63
|
+
* 3. Support save/load with metadata persistence
|
|
64
|
+
* 4. Provide stats for monitoring
|
|
65
|
+
*/
|
|
66
|
+
export interface VectorBackend {
|
|
67
|
+
/** Backend name for detection and logging */
|
|
68
|
+
readonly name: 'ruvector' | 'hnswlib';
|
|
69
|
+
/**
|
|
70
|
+
* Insert a single vector with optional metadata
|
|
71
|
+
* @param id - Unique string identifier
|
|
72
|
+
* @param embedding - Vector as Float32Array
|
|
73
|
+
* @param metadata - Optional metadata to store with vector
|
|
74
|
+
*/
|
|
75
|
+
insert(id: string, embedding: Float32Array, metadata?: Record<string, any>): void;
|
|
76
|
+
/**
|
|
77
|
+
* Insert multiple vectors in batch (more efficient)
|
|
78
|
+
* @param items - Array of {id, embedding, metadata?}
|
|
79
|
+
*/
|
|
80
|
+
insertBatch(items: Array<{
|
|
81
|
+
id: string;
|
|
82
|
+
embedding: Float32Array;
|
|
83
|
+
metadata?: Record<string, any>;
|
|
84
|
+
}>): void;
|
|
85
|
+
/**
|
|
86
|
+
* Search for k-nearest neighbors
|
|
87
|
+
* @param query - Query vector
|
|
88
|
+
* @param k - Number of results
|
|
89
|
+
* @param options - Search options (threshold, efSearch, filters)
|
|
90
|
+
* @returns Sorted results (most similar first)
|
|
91
|
+
*/
|
|
92
|
+
search(query: Float32Array, k: number, options?: SearchOptions): SearchResult[];
|
|
93
|
+
/**
|
|
94
|
+
* Remove a vector by ID
|
|
95
|
+
* @param id - Vector ID to remove
|
|
96
|
+
* @returns true if removed, false if not found
|
|
97
|
+
*/
|
|
98
|
+
remove(id: string): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Get backend statistics
|
|
101
|
+
* @returns Stats object with count, dimension, backend name, etc.
|
|
102
|
+
*/
|
|
103
|
+
getStats(): VectorStats;
|
|
104
|
+
/**
|
|
105
|
+
* Save index to disk
|
|
106
|
+
* @param path - File path (backend adds extensions as needed)
|
|
107
|
+
*/
|
|
108
|
+
save(path: string): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Load index from disk
|
|
111
|
+
* @param path - File path (backend looks for associated files)
|
|
112
|
+
*/
|
|
113
|
+
load(path: string): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Close and cleanup resources
|
|
116
|
+
*/
|
|
117
|
+
close(): void;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=VectorBackend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorBackend.d.ts","sourceRoot":"","sources":["../../../src/backends/VectorBackend.ts"],"names":[],"mappings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C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IAElF;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,SAAS,EAAE,YAAY,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAChC,CAAC,GAAG,IAAI,CAAC;IAEV;;;;;;OAMG;IACH,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,YAAY,EAAE,CAAC;IAEhF;;;;OAIG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;IAE5B;;;OAGG;IACH,QAAQ,IAAI,WAAW,CAAC;IAExB;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VectorBackend - Unified interface for vector database backends
|
|
3
|
+
*
|
|
4
|
+
* Provides abstraction over different vector search implementations
|
|
5
|
+
* (RuVector, hnswlib-node) for AgentDB v2.
|
|
6
|
+
*
|
|
7
|
+
* Design:
|
|
8
|
+
* - String-based IDs for all operations (backends handle label mapping internally)
|
|
9
|
+
* - Consistent SearchResult format across backends
|
|
10
|
+
* - Save/load with metadata persistence
|
|
11
|
+
* - Backend-specific optimizations hidden behind interface
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=VectorBackend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VectorBackend.js","sourceRoot":"","sources":["../../../src/backends/VectorBackend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backend Detection - Auto-detect available vector backends
|
|
3
|
+
*
|
|
4
|
+
* Detection priority:
|
|
5
|
+
* 1. RuVector (@ruvector/core) - preferred for performance
|
|
6
|
+
* 2. HNSWLib (hnswlib-node) - stable fallback
|
|
7
|
+
*
|
|
8
|
+
* Additional features detected:
|
|
9
|
+
* - @ruvector/gnn - GNN learning capabilities
|
|
10
|
+
* - @ruvector/graph-node - Graph database capabilities
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Backend type identifier
|
|
14
|
+
*/
|
|
15
|
+
export type BackendType = 'ruvector' | 'hnswlib' | 'auto';
|
|
16
|
+
/**
|
|
17
|
+
* Platform information
|
|
18
|
+
*/
|
|
19
|
+
export interface PlatformInfo {
|
|
20
|
+
/** Operating system */
|
|
21
|
+
platform: NodeJS.Platform;
|
|
22
|
+
/** CPU architecture */
|
|
23
|
+
arch: string;
|
|
24
|
+
/** Combined platform identifier (e.g., 'linux-x64', 'darwin-arm64') */
|
|
25
|
+
combined: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Backend detection result
|
|
29
|
+
*/
|
|
30
|
+
export interface DetectionResult {
|
|
31
|
+
/** Detected backend type */
|
|
32
|
+
backend: 'ruvector' | 'hnswlib';
|
|
33
|
+
/** Available feature flags */
|
|
34
|
+
features: {
|
|
35
|
+
/** GNN learning available */
|
|
36
|
+
gnn: boolean;
|
|
37
|
+
/** Graph database available */
|
|
38
|
+
graph: boolean;
|
|
39
|
+
/** Compression available */
|
|
40
|
+
compression: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** Platform information */
|
|
43
|
+
platform: PlatformInfo;
|
|
44
|
+
/** Whether native bindings are available (vs WASM fallback) */
|
|
45
|
+
native: boolean;
|
|
46
|
+
/** Version information */
|
|
47
|
+
versions?: {
|
|
48
|
+
core?: string;
|
|
49
|
+
gnn?: string;
|
|
50
|
+
graph?: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Detect available vector backend and features
|
|
55
|
+
*
|
|
56
|
+
* @returns Detection result with backend type and available features
|
|
57
|
+
*/
|
|
58
|
+
export declare function detectBackend(): Promise<DetectionResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Validate requested backend is available
|
|
61
|
+
*
|
|
62
|
+
* @param requested - Requested backend type
|
|
63
|
+
* @param detected - Detected backend from auto-detection
|
|
64
|
+
* @throws Error if requested backend is not available
|
|
65
|
+
*/
|
|
66
|
+
export declare function validateBackend(requested: BackendType, detected: DetectionResult): void;
|
|
67
|
+
/**
|
|
68
|
+
* Get recommended backend for a given use case
|
|
69
|
+
*
|
|
70
|
+
* @param useCase - Use case identifier
|
|
71
|
+
* @returns Recommended backend type
|
|
72
|
+
*/
|
|
73
|
+
export declare function getRecommendedBackend(useCase: string): BackendType;
|
|
74
|
+
/**
|
|
75
|
+
* Format detection result for display
|
|
76
|
+
*
|
|
77
|
+
* @param result - Detection result
|
|
78
|
+
* @returns Formatted string for console output
|
|
79
|
+
*/
|
|
80
|
+
export declare function formatDetectionResult(result: DetectionResult): string;
|
|
81
|
+
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../../src/backends/detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAE1B,uBAAuB;IACvB,IAAI,EA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