agentdb 1.0.11 → 1.1.0
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 +196 -838
- package/dist/benchmarks/comprehensive-benchmark.js +664 -0
- package/dist/benchmarks/frontier-benchmark.js +419 -0
- package/dist/benchmarks/reflexion-benchmark.js +370 -0
- package/dist/cli/agentdb-cli.d.ts +117 -0
- package/dist/cli/agentdb-cli.d.ts.map +1 -0
- package/dist/cli/agentdb-cli.js +718 -0
- package/dist/cli/agentdb-cli.js.map +1 -0
- package/dist/controllers/CausalMemoryGraph.d.ts +125 -0
- package/dist/controllers/CausalMemoryGraph.d.ts.map +1 -0
- package/dist/controllers/CausalMemoryGraph.js +323 -0
- package/dist/controllers/CausalMemoryGraph.js.map +1 -0
- package/dist/controllers/CausalRecall.d.ts +111 -0
- package/dist/controllers/CausalRecall.d.ts.map +1 -0
- package/dist/controllers/CausalRecall.js +282 -0
- package/dist/controllers/CausalRecall.js.map +1 -0
- package/dist/controllers/EmbeddingService.d.ts +37 -0
- package/dist/controllers/EmbeddingService.d.ts.map +1 -0
- package/dist/controllers/EmbeddingService.js +119 -0
- package/dist/controllers/EmbeddingService.js.map +1 -0
- package/dist/controllers/ExplainableRecall.d.ts +138 -0
- package/dist/controllers/ExplainableRecall.d.ts.map +1 -0
- package/dist/controllers/ExplainableRecall.js +388 -0
- package/dist/controllers/ExplainableRecall.js.map +1 -0
- package/dist/controllers/NightlyLearner.d.ts +113 -0
- package/dist/controllers/NightlyLearner.d.ts.map +1 -0
- package/dist/controllers/NightlyLearner.js +383 -0
- package/dist/controllers/NightlyLearner.js.map +1 -0
- package/dist/controllers/ReflexionMemory.d.ts +84 -0
- package/dist/controllers/ReflexionMemory.d.ts.map +1 -0
- package/dist/controllers/ReflexionMemory.js +240 -0
- package/dist/controllers/ReflexionMemory.js.map +1 -0
- package/dist/controllers/SkillLibrary.d.ts +96 -0
- package/dist/controllers/SkillLibrary.d.ts.map +1 -0
- package/dist/controllers/SkillLibrary.js +277 -0
- package/dist/controllers/SkillLibrary.js.map +1 -0
- package/dist/controllers/frontier-index.d.ts +14 -0
- package/dist/controllers/frontier-index.d.ts.map +1 -0
- package/dist/controllers/frontier-index.js +10 -0
- package/dist/controllers/frontier-index.js.map +1 -0
- package/dist/controllers/index.d.ts +12 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +9 -0
- package/dist/controllers/index.js.map +1 -0
- package/dist/optimizations/BatchOperations.d.ts +61 -0
- package/dist/optimizations/BatchOperations.d.ts.map +1 -0
- package/dist/optimizations/BatchOperations.js +199 -0
- package/dist/optimizations/BatchOperations.js.map +1 -0
- package/dist/optimizations/QueryOptimizer.d.ts +82 -0
- package/dist/optimizations/QueryOptimizer.d.ts.map +1 -0
- package/dist/optimizations/QueryOptimizer.js +226 -0
- package/dist/optimizations/QueryOptimizer.js.map +1 -0
- package/dist/optimizations/index.d.ts +10 -0
- package/dist/optimizations/index.d.ts.map +1 -0
- package/dist/optimizations/index.js +8 -0
- package/dist/optimizations/index.js.map +1 -0
- package/dist/schemas/frontier-schema.sql +341 -0
- package/dist/schemas/schema.sql +382 -0
- package/dist/tests/frontier-features.test.js +665 -0
- package/package.json +54 -117
- package/src/cli/agentdb-cli.ts +861 -0
- package/src/cli/examples.sh +83 -0
- package/src/controllers/CausalMemoryGraph.ts +504 -0
- package/src/controllers/CausalRecall.ts +395 -0
- package/src/controllers/EmbeddingService.ts +141 -0
- package/src/controllers/ExplainableRecall.ts +577 -0
- package/src/controllers/NightlyLearner.ts +475 -0
- package/src/controllers/ReflexionMemory.ts +349 -0
- package/src/controllers/SkillLibrary.ts +391 -0
- package/src/controllers/frontier-index.ts +35 -0
- package/src/controllers/index.ts +13 -0
- package/src/optimizations/BatchOperations.ts +292 -0
- package/src/optimizations/QueryOptimizer.ts +294 -0
- package/src/optimizations/index.ts +11 -0
- package/src/schemas/frontier-schema.sql +341 -0
- package/src/schemas/schema.sql +382 -0
- package/CHANGELOG.md +0 -166
- package/LICENSE +0 -38
- package/LICENSE-APACHE +0 -190
- package/LICENSE-MIT +0 -21
- package/bin/agentdb.js +0 -733
- package/bin/benchmark.js +0 -162
- package/bin/plugin-cli-wrapper.mjs +0 -21
- package/dist/agentdb.js +0 -5352
- package/dist/agentdb.js.map +0 -7
- package/dist/agentdb.min.js +0 -143
- package/dist/agentdb.min.js.map +0 -7
- package/dist/cache/query-cache.d.ts +0 -105
- package/dist/cache/query-cache.d.ts.map +0 -1
- package/dist/cache/query-cache.js +0 -224
- package/dist/cache/query-cache.js.map +0 -1
- package/dist/cache/query-cache.mjs +0 -219
- package/dist/cli/cache/query-cache.d.ts +0 -104
- package/dist/cli/cache/query-cache.js +0 -244
- package/dist/cli/cli/db-commands.d.ts +0 -48
- package/dist/cli/cli/db-commands.js +0 -613
- package/dist/cli/commands.d.ts +0 -7
- package/dist/cli/commands.d.ts.map +0 -1
- package/dist/cli/commands.js +0 -113
- package/dist/cli/commands.js.map +0 -1
- package/dist/cli/commands.mjs +0 -104
- package/dist/cli/core/backend-interface.d.ts +0 -70
- package/dist/cli/core/backend-interface.js +0 -15
- package/dist/cli/core/native-backend.d.ts +0 -140
- package/dist/cli/core/native-backend.js +0 -432
- package/dist/cli/core/vector-db.d.ts +0 -126
- package/dist/cli/core/vector-db.js +0 -338
- package/dist/cli/core/wasm-backend.d.ts +0 -95
- package/dist/cli/core/wasm-backend.js +0 -418
- package/dist/cli/db-commands.d.ts +0 -49
- package/dist/cli/db-commands.d.ts.map +0 -1
- package/dist/cli/db-commands.js +0 -533
- package/dist/cli/db-commands.js.map +0 -1
- package/dist/cli/db-commands.mjs +0 -522
- package/dist/cli/generator.d.ts +0 -11
- package/dist/cli/generator.d.ts.map +0 -1
- package/dist/cli/generator.js +0 -567
- package/dist/cli/generator.js.map +0 -1
- package/dist/cli/generator.mjs +0 -527
- package/dist/cli/help.d.ts +0 -18
- package/dist/cli/help.d.ts.map +0 -1
- package/dist/cli/help.js +0 -676
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/help.mjs +0 -667
- package/dist/cli/index/hnsw.d.ts +0 -164
- package/dist/cli/index/hnsw.js +0 -558
- package/dist/cli/plugin-cli.d.ts +0 -7
- package/dist/cli/plugin-cli.d.ts.map +0 -1
- package/dist/cli/plugin-cli.js +0 -295
- package/dist/cli/plugin-cli.js.map +0 -1
- package/dist/cli/plugin-cli.mjs +0 -289
- package/dist/cli/quantization/product-quantization.d.ts +0 -108
- package/dist/cli/quantization/product-quantization.js +0 -350
- package/dist/cli/query/query-builder.d.ts +0 -322
- package/dist/cli/query/query-builder.js +0 -600
- package/dist/cli/templates.d.ts +0 -14
- package/dist/cli/templates.d.ts.map +0 -1
- package/dist/cli/templates.js +0 -182
- package/dist/cli/templates.js.map +0 -1
- package/dist/cli/templates.mjs +0 -176
- package/dist/cli/types/index.d.ts +0 -116
- package/dist/cli/types/index.js +0 -5
- package/dist/cli/types.d.ts +0 -91
- package/dist/cli/types.d.ts.map +0 -1
- package/dist/cli/types.js +0 -6
- package/dist/cli/types.js.map +0 -1
- package/dist/cli/types.mjs +0 -4
- package/dist/cli/wizard/index.d.ts +0 -6
- package/dist/cli/wizard/index.d.ts.map +0 -1
- package/dist/cli/wizard/index.js +0 -138
- package/dist/cli/wizard/index.js.map +0 -1
- package/dist/cli/wizard/index.mjs +0 -131
- package/dist/cli/wizard/prompts.d.ts +0 -11
- package/dist/cli/wizard/prompts.d.ts.map +0 -1
- package/dist/cli/wizard/prompts.js +0 -482
- package/dist/cli/wizard/prompts.js.map +0 -1
- package/dist/cli/wizard/prompts.mjs +0 -470
- package/dist/cli/wizard/validator.d.ts +0 -13
- package/dist/cli/wizard/validator.d.ts.map +0 -1
- package/dist/cli/wizard/validator.js +0 -234
- package/dist/cli/wizard/validator.js.map +0 -1
- package/dist/cli/wizard/validator.mjs +0 -224
- package/dist/core/backend-interface.d.ts +0 -71
- package/dist/core/backend-interface.d.ts.map +0 -1
- package/dist/core/backend-interface.js +0 -16
- package/dist/core/backend-interface.js.map +0 -1
- package/dist/core/backend-interface.mjs +0 -12
- package/dist/core/native-backend.d.ts +0 -141
- package/dist/core/native-backend.d.ts.map +0 -1
- package/dist/core/native-backend.js +0 -457
- package/dist/core/native-backend.js.map +0 -1
- package/dist/core/native-backend.mjs +0 -449
- package/dist/core/vector-db.d.ts +0 -127
- package/dist/core/vector-db.d.ts.map +0 -1
- package/dist/core/vector-db.js +0 -270
- package/dist/core/vector-db.js.map +0 -1
- package/dist/core/vector-db.mjs +0 -265
- package/dist/core/wasm-backend.d.ts +0 -96
- package/dist/core/wasm-backend.d.ts.map +0 -1
- package/dist/core/wasm-backend.js +0 -393
- package/dist/core/wasm-backend.js.map +0 -1
- package/dist/core/wasm-backend.mjs +0 -385
- package/dist/index/hnsw-optimized.d.ts +0 -75
- package/dist/index/hnsw-optimized.d.ts.map +0 -1
- package/dist/index/hnsw-optimized.js +0 -412
- package/dist/index/hnsw-optimized.js.map +0 -1
- package/dist/index/hnsw-optimized.mjs +0 -407
- package/dist/index/hnsw.d.ts +0 -165
- package/dist/index/hnsw.d.ts.map +0 -1
- package/dist/index/hnsw.js +0 -521
- package/dist/index/hnsw.js.map +0 -1
- package/dist/index/hnsw.mjs +0 -516
- package/dist/index.browser.d.ts +0 -47
- package/dist/index.browser.d.ts.map +0 -1
- package/dist/index.browser.js +0 -72
- package/dist/index.browser.js.map +0 -1
- package/dist/index.browser.mjs +0 -54
- package/dist/index.d.ts +0 -59
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -84
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -65
- package/dist/mcp/learning/core/experience-buffer.d.ts +0 -61
- package/dist/mcp/learning/core/experience-buffer.d.ts.map +0 -1
- package/dist/mcp/learning/core/experience-buffer.js +0 -175
- package/dist/mcp/learning/core/experience-buffer.js.map +0 -1
- package/dist/mcp/learning/core/experience-buffer.mjs +0 -170
- package/dist/mcp/learning/core/experience-recorder.d.ts +0 -40
- package/dist/mcp/learning/core/experience-recorder.d.ts.map +0 -1
- package/dist/mcp/learning/core/experience-recorder.js +0 -200
- package/dist/mcp/learning/core/experience-recorder.js.map +0 -1
- package/dist/mcp/learning/core/experience-recorder.mjs +0 -195
- package/dist/mcp/learning/core/learning-manager.d.ts +0 -66
- package/dist/mcp/learning/core/learning-manager.d.ts.map +0 -1
- package/dist/mcp/learning/core/learning-manager.js +0 -252
- package/dist/mcp/learning/core/learning-manager.js.map +0 -1
- package/dist/mcp/learning/core/learning-manager.mjs +0 -247
- package/dist/mcp/learning/core/policy-optimizer.d.ts +0 -53
- package/dist/mcp/learning/core/policy-optimizer.d.ts.map +0 -1
- package/dist/mcp/learning/core/policy-optimizer.js +0 -251
- package/dist/mcp/learning/core/policy-optimizer.js.map +0 -1
- package/dist/mcp/learning/core/policy-optimizer.mjs +0 -246
- package/dist/mcp/learning/core/reward-estimator.d.ts +0 -44
- package/dist/mcp/learning/core/reward-estimator.d.ts.map +0 -1
- package/dist/mcp/learning/core/reward-estimator.js +0 -158
- package/dist/mcp/learning/core/reward-estimator.js.map +0 -1
- package/dist/mcp/learning/core/reward-estimator.mjs +0 -153
- package/dist/mcp/learning/core/session-manager.d.ts +0 -63
- package/dist/mcp/learning/core/session-manager.d.ts.map +0 -1
- package/dist/mcp/learning/core/session-manager.js +0 -202
- package/dist/mcp/learning/core/session-manager.js.map +0 -1
- package/dist/mcp/learning/core/session-manager.mjs +0 -197
- package/dist/mcp/learning/index.d.ts +0 -19
- package/dist/mcp/learning/index.d.ts.map +0 -1
- package/dist/mcp/learning/index.js +0 -30
- package/dist/mcp/learning/index.js.map +0 -1
- package/dist/mcp/learning/index.mjs +0 -19
- package/dist/mcp/learning/tools/mcp-learning-tools.d.ts +0 -369
- package/dist/mcp/learning/tools/mcp-learning-tools.d.ts.map +0 -1
- package/dist/mcp/learning/tools/mcp-learning-tools.js +0 -361
- package/dist/mcp/learning/tools/mcp-learning-tools.js.map +0 -1
- package/dist/mcp/learning/tools/mcp-learning-tools.mjs +0 -356
- package/dist/mcp/learning/types/index.d.ts +0 -138
- package/dist/mcp/learning/types/index.d.ts.map +0 -1
- package/dist/mcp/learning/types/index.js +0 -6
- package/dist/mcp/learning/types/index.js.map +0 -1
- package/dist/mcp/learning/types/index.mjs +0 -4
- package/dist/mcp-server.d.ts +0 -29
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js +0 -862
- package/dist/mcp-server.js.map +0 -1
- package/dist/mcp-server.mjs +0 -857
- package/dist/plugins/base-plugin.d.ts +0 -114
- package/dist/plugins/base-plugin.d.ts.map +0 -1
- package/dist/plugins/base-plugin.js +0 -313
- package/dist/plugins/base-plugin.js.map +0 -1
- package/dist/plugins/base-plugin.mjs +0 -275
- package/dist/plugins/implementations/active-learning.d.ts +0 -135
- package/dist/plugins/implementations/active-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/active-learning.js +0 -372
- package/dist/plugins/implementations/active-learning.js.map +0 -1
- package/dist/plugins/implementations/active-learning.mjs +0 -367
- package/dist/plugins/implementations/actor-critic.d.ts +0 -64
- package/dist/plugins/implementations/actor-critic.d.ts.map +0 -1
- package/dist/plugins/implementations/actor-critic.js +0 -363
- package/dist/plugins/implementations/actor-critic.js.map +0 -1
- package/dist/plugins/implementations/actor-critic.mjs +0 -358
- package/dist/plugins/implementations/adversarial-training.d.ts +0 -133
- package/dist/plugins/implementations/adversarial-training.d.ts.map +0 -1
- package/dist/plugins/implementations/adversarial-training.js +0 -409
- package/dist/plugins/implementations/adversarial-training.js.map +0 -1
- package/dist/plugins/implementations/adversarial-training.mjs +0 -404
- package/dist/plugins/implementations/curriculum-learning.d.ts +0 -132
- package/dist/plugins/implementations/curriculum-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/curriculum-learning.js +0 -354
- package/dist/plugins/implementations/curriculum-learning.js.map +0 -1
- package/dist/plugins/implementations/curriculum-learning.mjs +0 -349
- package/dist/plugins/implementations/decision-transformer.d.ts +0 -77
- package/dist/plugins/implementations/decision-transformer.d.ts.map +0 -1
- package/dist/plugins/implementations/decision-transformer.js +0 -422
- package/dist/plugins/implementations/decision-transformer.js.map +0 -1
- package/dist/plugins/implementations/decision-transformer.mjs +0 -417
- package/dist/plugins/implementations/federated-learning.d.ts +0 -126
- package/dist/plugins/implementations/federated-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/federated-learning.js +0 -436
- package/dist/plugins/implementations/federated-learning.js.map +0 -1
- package/dist/plugins/implementations/federated-learning.mjs +0 -431
- package/dist/plugins/implementations/index.d.ts +0 -30
- package/dist/plugins/implementations/index.d.ts.map +0 -1
- package/dist/plugins/implementations/index.js +0 -45
- package/dist/plugins/implementations/index.js.map +0 -1
- package/dist/plugins/implementations/index.mjs +0 -31
- package/dist/plugins/implementations/multi-task-learning.d.ts +0 -115
- package/dist/plugins/implementations/multi-task-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/multi-task-learning.js +0 -369
- package/dist/plugins/implementations/multi-task-learning.js.map +0 -1
- package/dist/plugins/implementations/multi-task-learning.mjs +0 -364
- package/dist/plugins/implementations/neural-architecture-search.d.ts +0 -148
- package/dist/plugins/implementations/neural-architecture-search.d.ts.map +0 -1
- package/dist/plugins/implementations/neural-architecture-search.js +0 -379
- package/dist/plugins/implementations/neural-architecture-search.js.map +0 -1
- package/dist/plugins/implementations/neural-architecture-search.mjs +0 -374
- package/dist/plugins/implementations/q-learning.d.ts +0 -98
- package/dist/plugins/implementations/q-learning.d.ts.map +0 -1
- package/dist/plugins/implementations/q-learning.js +0 -435
- package/dist/plugins/implementations/q-learning.js.map +0 -1
- package/dist/plugins/implementations/q-learning.mjs +0 -430
- package/dist/plugins/implementations/sarsa.d.ts +0 -103
- package/dist/plugins/implementations/sarsa.d.ts.map +0 -1
- package/dist/plugins/implementations/sarsa.js +0 -347
- package/dist/plugins/implementations/sarsa.js.map +0 -1
- package/dist/plugins/implementations/sarsa.mjs +0 -342
- package/dist/plugins/index.d.ts +0 -107
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/index.js +0 -179
- package/dist/plugins/index.js.map +0 -1
- package/dist/plugins/index.mjs +0 -168
- package/dist/plugins/interface.d.ts +0 -439
- package/dist/plugins/interface.d.ts.map +0 -1
- package/dist/plugins/interface.js +0 -12
- package/dist/plugins/interface.js.map +0 -1
- package/dist/plugins/interface.mjs +0 -10
- package/dist/plugins/learning-plugin.interface.d.ts +0 -257
- package/dist/plugins/learning-plugin.interface.d.ts.map +0 -1
- package/dist/plugins/learning-plugin.interface.js +0 -7
- package/dist/plugins/learning-plugin.interface.js.map +0 -1
- package/dist/plugins/learning-plugin.interface.mjs +0 -5
- package/dist/plugins/plugin-exports.d.ts +0 -71
- package/dist/plugins/plugin-exports.d.ts.map +0 -1
- package/dist/plugins/plugin-exports.js +0 -78
- package/dist/plugins/plugin-exports.js.map +0 -1
- package/dist/plugins/plugin-exports.mjs +0 -69
- package/dist/plugins/registry.d.ts +0 -206
- package/dist/plugins/registry.d.ts.map +0 -1
- package/dist/plugins/registry.js +0 -365
- package/dist/plugins/registry.js.map +0 -1
- package/dist/plugins/registry.mjs +0 -356
- package/dist/plugins/validator.d.ts +0 -63
- package/dist/plugins/validator.d.ts.map +0 -1
- package/dist/plugins/validator.js +0 -464
- package/dist/plugins/validator.js.map +0 -1
- package/dist/plugins/validator.mjs +0 -458
- package/dist/presets.d.ts +0 -65
- package/dist/presets.d.ts.map +0 -1
- package/dist/presets.js +0 -145
- package/dist/presets.js.map +0 -1
- package/dist/presets.mjs +0 -140
- package/dist/quantization/binary-quantization.d.ts +0 -104
- package/dist/quantization/binary-quantization.d.ts.map +0 -1
- package/dist/quantization/binary-quantization.js +0 -246
- package/dist/quantization/binary-quantization.js.map +0 -1
- package/dist/quantization/binary-quantization.mjs +0 -240
- package/dist/quantization/optimized-pq.d.ts +0 -138
- package/dist/quantization/optimized-pq.d.ts.map +0 -1
- package/dist/quantization/optimized-pq.js +0 -320
- package/dist/quantization/optimized-pq.js.map +0 -1
- package/dist/quantization/optimized-pq.mjs +0 -313
- package/dist/quantization/product-quantization.d.ts +0 -109
- package/dist/quantization/product-quantization.d.ts.map +0 -1
- package/dist/quantization/product-quantization.js +0 -287
- package/dist/quantization/product-quantization.js.map +0 -1
- package/dist/quantization/product-quantization.mjs +0 -282
- package/dist/quantization/scalar-quantization.d.ts +0 -100
- package/dist/quantization/scalar-quantization.d.ts.map +0 -1
- package/dist/quantization/scalar-quantization.js +0 -324
- package/dist/quantization/scalar-quantization.js.map +0 -1
- package/dist/quantization/scalar-quantization.mjs +0 -319
- package/dist/query/index.d.ts +0 -6
- package/dist/query/index.d.ts.map +0 -1
- package/dist/query/index.js +0 -9
- package/dist/query/index.js.map +0 -1
- package/dist/query/index.mjs +0 -4
- package/dist/query/query-builder.d.ts +0 -323
- package/dist/query/query-builder.d.ts.map +0 -1
- package/dist/query/query-builder.js +0 -524
- package/dist/query/query-builder.js.map +0 -1
- package/dist/query/query-builder.mjs +0 -519
- package/dist/reasoning/context-synthesizer.d.ts +0 -57
- package/dist/reasoning/context-synthesizer.d.ts.map +0 -1
- package/dist/reasoning/context-synthesizer.js +0 -224
- package/dist/reasoning/context-synthesizer.js.map +0 -1
- package/dist/reasoning/context-synthesizer.mjs +0 -219
- package/dist/reasoning/experience-curator.d.ts +0 -66
- package/dist/reasoning/experience-curator.d.ts.map +0 -1
- package/dist/reasoning/experience-curator.js +0 -288
- package/dist/reasoning/experience-curator.js.map +0 -1
- package/dist/reasoning/experience-curator.mjs +0 -283
- package/dist/reasoning/memory-optimizer.d.ts +0 -69
- package/dist/reasoning/memory-optimizer.d.ts.map +0 -1
- package/dist/reasoning/memory-optimizer.js +0 -331
- package/dist/reasoning/memory-optimizer.js.map +0 -1
- package/dist/reasoning/memory-optimizer.mjs +0 -326
- package/dist/reasoning/pattern-matcher.d.ts +0 -59
- package/dist/reasoning/pattern-matcher.d.ts.map +0 -1
- package/dist/reasoning/pattern-matcher.js +0 -229
- package/dist/reasoning/pattern-matcher.js.map +0 -1
- package/dist/reasoning/pattern-matcher.mjs +0 -224
- package/dist/reasoningbank/adapter/agentdb-adapter.d.ts +0 -118
- package/dist/reasoningbank/adapter/agentdb-adapter.d.ts.map +0 -1
- package/dist/reasoningbank/adapter/agentdb-adapter.js +0 -477
- package/dist/reasoningbank/adapter/agentdb-adapter.js.map +0 -1
- package/dist/reasoningbank/adapter/types.d.ts +0 -113
- package/dist/reasoningbank/adapter/types.d.ts.map +0 -1
- package/dist/reasoningbank/adapter/types.js +0 -9
- package/dist/reasoningbank/adapter/types.js.map +0 -1
- package/dist/reasoningbank/cli/commands.d.ts +0 -16
- package/dist/reasoningbank/cli/commands.d.ts.map +0 -1
- package/dist/reasoningbank/cli/commands.js +0 -272
- package/dist/reasoningbank/cli/commands.js.map +0 -1
- package/dist/reasoningbank/mcp/agentdb-tools.d.ts +0 -319
- package/dist/reasoningbank/mcp/agentdb-tools.d.ts.map +0 -1
- package/dist/reasoningbank/mcp/agentdb-tools.js +0 -301
- package/dist/reasoningbank/mcp/agentdb-tools.js.map +0 -1
- package/dist/reasoningbank/migration/migrate.d.ts +0 -25
- package/dist/reasoningbank/migration/migrate.d.ts.map +0 -1
- package/dist/reasoningbank/migration/migrate.js +0 -178
- package/dist/reasoningbank/migration/migrate.js.map +0 -1
- package/dist/reasoningbank/reasoning/context-synthesizer.d.ts +0 -37
- package/dist/reasoningbank/reasoning/context-synthesizer.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/context-synthesizer.js +0 -114
- package/dist/reasoningbank/reasoning/context-synthesizer.js.map +0 -1
- package/dist/reasoningbank/reasoning/experience-curator.d.ts +0 -39
- package/dist/reasoningbank/reasoning/experience-curator.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/experience-curator.js +0 -98
- package/dist/reasoningbank/reasoning/experience-curator.js.map +0 -1
- package/dist/reasoningbank/reasoning/memory-optimizer.d.ts +0 -44
- package/dist/reasoningbank/reasoning/memory-optimizer.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/memory-optimizer.js +0 -184
- package/dist/reasoningbank/reasoning/memory-optimizer.js.map +0 -1
- package/dist/reasoningbank/reasoning/pattern-matcher.d.ts +0 -40
- package/dist/reasoningbank/reasoning/pattern-matcher.d.ts.map +0 -1
- package/dist/reasoningbank/reasoning/pattern-matcher.js +0 -87
- package/dist/reasoningbank/reasoning/pattern-matcher.js.map +0 -1
- package/dist/reasoningbank/sync/quic-sync.d.ts +0 -77
- package/dist/reasoningbank/sync/quic-sync.d.ts.map +0 -1
- package/dist/reasoningbank/sync/quic-sync.js +0 -165
- package/dist/reasoningbank/sync/quic-sync.js.map +0 -1
- package/dist/sync/conflict.d.ts +0 -78
- package/dist/sync/conflict.d.ts.map +0 -1
- package/dist/sync/conflict.js +0 -202
- package/dist/sync/conflict.js.map +0 -1
- package/dist/sync/conflict.mjs +0 -196
- package/dist/sync/coordinator.d.ts +0 -111
- package/dist/sync/coordinator.d.ts.map +0 -1
- package/dist/sync/coordinator.js +0 -256
- package/dist/sync/coordinator.js.map +0 -1
- package/dist/sync/coordinator.mjs +0 -250
- package/dist/sync/delta.d.ts +0 -81
- package/dist/sync/delta.d.ts.map +0 -1
- package/dist/sync/delta.js +0 -245
- package/dist/sync/delta.js.map +0 -1
- package/dist/sync/delta.mjs +0 -238
- package/dist/sync/index.d.ts +0 -11
- package/dist/sync/index.d.ts.map +0 -1
- package/dist/sync/index.js +0 -22
- package/dist/sync/index.js.map +0 -1
- package/dist/sync/index.mjs +0 -9
- package/dist/sync/quic-sync.d.ts +0 -81
- package/dist/sync/quic-sync.d.ts.map +0 -1
- package/dist/sync/quic-sync.js +0 -329
- package/dist/sync/quic-sync.js.map +0 -1
- package/dist/sync/quic-sync.mjs +0 -323
- package/dist/sync/types.d.ts +0 -168
- package/dist/sync/types.d.ts.map +0 -1
- package/dist/sync/types.js +0 -8
- package/dist/sync/types.js.map +0 -1
- package/dist/sync/types.mjs +0 -6
- package/dist/types/index.d.ts +0 -117
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.mjs +0 -4
- package/dist/wasm/sql-wasm-debug.js +0 -6989
- package/dist/wasm/sql-wasm-debug.wasm +0 -0
- package/dist/wasm/sql-wasm.js +0 -188
- package/dist/wasm/sql-wasm.wasm +0 -0
- package/dist/wasm-loader.d.ts +0 -32
- package/dist/wasm-loader.d.ts.map +0 -1
- package/dist/wasm-loader.js +0 -78
- package/dist/wasm-loader.js.map +0 -1
- package/dist/wasm-loader.mjs +0 -67
- package/examples/adaptive-learning.ts +0 -284
- package/examples/browser/README.md +0 -732
- package/examples/browser/adaptive-recommendations/index.html +0 -427
- package/examples/browser/collaborative-filtering/index.html +0 -310
- package/examples/browser/continual-learning/index.html +0 -736
- package/examples/browser/experience-replay/index.html +0 -616
- package/examples/browser/index.html +0 -369
- package/examples/browser/meta-learning/index.html +0 -789
- package/examples/browser/neuro-symbolic/index.html +0 -692
- package/examples/browser/pattern-learning/index.html +0 -620
- package/examples/browser/quantum-inspired/index.html +0 -728
- package/examples/browser/rag/index.html +0 -624
- package/examples/browser/swarm-intelligence/index.html +0 -811
- package/examples/browser-basic.html +0 -170
- package/examples/browser-wasm-real.html +0 -231
- package/examples/hnsw-example.ts +0 -148
- package/examples/mcp-learning-example.ts +0 -220
- package/examples/node-basic.js +0 -70
- package/examples/quic-sync-example.ts +0 -310
- package/examples/quick-start.js +0 -68
- package/examples/test-v1.0.7-cdn.html +0 -190
- package/examples/wasm-example.ts +0 -222
package/bin/agentdb.js
DELETED
|
@@ -1,733 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* AgentDB CLI
|
|
5
|
-
*
|
|
6
|
-
* Command-line interface for agentdb operations
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const { version } = require('../package.json');
|
|
10
|
-
|
|
11
|
-
const COMMANDS = {
|
|
12
|
-
help: showHelp,
|
|
13
|
-
version: showVersion,
|
|
14
|
-
mcp: startMcpServer,
|
|
15
|
-
init: initDatabase,
|
|
16
|
-
benchmark: runBenchmark,
|
|
17
|
-
repl: startRepl,
|
|
18
|
-
'create-plugin': createPlugin,
|
|
19
|
-
'list-plugins': listPlugins,
|
|
20
|
-
'list-templates': listTemplates,
|
|
21
|
-
'plugin-info': pluginInfo,
|
|
22
|
-
'use-plugin': usePlugin,
|
|
23
|
-
import: importCommand,
|
|
24
|
-
export: exportCommand,
|
|
25
|
-
query: queryCommand,
|
|
26
|
-
stats: statsCommand,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
function showHelp(subcommand) {
|
|
30
|
-
// Show command-specific help if requested
|
|
31
|
-
if (subcommand && COMMANDS[subcommand]) {
|
|
32
|
-
showCommandHelp(subcommand);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
console.log(`
|
|
37
|
-
█▀█ █▀▀ █▀▀ █▄░█ ▀█▀ █▀▄ █▄▄
|
|
38
|
-
█▀█ █▄█ ██▄ █░▀█ ░█░ █▄▀ █▄█
|
|
39
|
-
|
|
40
|
-
AgentDB v${version} - Agent Memory & Vector Database
|
|
41
|
-
Website: https://agentdb.ruv.io
|
|
42
|
-
|
|
43
|
-
USAGE
|
|
44
|
-
npx agentdb <command> [options]
|
|
45
|
-
npx agentdb <command> --help (detailed command help)
|
|
46
|
-
|
|
47
|
-
CORE COMMANDS
|
|
48
|
-
init <path> Initialize vector database
|
|
49
|
-
mcp Start MCP server for Claude Code
|
|
50
|
-
benchmark Run performance benchmarks
|
|
51
|
-
version Show version information
|
|
52
|
-
|
|
53
|
-
PLUGIN COMMANDS
|
|
54
|
-
create-plugin Create learning plugin (interactive wizard)
|
|
55
|
-
list-plugins List available plugins
|
|
56
|
-
list-templates List plugin templates
|
|
57
|
-
plugin-info Show plugin details
|
|
58
|
-
|
|
59
|
-
DATABASE COMMANDS
|
|
60
|
-
import <file> Import vectors from file
|
|
61
|
-
export <file> Export vectors to file
|
|
62
|
-
query <db> Query vector database
|
|
63
|
-
stats <db> Show database statistics
|
|
64
|
-
|
|
65
|
-
QUICK START
|
|
66
|
-
npx agentdb create-plugin # Create plugin
|
|
67
|
-
npx agentdb init ./agents.db # Initialize DB
|
|
68
|
-
npx agentdb mcp # Start MCP server
|
|
69
|
-
npx agentdb benchmark # Run benchmarks
|
|
70
|
-
|
|
71
|
-
HELP & INFO
|
|
72
|
-
npx agentdb help <command> # Command-specific help
|
|
73
|
-
npx agentdb <command> --help # Alternative syntax
|
|
74
|
-
npx agentdb version # Version info
|
|
75
|
-
|
|
76
|
-
DOCUMENTATION
|
|
77
|
-
GitHub: https://github.com/ruvnet/agentic-flow/tree/main/packages/agentdb
|
|
78
|
-
Issues: https://github.com/ruvnet/agentic-flow/issues
|
|
79
|
-
License: MIT OR Apache-2.0
|
|
80
|
-
`);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function showCommandHelp(command) {
|
|
84
|
-
const helps = {
|
|
85
|
-
init: `
|
|
86
|
-
COMMAND: init
|
|
87
|
-
|
|
88
|
-
Initialize a new vector database
|
|
89
|
-
|
|
90
|
-
USAGE
|
|
91
|
-
npx agentdb init <path> [options]
|
|
92
|
-
|
|
93
|
-
ARGUMENTS
|
|
94
|
-
<path> Database file path (e.g., ./vectors.db)
|
|
95
|
-
|
|
96
|
-
OPTIONS
|
|
97
|
-
--dimension <n> Vector dimension (default: 1536)
|
|
98
|
-
--preset <name> Use preset: small, medium, large
|
|
99
|
-
--in-memory Create in-memory database
|
|
100
|
-
|
|
101
|
-
EXAMPLES
|
|
102
|
-
npx agentdb init ./vectors.db
|
|
103
|
-
npx agentdb init ./vectors.db --dimension 768
|
|
104
|
-
npx agentdb init ./vectors.db --preset large
|
|
105
|
-
`,
|
|
106
|
-
mcp: `
|
|
107
|
-
COMMAND: mcp
|
|
108
|
-
|
|
109
|
-
Start Model Context Protocol server for Claude Code integration
|
|
110
|
-
|
|
111
|
-
USAGE
|
|
112
|
-
npx agentdb mcp [options]
|
|
113
|
-
|
|
114
|
-
OPTIONS
|
|
115
|
-
--port <number> Port to listen on (default: 3000)
|
|
116
|
-
--host <string> Host to bind to (default: localhost)
|
|
117
|
-
--log <level> Log level: debug, info, warn, error
|
|
118
|
-
|
|
119
|
-
EXAMPLES
|
|
120
|
-
npx agentdb mcp
|
|
121
|
-
npx agentdb mcp --port 3000
|
|
122
|
-
npx agentdb mcp --log debug
|
|
123
|
-
|
|
124
|
-
CLAUDE DESKTOP CONFIG
|
|
125
|
-
Add to ~/.config/claude/config.json:
|
|
126
|
-
{
|
|
127
|
-
"mcpServers": {
|
|
128
|
-
"agentdb": {
|
|
129
|
-
"command": "npx",
|
|
130
|
-
"args": ["agentdb", "mcp"]
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
`,
|
|
135
|
-
'create-plugin': `
|
|
136
|
-
COMMAND: create-plugin
|
|
137
|
-
|
|
138
|
-
Create a new learning plugin with interactive wizard
|
|
139
|
-
|
|
140
|
-
USAGE
|
|
141
|
-
npx agentdb create-plugin [options]
|
|
142
|
-
|
|
143
|
-
OPTIONS
|
|
144
|
-
-t, --template <name> Use template (see list-templates)
|
|
145
|
-
-n, --name <name> Plugin name (lowercase-hyphenated)
|
|
146
|
-
--no-customize Skip customization (use defaults)
|
|
147
|
-
-o, --output <dir> Output directory (default: ./plugins)
|
|
148
|
-
--force Overwrite existing plugin
|
|
149
|
-
--dry-run Preview without creating files
|
|
150
|
-
|
|
151
|
-
AVAILABLE TEMPLATES
|
|
152
|
-
decision-transformer Sequence modeling RL (recommended)
|
|
153
|
-
q-learning Value-based learning
|
|
154
|
-
sarsa On-policy TD learning
|
|
155
|
-
actor-critic Policy gradient with baseline
|
|
156
|
-
|
|
157
|
-
EXAMPLES
|
|
158
|
-
npx agentdb create-plugin
|
|
159
|
-
npx agentdb create-plugin -t q-learning -n my-agent
|
|
160
|
-
npx agentdb create-plugin --dry-run
|
|
161
|
-
`,
|
|
162
|
-
import: `
|
|
163
|
-
COMMAND: import
|
|
164
|
-
|
|
165
|
-
Import vectors from file into database
|
|
166
|
-
|
|
167
|
-
USAGE
|
|
168
|
-
npx agentdb import <database> <file> [options]
|
|
169
|
-
|
|
170
|
-
ARGUMENTS
|
|
171
|
-
<database> Database path
|
|
172
|
-
<file> Input file (JSON, CSV)
|
|
173
|
-
|
|
174
|
-
OPTIONS
|
|
175
|
-
-f, --format <type> Format: json, csv (default: json)
|
|
176
|
-
-b, --batch-size <n> Batch size (default: 1000)
|
|
177
|
-
-v, --verbose Verbose output
|
|
178
|
-
|
|
179
|
-
EXAMPLES
|
|
180
|
-
npx agentdb import ./db.sqlite vectors.json
|
|
181
|
-
npx agentdb import ./db.sqlite data.csv -f csv -v
|
|
182
|
-
`,
|
|
183
|
-
export: `
|
|
184
|
-
COMMAND: export
|
|
185
|
-
|
|
186
|
-
Export vectors from database to file
|
|
187
|
-
|
|
188
|
-
USAGE
|
|
189
|
-
npx agentdb export <database> <file> [options]
|
|
190
|
-
|
|
191
|
-
ARGUMENTS
|
|
192
|
-
<database> Database path
|
|
193
|
-
<file> Output file
|
|
194
|
-
|
|
195
|
-
OPTIONS
|
|
196
|
-
-f, --format <type> Format: json, csv (default: json)
|
|
197
|
-
-l, --limit <n> Limit number of vectors
|
|
198
|
-
-v, --verbose Verbose output
|
|
199
|
-
|
|
200
|
-
EXAMPLES
|
|
201
|
-
npx agentdb export ./db.sqlite vectors.json
|
|
202
|
-
npx agentdb export ./db.sqlite data.csv -f csv -l 1000
|
|
203
|
-
`,
|
|
204
|
-
query: `
|
|
205
|
-
COMMAND: query
|
|
206
|
-
|
|
207
|
-
Query vector database for similar vectors
|
|
208
|
-
|
|
209
|
-
USAGE
|
|
210
|
-
npx agentdb query <database> <embedding> [options]
|
|
211
|
-
|
|
212
|
-
ARGUMENTS
|
|
213
|
-
<database> Database path
|
|
214
|
-
<embedding> Vector as JSON array or space-separated
|
|
215
|
-
|
|
216
|
-
OPTIONS
|
|
217
|
-
-k, --top-k <n> Results to return (default: 5)
|
|
218
|
-
-m, --metric <name> Metric: cosine, euclidean, dot
|
|
219
|
-
-t, --threshold <n> Min similarity threshold
|
|
220
|
-
-f, --format <type> Output: table, json (default: table)
|
|
221
|
-
-v, --verbose Verbose output
|
|
222
|
-
|
|
223
|
-
EXAMPLES
|
|
224
|
-
npx agentdb query ./db.sqlite "[0.1,0.2,0.3]"
|
|
225
|
-
npx agentdb query ./db.sqlite "0.1 0.2 0.3" -k 10
|
|
226
|
-
`,
|
|
227
|
-
stats: `
|
|
228
|
-
COMMAND: stats
|
|
229
|
-
|
|
230
|
-
Show database statistics and information
|
|
231
|
-
|
|
232
|
-
USAGE
|
|
233
|
-
npx agentdb stats <database> [options]
|
|
234
|
-
|
|
235
|
-
ARGUMENTS
|
|
236
|
-
<database> Database path
|
|
237
|
-
|
|
238
|
-
OPTIONS
|
|
239
|
-
-d, --detailed Show detailed statistics
|
|
240
|
-
-f, --format <type> Output: table, json (default: table)
|
|
241
|
-
|
|
242
|
-
EXAMPLES
|
|
243
|
-
npx agentdb stats ./db.sqlite
|
|
244
|
-
npx agentdb stats ./db.sqlite -d -f json
|
|
245
|
-
`,
|
|
246
|
-
benchmark: `
|
|
247
|
-
COMMAND: benchmark
|
|
248
|
-
|
|
249
|
-
Run comprehensive performance benchmarks
|
|
250
|
-
|
|
251
|
-
USAGE
|
|
252
|
-
npx agentdb benchmark [options]
|
|
253
|
-
|
|
254
|
-
OPTIONS
|
|
255
|
-
--suite <name> Suite: insertion, search, all
|
|
256
|
-
--size <n> Dataset size (default: 10000)
|
|
257
|
-
--dimension <n> Vector dimension (default: 1536)
|
|
258
|
-
|
|
259
|
-
EXAMPLES
|
|
260
|
-
npx agentdb benchmark
|
|
261
|
-
npx agentdb benchmark --suite insertion
|
|
262
|
-
npx agentdb benchmark --size 50000
|
|
263
|
-
`,
|
|
264
|
-
'list-plugins': `
|
|
265
|
-
COMMAND: list-plugins
|
|
266
|
-
|
|
267
|
-
List all available learning plugins
|
|
268
|
-
|
|
269
|
-
USAGE
|
|
270
|
-
npx agentdb list-plugins [options]
|
|
271
|
-
|
|
272
|
-
OPTIONS
|
|
273
|
-
-v, --verbose Show detailed information
|
|
274
|
-
--filter <pattern> Filter by name pattern
|
|
275
|
-
--json Output as JSON
|
|
276
|
-
|
|
277
|
-
EXAMPLES
|
|
278
|
-
npx agentdb list-plugins
|
|
279
|
-
npx agentdb list-plugins --verbose
|
|
280
|
-
npx agentdb list-plugins --filter "q-*"
|
|
281
|
-
`,
|
|
282
|
-
'list-templates': `
|
|
283
|
-
COMMAND: list-templates
|
|
284
|
-
|
|
285
|
-
List all available plugin templates
|
|
286
|
-
|
|
287
|
-
USAGE
|
|
288
|
-
npx agentdb list-templates [options]
|
|
289
|
-
|
|
290
|
-
OPTIONS
|
|
291
|
-
-d, --detailed Show detailed information
|
|
292
|
-
-c, --category <name> Filter by category
|
|
293
|
-
--json Output as JSON
|
|
294
|
-
|
|
295
|
-
EXAMPLES
|
|
296
|
-
npx agentdb list-templates
|
|
297
|
-
npx agentdb list-templates --detailed
|
|
298
|
-
npx agentdb list-templates -c reinforcement-learning
|
|
299
|
-
`,
|
|
300
|
-
'plugin-info': `
|
|
301
|
-
COMMAND: plugin-info
|
|
302
|
-
|
|
303
|
-
Get detailed information about a plugin
|
|
304
|
-
|
|
305
|
-
USAGE
|
|
306
|
-
npx agentdb plugin-info <name> [options]
|
|
307
|
-
|
|
308
|
-
ARGUMENTS
|
|
309
|
-
<name> Plugin name
|
|
310
|
-
|
|
311
|
-
OPTIONS
|
|
312
|
-
--json Output as JSON
|
|
313
|
-
--metrics Include performance metrics
|
|
314
|
-
--dependencies Show dependencies
|
|
315
|
-
|
|
316
|
-
EXAMPLES
|
|
317
|
-
npx agentdb plugin-info my-plugin
|
|
318
|
-
npx agentdb plugin-info my-plugin --metrics
|
|
319
|
-
`
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
if (helps[command]) {
|
|
323
|
-
console.log(helps[command]);
|
|
324
|
-
} else {
|
|
325
|
-
console.error(`No detailed help available for: ${command}`);
|
|
326
|
-
console.error(`Run: npx agentdb ${command} --help`);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
function showVersion() {
|
|
331
|
-
console.log(`agentdb v${version}`);
|
|
332
|
-
console.log(`Node: ${process.version}`);
|
|
333
|
-
console.log(`Platform: ${process.platform} ${process.arch}`);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
async function startMcpServer() {
|
|
337
|
-
console.error('🚀 Starting AgentDB MCP Server...');
|
|
338
|
-
console.error('');
|
|
339
|
-
|
|
340
|
-
try {
|
|
341
|
-
// Check if MCP implementation exists
|
|
342
|
-
const mcpPath = require.resolve('../dist/mcp-server.js');
|
|
343
|
-
|
|
344
|
-
// Import and start the MCP server
|
|
345
|
-
const { AgentDBMCPServer } = require(mcpPath);
|
|
346
|
-
const server = new AgentDBMCPServer();
|
|
347
|
-
await server.start();
|
|
348
|
-
} catch (error) {
|
|
349
|
-
console.error('❌ Failed to start MCP server');
|
|
350
|
-
console.error('');
|
|
351
|
-
console.error('Error:', error.message);
|
|
352
|
-
console.error('');
|
|
353
|
-
console.error('Make sure to build the project first:');
|
|
354
|
-
console.error(' npm run build');
|
|
355
|
-
console.error('');
|
|
356
|
-
process.exit(1);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
function initDatabase(path) {
|
|
361
|
-
if (!path) {
|
|
362
|
-
console.error('❌ Error: Database path required');
|
|
363
|
-
console.error('');
|
|
364
|
-
console.error('Usage: agentdb init <path>');
|
|
365
|
-
console.error('Example: agentdb init ./agents.db');
|
|
366
|
-
process.exit(1);
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
console.log(`📦 Initializing agent memory database: ${path}`);
|
|
370
|
-
console.log('');
|
|
371
|
-
|
|
372
|
-
try {
|
|
373
|
-
const { SQLiteVectorDB, Presets } = require('../dist/index.js');
|
|
374
|
-
|
|
375
|
-
// Create a small test database
|
|
376
|
-
const config = Presets.smallDataset(1536, path);
|
|
377
|
-
const db = new SQLiteVectorDB(config);
|
|
378
|
-
|
|
379
|
-
console.log('✅ Database initialized successfully!');
|
|
380
|
-
console.log('');
|
|
381
|
-
console.log('Configuration:');
|
|
382
|
-
console.log(` Path: ${path}`);
|
|
383
|
-
console.log(` Mode: ${config.memoryMode ? 'in-memory' : 'persistent'}`);
|
|
384
|
-
console.log(` Cache Size: ${config.cacheSize}MB`);
|
|
385
|
-
console.log(` WAL Mode: ${config.walMode ? 'enabled' : 'disabled'}`);
|
|
386
|
-
console.log('');
|
|
387
|
-
console.log('Next steps:');
|
|
388
|
-
console.log(' 1. Import the library: const { SQLiteVectorDB } = require("agentdb")');
|
|
389
|
-
console.log(' 2. Insert vectors: db.insert({ embedding: [...], metadata: {...} })');
|
|
390
|
-
console.log(' 3. Search: db.search(queryVector, 5, "cosine", 0.0)');
|
|
391
|
-
console.log(' 4. View the documentation: https://github.com/ruvnet/agentic-flow/tree/main/packages/agentdb');
|
|
392
|
-
console.log('');
|
|
393
|
-
|
|
394
|
-
db.close();
|
|
395
|
-
} catch (error) {
|
|
396
|
-
console.error('❌ Failed to initialize database:', error.message);
|
|
397
|
-
if (error.stack) {
|
|
398
|
-
console.error('\nStack trace:');
|
|
399
|
-
console.error(error.stack);
|
|
400
|
-
}
|
|
401
|
-
process.exit(1);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
async function runBenchmark(...args) {
|
|
406
|
-
try {
|
|
407
|
-
// Convert arguments to array
|
|
408
|
-
const argArray = Array.isArray(args[0]) ? args[0] : Array.from(args);
|
|
409
|
-
|
|
410
|
-
// Parse arguments
|
|
411
|
-
const options = {
|
|
412
|
-
quick: argArray.includes('--quick') || argArray.includes('-q'),
|
|
413
|
-
vectors: null
|
|
414
|
-
};
|
|
415
|
-
|
|
416
|
-
// Parse custom vector count
|
|
417
|
-
const vectorsIndex = argArray.findIndex(arg => arg === '--vectors' || arg === '-v');
|
|
418
|
-
if (vectorsIndex !== -1 && argArray[vectorsIndex + 1]) {
|
|
419
|
-
options.vectors = parseInt(argArray[vectorsIndex + 1], 10);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// Show help if requested
|
|
423
|
-
if (argArray.includes('--help') || argArray.includes('-h')) {
|
|
424
|
-
console.log('');
|
|
425
|
-
console.log('AgentDB Benchmark');
|
|
426
|
-
console.log('');
|
|
427
|
-
console.log('USAGE');
|
|
428
|
-
console.log(' npx agentdb benchmark [options]');
|
|
429
|
-
console.log('');
|
|
430
|
-
console.log('OPTIONS');
|
|
431
|
-
console.log(' --quick, -q Run quick benchmark (500/1000 vectors)');
|
|
432
|
-
console.log(' --vectors, -v <n> Custom batch size (default: 5000, quick: 1000)');
|
|
433
|
-
console.log(' --help, -h Show this help');
|
|
434
|
-
console.log('');
|
|
435
|
-
console.log('EXAMPLES');
|
|
436
|
-
console.log(' npx agentdb benchmark # Standard benchmark (5K vectors)');
|
|
437
|
-
console.log(' npx agentdb benchmark --quick # Quick benchmark (1K vectors)');
|
|
438
|
-
console.log(' npx agentdb benchmark -v 10000 # Custom 10K vectors');
|
|
439
|
-
console.log('');
|
|
440
|
-
console.log('For comprehensive benchmarks with WASM comparison:');
|
|
441
|
-
console.log(' git clone https://github.com/ruvnet/agentic-flow.git');
|
|
442
|
-
console.log(' cd agentic-flow/packages/agentdb');
|
|
443
|
-
console.log(' npm install && npm run bench:comprehensive');
|
|
444
|
-
console.log('');
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
// Run the included benchmark
|
|
449
|
-
const benchmarkPath = require.resolve('./benchmark.js');
|
|
450
|
-
const { runBenchmark } = require(benchmarkPath);
|
|
451
|
-
await runBenchmark(options);
|
|
452
|
-
} catch (error) {
|
|
453
|
-
console.error('');
|
|
454
|
-
console.error('❌ Benchmark failed:', error.message);
|
|
455
|
-
console.error('');
|
|
456
|
-
console.error('For comprehensive benchmarks, clone the source repository:');
|
|
457
|
-
console.error('');
|
|
458
|
-
console.error(' git clone https://github.com/ruvnet/agentic-flow.git');
|
|
459
|
-
console.error(' cd agentic-flow/packages/agentdb');
|
|
460
|
-
console.error(' npm install');
|
|
461
|
-
console.error(' npm run bench:comprehensive');
|
|
462
|
-
console.error('');
|
|
463
|
-
process.exit(1);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function startRepl() {
|
|
468
|
-
console.log('🔧 Interactive REPL (experimental)');
|
|
469
|
-
console.log('');
|
|
470
|
-
console.error('❌ REPL not implemented yet');
|
|
471
|
-
console.error('');
|
|
472
|
-
console.error('For now, use Node.js REPL:');
|
|
473
|
-
console.error(' node');
|
|
474
|
-
console.error(' > const { SqliteVectorDB, Presets } = require("agentdb")');
|
|
475
|
-
console.error(' > const db = await SqliteVectorDB.new(Presets.inMemory(1536))');
|
|
476
|
-
console.error('');
|
|
477
|
-
process.exit(1);
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
// Learning Plugin CLI commands
|
|
481
|
-
function createPlugin(...args) {
|
|
482
|
-
try {
|
|
483
|
-
const wrapperPath = require('path').join(__dirname, 'plugin-cli-wrapper.mjs');
|
|
484
|
-
// Use the .mjs wrapper to load the ES module
|
|
485
|
-
// Prepend 'create-plugin' command since plugin-cli expects it
|
|
486
|
-
const { spawn } = require('child_process');
|
|
487
|
-
const child = spawn('node', [wrapperPath, 'create-plugin', ...args], {
|
|
488
|
-
stdio: 'inherit',
|
|
489
|
-
cwd: require('path').resolve(__dirname, '..')
|
|
490
|
-
});
|
|
491
|
-
|
|
492
|
-
child.on('close', (code) => {
|
|
493
|
-
process.exit(code);
|
|
494
|
-
});
|
|
495
|
-
} catch (error) {
|
|
496
|
-
console.error('❌ Plugin CLI not available');
|
|
497
|
-
console.error('');
|
|
498
|
-
console.error('Error:', error.message);
|
|
499
|
-
console.error('');
|
|
500
|
-
console.error('Make sure to build the project first:');
|
|
501
|
-
console.error(' npm run build');
|
|
502
|
-
console.error('');
|
|
503
|
-
process.exit(1);
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
function listPlugins(...args) {
|
|
508
|
-
// Call plugin CLI wrapper with list-plugins command
|
|
509
|
-
const wrapperPath = require('path').join(__dirname, 'plugin-cli-wrapper.mjs');
|
|
510
|
-
const { spawn } = require('child_process');
|
|
511
|
-
const child = spawn('node', [wrapperPath, 'list-plugins', ...args], {
|
|
512
|
-
stdio: 'inherit',
|
|
513
|
-
cwd: require('path').resolve(__dirname, '..')
|
|
514
|
-
});
|
|
515
|
-
child.on('close', (code) => process.exit(code));
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
function listTemplates(...args) {
|
|
519
|
-
const wrapperPath = require('path').join(__dirname, 'plugin-cli-wrapper.mjs');
|
|
520
|
-
const { spawn} = require('child_process');
|
|
521
|
-
const child = spawn('node', [wrapperPath, 'list-templates', ...args], {
|
|
522
|
-
stdio: 'inherit',
|
|
523
|
-
cwd: require('path').resolve(__dirname, '..')
|
|
524
|
-
});
|
|
525
|
-
child.on('close', (code) => process.exit(code));
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
function pluginInfo(...args) {
|
|
529
|
-
const wrapperPath = require('path').join(__dirname, 'plugin-cli-wrapper.mjs');
|
|
530
|
-
const { spawn } = require('child_process');
|
|
531
|
-
const child = spawn('node', [wrapperPath, 'plugin-info', ...args], {
|
|
532
|
-
stdio: 'inherit',
|
|
533
|
-
cwd: require('path').resolve(__dirname, '..')
|
|
534
|
-
});
|
|
535
|
-
child.on('close', (code) => process.exit(code));
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
function usePlugin(...args) {
|
|
539
|
-
const wrapperPath = require('path').join(__dirname, 'plugin-cli-wrapper.mjs');
|
|
540
|
-
const { spawn } = require('child_process');
|
|
541
|
-
const child = spawn('node', [wrapperPath, 'use-plugin', ...args], {
|
|
542
|
-
stdio: 'inherit',
|
|
543
|
-
cwd: require('path').resolve(__dirname, '..')
|
|
544
|
-
});
|
|
545
|
-
child.on('close', (code) => process.exit(code));
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
// Database commands
|
|
549
|
-
function importCommand(...args) {
|
|
550
|
-
const [database, file, ...flags] = args;
|
|
551
|
-
|
|
552
|
-
if (!database || !file) {
|
|
553
|
-
console.error('❌ Usage: agentdb import <database> <file> [options]');
|
|
554
|
-
console.error('');
|
|
555
|
-
console.error('Options:');
|
|
556
|
-
console.error(' -f, --format <format> File format (json|csv), default: json');
|
|
557
|
-
console.error(' -b, --batch-size <size> Batch size for imports, default: 1000');
|
|
558
|
-
console.error(' -v, --verbose Verbose output');
|
|
559
|
-
console.error('');
|
|
560
|
-
console.error('Examples:');
|
|
561
|
-
console.error(' agentdb import ./db.sqlite vectors.json');
|
|
562
|
-
console.error(' agentdb import ./db.sqlite data.csv -f csv -v');
|
|
563
|
-
process.exit(1);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
try {
|
|
567
|
-
const { importVectors } = require('../dist/cli/db-commands.js');
|
|
568
|
-
const options = parseFlags(flags);
|
|
569
|
-
importVectors(database, file, options).catch(err => {
|
|
570
|
-
console.error('❌ Import failed:', err.message);
|
|
571
|
-
process.exit(1);
|
|
572
|
-
});
|
|
573
|
-
} catch (error) {
|
|
574
|
-
console.error('❌ Database commands not available. Please run: npm run build');
|
|
575
|
-
process.exit(1);
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
function exportCommand(...args) {
|
|
580
|
-
const [database, file, ...flags] = args;
|
|
581
|
-
|
|
582
|
-
if (!database || !file) {
|
|
583
|
-
console.error('❌ Usage: agentdb export <database> <file> [options]');
|
|
584
|
-
console.error('');
|
|
585
|
-
console.error('Options:');
|
|
586
|
-
console.error(' -f, --format <format> File format (json|csv), default: json');
|
|
587
|
-
console.error(' -l, --limit <number> Limit number of vectors');
|
|
588
|
-
console.error(' -v, --verbose Verbose output');
|
|
589
|
-
console.error('');
|
|
590
|
-
console.error('Examples:');
|
|
591
|
-
console.error(' agentdb export ./db.sqlite vectors.json');
|
|
592
|
-
console.error(' agentdb export ./db.sqlite data.csv -f csv -l 1000');
|
|
593
|
-
process.exit(1);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
try {
|
|
597
|
-
const { exportVectors } = require('../dist/cli/db-commands.js');
|
|
598
|
-
const options = parseFlags(flags);
|
|
599
|
-
exportVectors(database, file, options).catch(err => {
|
|
600
|
-
console.error('❌ Export failed:', err.message);
|
|
601
|
-
process.exit(1);
|
|
602
|
-
});
|
|
603
|
-
} catch (error) {
|
|
604
|
-
console.error('❌ Database commands not available. Please run: npm run build');
|
|
605
|
-
process.exit(1);
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
function queryCommand(...args) {
|
|
610
|
-
const [database, embedding, ...flags] = args;
|
|
611
|
-
|
|
612
|
-
if (!database || !embedding) {
|
|
613
|
-
console.error('❌ Usage: agentdb query <database> <embedding> [options]');
|
|
614
|
-
console.error('');
|
|
615
|
-
console.error('Options:');
|
|
616
|
-
console.error(' -k, --top-k <number> Number of results, default: 5');
|
|
617
|
-
console.error(' -m, --metric <metric> Similarity metric (cosine|euclidean|dot), default: cosine');
|
|
618
|
-
console.error(' -t, --threshold <number> Minimum similarity threshold, default: 0.0');
|
|
619
|
-
console.error(' -f, --format <format> Output format (table|json), default: table');
|
|
620
|
-
console.error(' -v, --verbose Verbose output');
|
|
621
|
-
console.error('');
|
|
622
|
-
console.error('Examples:');
|
|
623
|
-
console.error(' agentdb query ./db.sqlite "[0.1,0.2,0.3]"');
|
|
624
|
-
console.error(' agentdb query ./db.sqlite "0.1 0.2 0.3" -k 10 -m euclidean');
|
|
625
|
-
process.exit(1);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
try {
|
|
629
|
-
const { queryVectors } = require('../dist/cli/db-commands.js');
|
|
630
|
-
const options = parseFlags(flags);
|
|
631
|
-
queryVectors(database, embedding, options).catch(err => {
|
|
632
|
-
console.error('❌ Query failed:', err.message);
|
|
633
|
-
process.exit(1);
|
|
634
|
-
});
|
|
635
|
-
} catch (error) {
|
|
636
|
-
console.error('❌ Database commands not available. Please run: npm run build');
|
|
637
|
-
process.exit(1);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
function statsCommand(...args) {
|
|
642
|
-
const [database, ...flags] = args;
|
|
643
|
-
|
|
644
|
-
if (!database) {
|
|
645
|
-
console.error('❌ Usage: agentdb stats <database> [options]');
|
|
646
|
-
console.error('');
|
|
647
|
-
console.error('Options:');
|
|
648
|
-
console.error(' -d, --detailed Show detailed statistics');
|
|
649
|
-
console.error(' -f, --format <format> Output format (table|json), default: table');
|
|
650
|
-
console.error('');
|
|
651
|
-
console.error('Examples:');
|
|
652
|
-
console.error(' agentdb stats ./db.sqlite');
|
|
653
|
-
console.error(' agentdb stats ./db.sqlite -d -f json');
|
|
654
|
-
process.exit(1);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
try {
|
|
658
|
-
const { showStats } = require('../dist/cli/db-commands.js');
|
|
659
|
-
const options = parseFlags(flags);
|
|
660
|
-
showStats(database, options).catch(err => {
|
|
661
|
-
console.error('❌ Stats command failed:', err.message);
|
|
662
|
-
process.exit(1);
|
|
663
|
-
});
|
|
664
|
-
} catch (error) {
|
|
665
|
-
console.error('❌ Database commands not available. Please run: npm run build');
|
|
666
|
-
process.exit(1);
|
|
667
|
-
}
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
// Parse command line flags into options object
|
|
671
|
-
function parseFlags(flags) {
|
|
672
|
-
const options = {};
|
|
673
|
-
for (let i = 0; i < flags.length; i++) {
|
|
674
|
-
const flag = flags[i];
|
|
675
|
-
|
|
676
|
-
if (flag === '-f' || flag === '--format') {
|
|
677
|
-
options.format = flags[++i];
|
|
678
|
-
} else if (flag === '-b' || flag === '--batch-size') {
|
|
679
|
-
options.batchSize = parseInt(flags[++i], 10);
|
|
680
|
-
} else if (flag === '-k' || flag === '--top-k') {
|
|
681
|
-
options.k = parseInt(flags[++i], 10);
|
|
682
|
-
} else if (flag === '-m' || flag === '--metric') {
|
|
683
|
-
options.metric = flags[++i];
|
|
684
|
-
} else if (flag === '-t' || flag === '--threshold') {
|
|
685
|
-
options.threshold = parseFloat(flags[++i]);
|
|
686
|
-
} else if (flag === '-l' || flag === '--limit') {
|
|
687
|
-
options.limit = parseInt(flags[++i], 10);
|
|
688
|
-
} else if (flag === '-d' || flag === '--detailed') {
|
|
689
|
-
options.detailed = true;
|
|
690
|
-
} else if (flag === '-v' || flag === '--verbose') {
|
|
691
|
-
options.verbose = true;
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
return options;
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// Parse command line arguments
|
|
698
|
-
const [,, command = 'help', ...args] = process.argv;
|
|
699
|
-
|
|
700
|
-
// Handle --version and -v flags at root level
|
|
701
|
-
if (command === '--version' || command === '-v') {
|
|
702
|
-
showVersion();
|
|
703
|
-
process.exit(0);
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
// Handle --help and -h flags at root level
|
|
707
|
-
if (command === '--help' || command === '-h') {
|
|
708
|
-
showHelp();
|
|
709
|
-
process.exit(0);
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
// Handle --help flag for any command
|
|
713
|
-
if (args.includes('--help') || args.includes('-h')) {
|
|
714
|
-
showCommandHelp(command);
|
|
715
|
-
process.exit(0);
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
const handler = COMMANDS[command];
|
|
719
|
-
if (handler) {
|
|
720
|
-
// Handle async commands
|
|
721
|
-
const result = handler(...args);
|
|
722
|
-
if (result instanceof Promise) {
|
|
723
|
-
result.catch(error => {
|
|
724
|
-
console.error('Error:', error);
|
|
725
|
-
process.exit(1);
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
} else {
|
|
729
|
-
console.error(`❌ Unknown command: ${command}`);
|
|
730
|
-
console.error('');
|
|
731
|
-
console.error('Run "npx agentdb help" for usage information');
|
|
732
|
-
process.exit(1);
|
|
733
|
-
}
|