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,314 @@
|
|
|
1
|
+
# AgentDB Scripts Directory
|
|
2
|
+
|
|
3
|
+
This directory contains build, validation, and deployment scripts for AgentDB v2.
|
|
4
|
+
|
|
5
|
+
## Build Scripts
|
|
6
|
+
|
|
7
|
+
### Browser Builds
|
|
8
|
+
|
|
9
|
+
#### `build-browser.js`
|
|
10
|
+
**Purpose:** Original browser bundle builder
|
|
11
|
+
**Usage:** `node scripts/build-browser.js`
|
|
12
|
+
**Output:** `dist/agentdb.browser.js`
|
|
13
|
+
**Features:**
|
|
14
|
+
- Basic SQL.js WASM integration
|
|
15
|
+
- Single-file browser bundle
|
|
16
|
+
- CDN-ready output
|
|
17
|
+
|
|
18
|
+
#### `build-browser-v2.js`
|
|
19
|
+
**Purpose:** Enhanced v2 browser bundle with advanced features
|
|
20
|
+
**Usage:** `node scripts/build-browser-v2.js`
|
|
21
|
+
**Output:** `dist/agentdb.browser.v2.js`
|
|
22
|
+
**Features:**
|
|
23
|
+
- Multi-backend support (SQL.js/IndexedDB auto-detection)
|
|
24
|
+
- GNN optimization integration
|
|
25
|
+
- IndexedDB persistence
|
|
26
|
+
- Cross-tab synchronization
|
|
27
|
+
- 100% v1 API backward compatibility
|
|
28
|
+
- Enhanced error handling
|
|
29
|
+
|
|
30
|
+
**Recommended:** Use this for new projects requiring browser support.
|
|
31
|
+
|
|
32
|
+
#### `build-browser-advanced.cjs`
|
|
33
|
+
**Purpose:** Advanced browser features build
|
|
34
|
+
**Usage:** `node scripts/build-browser-advanced.cjs`
|
|
35
|
+
**Features:**
|
|
36
|
+
- Advanced WASM optimization
|
|
37
|
+
- Progressive loading
|
|
38
|
+
- Service worker integration
|
|
39
|
+
- Memory management enhancements
|
|
40
|
+
|
|
41
|
+
### Dependencies
|
|
42
|
+
|
|
43
|
+
#### `postinstall.cjs`
|
|
44
|
+
**Purpose:** Post-installation setup and verification
|
|
45
|
+
**Auto-runs:** After `npm install`
|
|
46
|
+
**Tasks:**
|
|
47
|
+
- Validates environment
|
|
48
|
+
- Checks native dependencies (better-sqlite3)
|
|
49
|
+
- Sets up development environment
|
|
50
|
+
- Verifies WASM files
|
|
51
|
+
|
|
52
|
+
## Validation Scripts
|
|
53
|
+
|
|
54
|
+
### `comprehensive-review.ts`
|
|
55
|
+
**Purpose:** Complete v2 feature validation and performance testing
|
|
56
|
+
**Usage:** `tsx scripts/comprehensive-review.ts`
|
|
57
|
+
**Tests:**
|
|
58
|
+
- @ruvector/core integration
|
|
59
|
+
- @ruvector/gnn integration
|
|
60
|
+
- ReasoningBank functionality
|
|
61
|
+
- All v2 controllers (HNSW, QUIC, etc.)
|
|
62
|
+
- Backend performance comparison
|
|
63
|
+
- Memory usage analysis
|
|
64
|
+
- Optimization opportunities
|
|
65
|
+
|
|
66
|
+
**Output:** Comprehensive test report with metrics
|
|
67
|
+
|
|
68
|
+
### `validate-security-fixes.ts`
|
|
69
|
+
**Purpose:** Security validation and audit
|
|
70
|
+
**Usage:** `tsx scripts/validate-security-fixes.ts`
|
|
71
|
+
**Checks:**
|
|
72
|
+
- SQL injection prevention
|
|
73
|
+
- Input sanitization
|
|
74
|
+
- Path traversal protection
|
|
75
|
+
- Dependency vulnerabilities
|
|
76
|
+
- Code signing verification
|
|
77
|
+
|
|
78
|
+
### `verify-bundle.js`
|
|
79
|
+
**Purpose:** Bundle integrity verification
|
|
80
|
+
**Usage:** `node scripts/verify-bundle.js`
|
|
81
|
+
**Validates:**
|
|
82
|
+
- Bundle size limits
|
|
83
|
+
- Export completeness
|
|
84
|
+
- API surface consistency
|
|
85
|
+
- WASM file integrity
|
|
86
|
+
|
|
87
|
+
### `verify-core-tools-6-10.sh`
|
|
88
|
+
**Purpose:** Core tools validation (tools 6-10)
|
|
89
|
+
**Usage:** `bash scripts/verify-core-tools-6-10.sh`
|
|
90
|
+
**Tests:**
|
|
91
|
+
- Tool 6: Batch insert operations
|
|
92
|
+
- Tool 7: Hybrid search
|
|
93
|
+
- Tool 8: QUIC synchronization
|
|
94
|
+
- Tool 9: Learning plugins
|
|
95
|
+
- Tool 10: Performance benchmarks
|
|
96
|
+
|
|
97
|
+
## Release Scripts
|
|
98
|
+
|
|
99
|
+
### `npm-release.sh`
|
|
100
|
+
**Purpose:** Automated NPM release workflow
|
|
101
|
+
**Usage:** `bash scripts/npm-release.sh [version]`
|
|
102
|
+
**Process:**
|
|
103
|
+
1. Version bump (semver)
|
|
104
|
+
2. Changelog generation
|
|
105
|
+
3. Build verification
|
|
106
|
+
4. Test suite execution
|
|
107
|
+
5. Bundle validation
|
|
108
|
+
6. NPM publish
|
|
109
|
+
7. Git tag creation
|
|
110
|
+
|
|
111
|
+
**Requirements:**
|
|
112
|
+
- NPM authentication
|
|
113
|
+
- Git repository
|
|
114
|
+
- Clean working tree
|
|
115
|
+
|
|
116
|
+
### `pre-release-validation.sh`
|
|
117
|
+
**Purpose:** Pre-release quality gate
|
|
118
|
+
**Usage:** `bash scripts/pre-release-validation.sh`
|
|
119
|
+
**Validates:**
|
|
120
|
+
- All tests passing
|
|
121
|
+
- No TypeScript errors
|
|
122
|
+
- Bundle integrity
|
|
123
|
+
- Documentation accuracy
|
|
124
|
+
- Security audit clean
|
|
125
|
+
- Performance benchmarks met
|
|
126
|
+
|
|
127
|
+
## Testing Scripts
|
|
128
|
+
|
|
129
|
+
### `docker-test.sh`
|
|
130
|
+
**Purpose:** Docker environment testing
|
|
131
|
+
**Usage:** `bash scripts/docker-test.sh`
|
|
132
|
+
**Tests:**
|
|
133
|
+
- Installation in clean environment
|
|
134
|
+
- Runtime dependencies
|
|
135
|
+
- Cross-platform compatibility
|
|
136
|
+
- Network isolation scenarios
|
|
137
|
+
|
|
138
|
+
### `docker-validation.sh`
|
|
139
|
+
**Purpose:** Comprehensive Docker validation suite
|
|
140
|
+
**Usage:** `bash scripts/docker-validation.sh`
|
|
141
|
+
**Includes:**
|
|
142
|
+
- Multi-stage build verification
|
|
143
|
+
- Container security scan
|
|
144
|
+
- Resource usage monitoring
|
|
145
|
+
- Integration test suite
|
|
146
|
+
|
|
147
|
+
## AgentDB Version
|
|
148
|
+
|
|
149
|
+
**Current Version:** 1.6.1
|
|
150
|
+
**Target:** v2.0.0 with full backward compatibility
|
|
151
|
+
|
|
152
|
+
All scripts are designed to work with:
|
|
153
|
+
- **Node.js:** >=18.0.0
|
|
154
|
+
- **TypeScript:** ^5.7.2
|
|
155
|
+
- **Better-sqlite3:** ^11.8.1 (optional)
|
|
156
|
+
- **@ruvector/core:** ^0.1.15
|
|
157
|
+
- **@ruvector/gnn:** ^0.1.15
|
|
158
|
+
|
|
159
|
+
## Development Workflow
|
|
160
|
+
|
|
161
|
+
### 1. Local Development
|
|
162
|
+
```bash
|
|
163
|
+
npm run build # Full build pipeline
|
|
164
|
+
npm run dev # Development mode with tsx
|
|
165
|
+
npm test # Run test suite
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 2. Browser Testing
|
|
169
|
+
```bash
|
|
170
|
+
npm run build:browser # Build browser bundle
|
|
171
|
+
npm run test:browser # Test browser bundle
|
|
172
|
+
npm run verify:bundle # Verify bundle integrity
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### 3. Pre-Release Validation
|
|
176
|
+
```bash
|
|
177
|
+
bash scripts/pre-release-validation.sh
|
|
178
|
+
tsx scripts/comprehensive-review.ts
|
|
179
|
+
tsx scripts/validate-security-fixes.ts
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 4. Release
|
|
183
|
+
```bash
|
|
184
|
+
bash scripts/npm-release.sh patch # Patch release
|
|
185
|
+
bash scripts/npm-release.sh minor # Minor release
|
|
186
|
+
bash scripts/npm-release.sh major # Major release
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Script Dependencies
|
|
190
|
+
|
|
191
|
+
### Required Global Tools
|
|
192
|
+
- `node` (>=18.0.0)
|
|
193
|
+
- `npm` (>=9.0.0)
|
|
194
|
+
- `bash` (>=4.0)
|
|
195
|
+
- `tsx` (for TypeScript scripts)
|
|
196
|
+
- `docker` (for container tests)
|
|
197
|
+
|
|
198
|
+
### Package Scripts Integration
|
|
199
|
+
|
|
200
|
+
Scripts integrate with `package.json` scripts:
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{
|
|
204
|
+
"scripts": {
|
|
205
|
+
"build": "npm run build:ts && npm run copy:schemas && npm run build:browser",
|
|
206
|
+
"build:browser": "node scripts/build-browser.js",
|
|
207
|
+
"postinstall": "node scripts/postinstall.cjs || true",
|
|
208
|
+
"verify:bundle": "node scripts/verify-bundle.js",
|
|
209
|
+
"docker:test": "bash scripts/docker-test.sh"
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## Troubleshooting
|
|
215
|
+
|
|
216
|
+
### Build Failures
|
|
217
|
+
|
|
218
|
+
**Problem:** Browser bundle build fails
|
|
219
|
+
**Solution:**
|
|
220
|
+
```bash
|
|
221
|
+
# Clear dist and rebuild
|
|
222
|
+
rm -rf dist
|
|
223
|
+
npm run build
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Problem:** WASM files not loading
|
|
227
|
+
**Solution:**
|
|
228
|
+
```bash
|
|
229
|
+
# Re-download dependencies
|
|
230
|
+
rm -rf node_modules
|
|
231
|
+
npm install
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Validation Failures
|
|
235
|
+
|
|
236
|
+
**Problem:** Security validation fails
|
|
237
|
+
**Solution:**
|
|
238
|
+
```bash
|
|
239
|
+
npm audit fix
|
|
240
|
+
tsx scripts/validate-security-fixes.ts
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Problem:** Bundle size exceeded
|
|
244
|
+
**Solution:**
|
|
245
|
+
```bash
|
|
246
|
+
# Check bundle analysis
|
|
247
|
+
npm run verify:bundle
|
|
248
|
+
# Consider code splitting or lazy loading
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Release Issues
|
|
252
|
+
|
|
253
|
+
**Problem:** NPM publish fails
|
|
254
|
+
**Solution:**
|
|
255
|
+
```bash
|
|
256
|
+
# Verify authentication
|
|
257
|
+
npm whoami
|
|
258
|
+
npm login
|
|
259
|
+
|
|
260
|
+
# Check version
|
|
261
|
+
npm version patch --no-git-tag-version
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Best Practices
|
|
265
|
+
|
|
266
|
+
1. **Always run validation before releases:**
|
|
267
|
+
```bash
|
|
268
|
+
bash scripts/pre-release-validation.sh
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
2. **Test browser builds locally:**
|
|
272
|
+
```bash
|
|
273
|
+
npm run test:browser
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
3. **Keep dependencies updated:**
|
|
277
|
+
```bash
|
|
278
|
+
npm outdated
|
|
279
|
+
npm update
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
4. **Run security audits regularly:**
|
|
283
|
+
```bash
|
|
284
|
+
tsx scripts/validate-security-fixes.ts
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
5. **Verify Docker compatibility:**
|
|
288
|
+
```bash
|
|
289
|
+
bash scripts/docker-test.sh
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
## Contributing
|
|
293
|
+
|
|
294
|
+
When adding new scripts:
|
|
295
|
+
|
|
296
|
+
1. Add executable permissions: `chmod +x script-name.sh`
|
|
297
|
+
2. Include shebang line: `#!/usr/bin/env node` or `#!/usr/bin/env bash`
|
|
298
|
+
3. Add comprehensive error handling
|
|
299
|
+
4. Document in this README
|
|
300
|
+
5. Add to package.json scripts if appropriate
|
|
301
|
+
6. Include validation tests
|
|
302
|
+
|
|
303
|
+
## Support
|
|
304
|
+
|
|
305
|
+
For issues with scripts:
|
|
306
|
+
- Check logs in `logs/` directory
|
|
307
|
+
- Review error messages carefully
|
|
308
|
+
- Verify Node.js/npm versions
|
|
309
|
+
- Check GitHub Issues: https://github.com/ruvnet/agentic-flow/issues
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
**Last Updated:** 2025-11-29
|
|
314
|
+
**AgentDB Version:** 1.6.1 → 2.0.0
|
|
@@ -0,0 +1,290 @@
|
|
|
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
|
+
/**
|
|
15
|
+
* Graph node representation
|
|
16
|
+
*/
|
|
17
|
+
export interface GraphNode {
|
|
18
|
+
/** Unique node identifier */
|
|
19
|
+
id: string;
|
|
20
|
+
|
|
21
|
+
/** Node labels (types) */
|
|
22
|
+
labels: string[];
|
|
23
|
+
|
|
24
|
+
/** Node properties */
|
|
25
|
+
properties: Record<string, any>;
|
|
26
|
+
|
|
27
|
+
/** Optional vector embedding for hybrid search */
|
|
28
|
+
embedding?: Float32Array;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Graph relationship representation
|
|
33
|
+
*/
|
|
34
|
+
export interface GraphRelationship {
|
|
35
|
+
/** Unique relationship identifier */
|
|
36
|
+
id: string;
|
|
37
|
+
|
|
38
|
+
/** Source node ID */
|
|
39
|
+
from: string;
|
|
40
|
+
|
|
41
|
+
/** Target node ID */
|
|
42
|
+
to: string;
|
|
43
|
+
|
|
44
|
+
/** Relationship type */
|
|
45
|
+
type: string;
|
|
46
|
+
|
|
47
|
+
/** Relationship properties */
|
|
48
|
+
properties?: Record<string, any>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Cypher query result
|
|
53
|
+
*/
|
|
54
|
+
export interface QueryResult {
|
|
55
|
+
/** Result rows */
|
|
56
|
+
rows: Record<string, any>[];
|
|
57
|
+
|
|
58
|
+
/** Result columns */
|
|
59
|
+
columns: string[];
|
|
60
|
+
|
|
61
|
+
/** Number of rows returned */
|
|
62
|
+
count: number;
|
|
63
|
+
|
|
64
|
+
/** Query execution time in milliseconds */
|
|
65
|
+
executionTime: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Graph traversal options
|
|
70
|
+
*/
|
|
71
|
+
export interface TraversalOptions {
|
|
72
|
+
/** Maximum traversal depth */
|
|
73
|
+
maxDepth?: number;
|
|
74
|
+
|
|
75
|
+
/** Relationship types to follow (empty = all) */
|
|
76
|
+
relationshipTypes?: string[];
|
|
77
|
+
|
|
78
|
+
/** Node label filter */
|
|
79
|
+
nodeLabels?: string[];
|
|
80
|
+
|
|
81
|
+
/** Direction: 'outgoing', 'incoming', 'both' */
|
|
82
|
+
direction?: 'outgoing' | 'incoming' | 'both';
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Graph statistics
|
|
87
|
+
*/
|
|
88
|
+
export interface GraphStats {
|
|
89
|
+
/** Total number of nodes */
|
|
90
|
+
nodeCount: number;
|
|
91
|
+
|
|
92
|
+
/** Total number of relationships */
|
|
93
|
+
relationshipCount: number;
|
|
94
|
+
|
|
95
|
+
/** Node label distribution */
|
|
96
|
+
nodeLabelCounts: Record<string, number>;
|
|
97
|
+
|
|
98
|
+
/** Relationship type distribution */
|
|
99
|
+
relationshipTypeCounts: Record<string, number>;
|
|
100
|
+
|
|
101
|
+
/** Estimated memory usage in bytes */
|
|
102
|
+
memoryUsage: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* GraphBackend - Optional graph database interface
|
|
107
|
+
*
|
|
108
|
+
* Implementations:
|
|
109
|
+
* - RuVectorGraph: Native Rust graph with @ruvector/graph-node
|
|
110
|
+
* - MockGraphBackend: No-op implementation for testing
|
|
111
|
+
*/
|
|
112
|
+
export interface GraphBackend {
|
|
113
|
+
// ============================================================================
|
|
114
|
+
// Cypher Execution
|
|
115
|
+
// ============================================================================
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Execute a Cypher query
|
|
119
|
+
*
|
|
120
|
+
* @param cypher - Cypher query string
|
|
121
|
+
* @param params - Query parameters
|
|
122
|
+
* @returns Query result with rows and metadata
|
|
123
|
+
*/
|
|
124
|
+
execute(cypher: string, params?: Record<string, any>): Promise<QueryResult>;
|
|
125
|
+
|
|
126
|
+
// ============================================================================
|
|
127
|
+
// Node Operations
|
|
128
|
+
// ============================================================================
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Create a new node
|
|
132
|
+
*
|
|
133
|
+
* @param labels - Node labels (types)
|
|
134
|
+
* @param properties - Node properties
|
|
135
|
+
* @returns Created node ID
|
|
136
|
+
*/
|
|
137
|
+
createNode(labels: string[], properties: Record<string, any>): Promise<string>;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Get a node by ID
|
|
141
|
+
*
|
|
142
|
+
* @param id - Node identifier
|
|
143
|
+
* @returns Node or null if not found
|
|
144
|
+
*/
|
|
145
|
+
getNode(id: string): Promise<GraphNode | null>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Update node properties
|
|
149
|
+
*
|
|
150
|
+
* @param id - Node identifier
|
|
151
|
+
* @param properties - Properties to update
|
|
152
|
+
* @returns True if updated, false if not found
|
|
153
|
+
*/
|
|
154
|
+
updateNode(id: string, properties: Record<string, any>): Promise<boolean>;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Delete a node and its relationships
|
|
158
|
+
*
|
|
159
|
+
* @param id - Node identifier
|
|
160
|
+
* @returns True if deleted, false if not found
|
|
161
|
+
*/
|
|
162
|
+
deleteNode(id: string): Promise<boolean>;
|
|
163
|
+
|
|
164
|
+
// ============================================================================
|
|
165
|
+
// Relationship Operations
|
|
166
|
+
// ============================================================================
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Create a relationship between nodes
|
|
170
|
+
*
|
|
171
|
+
* @param from - Source node ID
|
|
172
|
+
* @param to - Target node ID
|
|
173
|
+
* @param type - Relationship type
|
|
174
|
+
* @param properties - Optional relationship properties
|
|
175
|
+
* @returns Created relationship ID
|
|
176
|
+
*/
|
|
177
|
+
createRelationship(
|
|
178
|
+
from: string,
|
|
179
|
+
to: string,
|
|
180
|
+
type: string,
|
|
181
|
+
properties?: Record<string, any>
|
|
182
|
+
): Promise<string>;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Get a relationship by ID
|
|
186
|
+
*
|
|
187
|
+
* @param id - Relationship identifier
|
|
188
|
+
* @returns Relationship or null if not found
|
|
189
|
+
*/
|
|
190
|
+
getRelationship(id: string): Promise<GraphRelationship | null>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Delete a relationship
|
|
194
|
+
*
|
|
195
|
+
* @param id - Relationship identifier
|
|
196
|
+
* @returns True if deleted, false if not found
|
|
197
|
+
*/
|
|
198
|
+
deleteRelationship(id: string): Promise<boolean>;
|
|
199
|
+
|
|
200
|
+
// ============================================================================
|
|
201
|
+
// Traversal
|
|
202
|
+
// ============================================================================
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Traverse the graph from a starting node
|
|
206
|
+
*
|
|
207
|
+
* @param startId - Starting node ID
|
|
208
|
+
* @param pattern - Traversal pattern (e.g., "()-[:RELATES_TO]->(:Entity)")
|
|
209
|
+
* @param options - Traversal options
|
|
210
|
+
* @returns Array of nodes found during traversal
|
|
211
|
+
*/
|
|
212
|
+
traverse(
|
|
213
|
+
startId: string,
|
|
214
|
+
pattern: string,
|
|
215
|
+
options?: TraversalOptions
|
|
216
|
+
): Promise<GraphNode[]>;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Find shortest path between two nodes
|
|
220
|
+
*
|
|
221
|
+
* @param fromId - Source node ID
|
|
222
|
+
* @param toId - Target node ID
|
|
223
|
+
* @param options - Traversal options
|
|
224
|
+
* @returns Array of nodes representing the path, or empty if no path exists
|
|
225
|
+
*/
|
|
226
|
+
shortestPath(
|
|
227
|
+
fromId: string,
|
|
228
|
+
toId: string,
|
|
229
|
+
options?: TraversalOptions
|
|
230
|
+
): Promise<GraphNode[]>;
|
|
231
|
+
|
|
232
|
+
// ============================================================================
|
|
233
|
+
// Hybrid Operations (Graph + Vector)
|
|
234
|
+
// ============================================================================
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Find nodes similar to a query vector within a graph context
|
|
238
|
+
*
|
|
239
|
+
* Combines vector similarity search with graph structure
|
|
240
|
+
*
|
|
241
|
+
* @param query - Query vector
|
|
242
|
+
* @param k - Number of results
|
|
243
|
+
* @param contextNodeId - Optional context node for graph-based filtering
|
|
244
|
+
* @returns Array of nodes sorted by similarity
|
|
245
|
+
*/
|
|
246
|
+
vectorSearch(
|
|
247
|
+
query: Float32Array,
|
|
248
|
+
k: number,
|
|
249
|
+
contextNodeId?: string
|
|
250
|
+
): Promise<GraphNode[]>;
|
|
251
|
+
|
|
252
|
+
// ============================================================================
|
|
253
|
+
// Stats
|
|
254
|
+
// ============================================================================
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Get graph statistics
|
|
258
|
+
*
|
|
259
|
+
* @returns Current statistics of the graph
|
|
260
|
+
*/
|
|
261
|
+
getStats(): GraphStats;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Clear the entire graph
|
|
265
|
+
*/
|
|
266
|
+
clear(): Promise<void>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Type guard to check if an object implements GraphBackend
|
|
271
|
+
*/
|
|
272
|
+
export function isGraphBackend(obj: any): obj is GraphBackend {
|
|
273
|
+
return (
|
|
274
|
+
typeof obj === 'object' &&
|
|
275
|
+
obj !== null &&
|
|
276
|
+
typeof obj.execute === 'function' &&
|
|
277
|
+
typeof obj.createNode === 'function' &&
|
|
278
|
+
typeof obj.getNode === 'function' &&
|
|
279
|
+
typeof obj.updateNode === 'function' &&
|
|
280
|
+
typeof obj.deleteNode === 'function' &&
|
|
281
|
+
typeof obj.createRelationship === 'function' &&
|
|
282
|
+
typeof obj.getRelationship === 'function' &&
|
|
283
|
+
typeof obj.deleteRelationship === 'function' &&
|
|
284
|
+
typeof obj.traverse === 'function' &&
|
|
285
|
+
typeof obj.shortestPath === 'function' &&
|
|
286
|
+
typeof obj.vectorSearch === 'function' &&
|
|
287
|
+
typeof obj.getStats === 'function' &&
|
|
288
|
+
typeof obj.clear === 'function'
|
|
289
|
+
);
|
|
290
|
+
}
|