agentdb 1.6.1 โ†’ 2.0.0-alpha.2

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.
Files changed (918) hide show
  1. package/README.md +1098 -350
  2. package/dist/agentdb-advanced.js +2110 -0
  3. package/dist/agentdb-advanced.min.js +1 -0
  4. package/dist/agentdb.min.js +4 -4
  5. package/dist/backends/GraphBackend.d.ts +196 -0
  6. package/dist/backends/GraphBackend.d.ts.map +1 -0
  7. package/dist/backends/GraphBackend.js +33 -0
  8. package/dist/backends/GraphBackend.js.map +1 -0
  9. package/dist/backends/LearningBackend.d.ts +148 -0
  10. package/dist/backends/LearningBackend.d.ts.map +1 -0
  11. package/dist/backends/LearningBackend.js +27 -0
  12. package/dist/backends/LearningBackend.js.map +1 -0
  13. package/dist/backends/VectorBackend.d.ts +119 -0
  14. package/dist/backends/VectorBackend.d.ts.map +1 -0
  15. package/dist/backends/VectorBackend.js +14 -0
  16. package/dist/backends/VectorBackend.js.map +1 -0
  17. package/dist/backends/detector.d.ts +81 -0
  18. package/dist/backends/detector.d.ts.map +1 -0
  19. package/dist/backends/detector.js +192 -0
  20. package/dist/backends/detector.js.map +1 -0
  21. package/dist/backends/factory.d.ts +50 -0
  22. package/dist/backends/factory.d.ts.map +1 -0
  23. package/dist/backends/factory.js +161 -0
  24. package/dist/backends/factory.js.map +1 -0
  25. package/dist/backends/graph/GraphDatabaseAdapter.d.ts +139 -0
  26. package/dist/backends/graph/GraphDatabaseAdapter.d.ts.map +1 -0
  27. package/dist/backends/graph/GraphDatabaseAdapter.js +194 -0
  28. package/dist/backends/graph/GraphDatabaseAdapter.js.map +1 -0
  29. package/dist/backends/hnswlib/HNSWLibBackend.d.ts +92 -0
  30. package/dist/backends/hnswlib/HNSWLibBackend.d.ts.map +1 -0
  31. package/dist/backends/hnswlib/HNSWLibBackend.js +316 -0
  32. package/dist/backends/hnswlib/HNSWLibBackend.js.map +1 -0
  33. package/dist/backends/hnswlib/index.d.ts +7 -0
  34. package/dist/backends/hnswlib/index.d.ts.map +1 -0
  35. package/dist/backends/hnswlib/index.js +7 -0
  36. package/dist/backends/hnswlib/index.js.map +1 -0
  37. package/dist/backends/index.d.ts +14 -0
  38. package/dist/backends/index.d.ts.map +1 -0
  39. package/dist/backends/index.js +13 -0
  40. package/dist/backends/index.js.map +1 -0
  41. package/dist/backends/ruvector/RuVectorBackend.d.ts +75 -0
  42. package/dist/backends/ruvector/RuVectorBackend.d.ts.map +1 -0
  43. package/dist/backends/ruvector/RuVectorBackend.js +198 -0
  44. package/dist/backends/ruvector/RuVectorBackend.js.map +1 -0
  45. package/dist/backends/ruvector/RuVectorLearning.d.ts +104 -0
  46. package/dist/backends/ruvector/RuVectorLearning.d.ts.map +1 -0
  47. package/dist/backends/ruvector/RuVectorLearning.js +177 -0
  48. package/dist/backends/ruvector/RuVectorLearning.js.map +1 -0
  49. package/dist/backends/ruvector/index.d.ts +9 -0
  50. package/dist/backends/ruvector/index.d.ts.map +1 -0
  51. package/dist/backends/ruvector/index.js +8 -0
  52. package/dist/backends/ruvector/index.js.map +1 -0
  53. package/dist/browser/AdvancedFeatures.d.ts +144 -0
  54. package/dist/browser/AdvancedFeatures.d.ts.map +1 -0
  55. package/dist/browser/AdvancedFeatures.js +430 -0
  56. package/dist/browser/AdvancedFeatures.js.map +1 -0
  57. package/dist/browser/HNSWIndex.d.ts +117 -0
  58. package/dist/browser/HNSWIndex.d.ts.map +1 -0
  59. package/dist/browser/HNSWIndex.js +402 -0
  60. package/dist/browser/HNSWIndex.js.map +1 -0
  61. package/dist/browser/ProductQuantization.d.ts +107 -0
  62. package/dist/browser/ProductQuantization.d.ts.map +1 -0
  63. package/dist/browser/ProductQuantization.js +337 -0
  64. package/dist/browser/ProductQuantization.js.map +1 -0
  65. package/dist/browser/browser/AdvancedFeatures.d.ts +144 -0
  66. package/dist/browser/browser/AdvancedFeatures.d.ts.map +1 -0
  67. package/dist/browser/browser/AdvancedFeatures.js +427 -0
  68. package/dist/browser/browser/HNSWIndex.d.ts +117 -0
  69. package/dist/browser/browser/HNSWIndex.d.ts.map +1 -0
  70. package/dist/browser/browser/HNSWIndex.js +402 -0
  71. package/dist/browser/browser/ProductQuantization.d.ts +107 -0
  72. package/dist/browser/browser/ProductQuantization.d.ts.map +1 -0
  73. package/dist/browser/browser/ProductQuantization.js +348 -0
  74. package/dist/browser/browser/index.d.ts +223 -0
  75. package/dist/browser/browser/index.d.ts.map +1 -0
  76. package/dist/browser/browser/index.js +233 -0
  77. package/dist/browser/index.d.ts +223 -0
  78. package/dist/browser/index.d.ts.map +1 -0
  79. package/dist/browser/index.js +225 -0
  80. package/dist/browser/index.js.map +1 -0
  81. package/dist/cli/agentdb-cli.d.ts.map +1 -1
  82. package/dist/cli/agentdb-cli.js +130 -8
  83. package/dist/cli/agentdb-cli.js.map +1 -1
  84. package/dist/cli/agentdb.db +0 -0
  85. package/dist/cli/commands/init.d.ts +12 -0
  86. package/dist/cli/commands/init.d.ts.map +1 -0
  87. package/dist/cli/commands/init.js +115 -0
  88. package/dist/cli/commands/init.js.map +1 -0
  89. package/dist/cli/commands/install-embeddings.d.ts +10 -0
  90. package/dist/cli/commands/install-embeddings.d.ts.map +1 -0
  91. package/dist/cli/commands/install-embeddings.js +68 -0
  92. package/dist/cli/commands/install-embeddings.js.map +1 -0
  93. package/dist/cli/commands/migrate.d.ts +15 -0
  94. package/dist/cli/commands/migrate.d.ts.map +1 -0
  95. package/dist/cli/commands/migrate.js +425 -0
  96. package/dist/cli/commands/migrate.js.map +1 -0
  97. package/dist/cli/commands/status.d.ts +10 -0
  98. package/dist/cli/commands/status.d.ts.map +1 -0
  99. package/dist/cli/commands/status.js +129 -0
  100. package/dist/cli/commands/status.js.map +1 -0
  101. package/dist/controllers/CausalRecall.d.ts +3 -1
  102. package/dist/controllers/CausalRecall.d.ts.map +1 -1
  103. package/dist/controllers/CausalRecall.js +35 -4
  104. package/dist/controllers/CausalRecall.js.map +1 -1
  105. package/dist/controllers/ExplainableRecall.d.ts +24 -0
  106. package/dist/controllers/ExplainableRecall.d.ts.map +1 -1
  107. package/dist/controllers/ExplainableRecall.js +102 -5
  108. package/dist/controllers/ExplainableRecall.js.map +1 -1
  109. package/dist/controllers/NightlyLearner.d.ts.map +1 -1
  110. package/dist/controllers/NightlyLearner.js +7 -4
  111. package/dist/controllers/NightlyLearner.js.map +1 -1
  112. package/dist/controllers/ReasoningBank.d.ts +101 -2
  113. package/dist/controllers/ReasoningBank.d.ts.map +1 -1
  114. package/dist/controllers/ReasoningBank.js +196 -4
  115. package/dist/controllers/ReasoningBank.js.map +1 -1
  116. package/dist/controllers/ReflexionMemory.d.ts +41 -1
  117. package/dist/controllers/ReflexionMemory.d.ts.map +1 -1
  118. package/dist/controllers/ReflexionMemory.js +282 -5
  119. package/dist/controllers/ReflexionMemory.js.map +1 -1
  120. package/dist/controllers/SkillLibrary.d.ts +27 -9
  121. package/dist/controllers/SkillLibrary.d.ts.map +1 -1
  122. package/dist/controllers/SkillLibrary.js +136 -47
  123. package/dist/controllers/SkillLibrary.js.map +1 -1
  124. package/dist/db-fallback.d.ts.map +1 -1
  125. package/dist/db-fallback.js +100 -29
  126. package/dist/db-fallback.js.map +1 -1
  127. package/dist/db-test.d.ts +13 -0
  128. package/dist/db-test.d.ts.map +1 -0
  129. package/dist/db-test.js +55 -0
  130. package/dist/db-test.js.map +1 -0
  131. package/dist/db-unified.d.ts +76 -0
  132. package/dist/db-unified.d.ts.map +1 -0
  133. package/dist/db-unified.js +278 -0
  134. package/dist/db-unified.js.map +1 -0
  135. package/dist/malp/core/ccc.d.ts +99 -0
  136. package/dist/malp/core/ccc.d.ts.map +1 -0
  137. package/dist/malp/core/ccc.js +181 -0
  138. package/dist/malp/core/ccc.js.map +1 -0
  139. package/dist/malp/core/index.d.ts +9 -0
  140. package/dist/malp/core/index.d.ts.map +1 -0
  141. package/dist/malp/core/index.js +9 -0
  142. package/dist/malp/core/index.js.map +1 -0
  143. package/dist/malp/core/linalg.d.ts +101 -0
  144. package/dist/malp/core/linalg.d.ts.map +1 -0
  145. package/dist/malp/core/linalg.js +278 -0
  146. package/dist/malp/core/linalg.js.map +1 -0
  147. package/dist/malp/core/optimizer.d.ts +68 -0
  148. package/dist/malp/core/optimizer.d.ts.map +1 -0
  149. package/dist/malp/core/optimizer.js +160 -0
  150. package/dist/malp/core/optimizer.js.map +1 -0
  151. package/dist/malp/index.d.ts +33 -0
  152. package/dist/malp/index.d.ts.map +1 -0
  153. package/dist/malp/index.js +37 -0
  154. package/dist/malp/index.js.map +1 -0
  155. package/dist/malp/metrics/agreement.d.ts +106 -0
  156. package/dist/malp/metrics/agreement.d.ts.map +1 -0
  157. package/dist/malp/metrics/agreement.js +199 -0
  158. package/dist/malp/metrics/agreement.js.map +1 -0
  159. package/dist/malp/metrics/comparison.d.ts +93 -0
  160. package/dist/malp/metrics/comparison.d.ts.map +1 -0
  161. package/dist/malp/metrics/comparison.js +256 -0
  162. package/dist/malp/metrics/comparison.js.map +1 -0
  163. package/dist/malp/metrics/index.d.ts +8 -0
  164. package/dist/malp/metrics/index.d.ts.map +1 -0
  165. package/dist/malp/metrics/index.js +8 -0
  166. package/dist/malp/metrics/index.js.map +1 -0
  167. package/dist/malp/metrics/performance.d.ts +61 -0
  168. package/dist/malp/metrics/performance.d.ts.map +1 -0
  169. package/dist/malp/metrics/performance.js +190 -0
  170. package/dist/malp/metrics/performance.js.map +1 -0
  171. package/dist/malp/models/index.d.ts +7 -0
  172. package/dist/malp/models/index.d.ts.map +1 -0
  173. package/dist/malp/models/index.js +7 -0
  174. package/dist/malp/models/index.js.map +1 -0
  175. package/dist/malp/models/malp.d.ts +116 -0
  176. package/dist/malp/models/malp.d.ts.map +1 -0
  177. package/dist/malp/models/malp.js +206 -0
  178. package/dist/malp/models/malp.js.map +1 -0
  179. package/dist/malp/models/regressor.d.ts +80 -0
  180. package/dist/malp/models/regressor.d.ts.map +1 -0
  181. package/dist/malp/models/regressor.js +229 -0
  182. package/dist/malp/models/regressor.js.map +1 -0
  183. package/dist/malp/reasoningbank_validator.d.ts +187 -0
  184. package/dist/malp/reasoningbank_validator.d.ts.map +1 -0
  185. package/dist/malp/reasoningbank_validator.js +246 -0
  186. package/dist/malp/reasoningbank_validator.js.map +1 -0
  187. package/dist/malp/wasm_bindings.d.ts +344 -0
  188. package/dist/malp/wasm_bindings.d.ts.map +1 -0
  189. package/dist/malp/wasm_bindings.js +9 -0
  190. package/dist/malp/wasm_bindings.js.map +1 -0
  191. package/dist/mcp/agentdb-mcp-server.js +512 -33
  192. package/dist/mcp/agentdb-mcp-server.js.map +1 -1
  193. package/dist/optimizations/BatchOperations.d.ts +42 -0
  194. package/dist/optimizations/BatchOperations.d.ts.map +1 -1
  195. package/dist/optimizations/BatchOperations.js +181 -0
  196. package/dist/optimizations/BatchOperations.js.map +1 -1
  197. package/dist/optimizations/ToolCache.d.ts +137 -0
  198. package/dist/optimizations/ToolCache.d.ts.map +1 -0
  199. package/dist/optimizations/ToolCache.js +281 -0
  200. package/dist/optimizations/ToolCache.js.map +1 -0
  201. package/dist/security/input-validation.d.ts +24 -0
  202. package/dist/security/input-validation.d.ts.map +1 -1
  203. package/dist/security/input-validation.js +106 -0
  204. package/dist/security/input-validation.js.map +1 -1
  205. package/dist/security/limits.d.ts +150 -0
  206. package/dist/security/limits.d.ts.map +1 -0
  207. package/dist/security/limits.js +288 -0
  208. package/dist/security/limits.js.map +1 -0
  209. package/dist/security/path-security.d.ts +100 -0
  210. package/dist/security/path-security.d.ts.map +1 -0
  211. package/dist/security/path-security.js +337 -0
  212. package/dist/security/path-security.js.map +1 -0
  213. package/dist/security/validation.d.ts +95 -0
  214. package/dist/security/validation.d.ts.map +1 -0
  215. package/dist/security/validation.js +315 -0
  216. package/dist/security/validation.js.map +1 -0
  217. package/dist/simulation/cli.d.ts +9 -0
  218. package/dist/simulation/cli.d.ts.map +1 -0
  219. package/dist/simulation/cli.js +68 -0
  220. package/dist/simulation/cli.js.map +1 -0
  221. package/dist/simulation/runner.d.ts +21 -0
  222. package/dist/simulation/runner.d.ts.map +1 -0
  223. package/dist/simulation/runner.js +241 -0
  224. package/dist/simulation/runner.js.map +1 -0
  225. package/dist/simulation/scenarios/aidefence-integration.d.ts +24 -0
  226. package/dist/simulation/scenarios/aidefence-integration.d.ts.map +1 -0
  227. package/dist/simulation/scenarios/aidefence-integration.js +124 -0
  228. package/dist/simulation/scenarios/aidefence-integration.js.map +1 -0
  229. package/dist/simulation/scenarios/bmssp-integration.d.ts +23 -0
  230. package/dist/simulation/scenarios/bmssp-integration.d.ts.map +1 -0
  231. package/dist/simulation/scenarios/bmssp-integration.js +104 -0
  232. package/dist/simulation/scenarios/bmssp-integration.js.map +1 -0
  233. package/dist/simulation/scenarios/causal-reasoning.d.ts +16 -0
  234. package/dist/simulation/scenarios/causal-reasoning.d.ts.map +1 -0
  235. package/dist/simulation/scenarios/causal-reasoning.js +108 -0
  236. package/dist/simulation/scenarios/causal-reasoning.js.map +1 -0
  237. package/dist/simulation/scenarios/consciousness-explorer.d.ts +25 -0
  238. package/dist/simulation/scenarios/consciousness-explorer.d.ts.map +1 -0
  239. package/dist/simulation/scenarios/consciousness-explorer.js +108 -0
  240. package/dist/simulation/scenarios/consciousness-explorer.js.map +1 -0
  241. package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.d.ts +135 -0
  242. package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.d.ts.map +1 -0
  243. package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.js +158 -0
  244. package/dist/simulation/scenarios/domain-examples/e-commerce-recommendations.js.map +1 -0
  245. package/dist/simulation/scenarios/domain-examples/index.d.ts +14 -0
  246. package/dist/simulation/scenarios/domain-examples/index.d.ts.map +1 -0
  247. package/dist/simulation/scenarios/domain-examples/index.js +14 -0
  248. package/dist/simulation/scenarios/domain-examples/index.js.map +1 -0
  249. package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.d.ts +178 -0
  250. package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.d.ts.map +1 -0
  251. package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.js +218 -0
  252. package/dist/simulation/scenarios/domain-examples/iot-sensor-networks.js.map +1 -0
  253. package/dist/simulation/scenarios/domain-examples/medical-imaging.d.ts +122 -0
  254. package/dist/simulation/scenarios/domain-examples/medical-imaging.d.ts.map +1 -0
  255. package/dist/simulation/scenarios/domain-examples/medical-imaging.js +129 -0
  256. package/dist/simulation/scenarios/domain-examples/medical-imaging.js.map +1 -0
  257. package/dist/simulation/scenarios/domain-examples/robotics-navigation.d.ts +166 -0
  258. package/dist/simulation/scenarios/domain-examples/robotics-navigation.d.ts.map +1 -0
  259. package/dist/simulation/scenarios/domain-examples/robotics-navigation.js +161 -0
  260. package/dist/simulation/scenarios/domain-examples/robotics-navigation.js.map +1 -0
  261. package/dist/simulation/scenarios/domain-examples/scientific-research.d.ts +151 -0
  262. package/dist/simulation/scenarios/domain-examples/scientific-research.d.ts.map +1 -0
  263. package/dist/simulation/scenarios/domain-examples/scientific-research.js +187 -0
  264. package/dist/simulation/scenarios/domain-examples/scientific-research.js.map +1 -0
  265. package/dist/simulation/scenarios/domain-examples/trading-systems.d.ts +102 -0
  266. package/dist/simulation/scenarios/domain-examples/trading-systems.d.ts.map +1 -0
  267. package/dist/simulation/scenarios/domain-examples/trading-systems.js +100 -0
  268. package/dist/simulation/scenarios/domain-examples/trading-systems.js.map +1 -0
  269. package/dist/simulation/scenarios/goalie-integration.d.ts +24 -0
  270. package/dist/simulation/scenarios/goalie-integration.d.ts.map +1 -0
  271. package/dist/simulation/scenarios/goalie-integration.js +121 -0
  272. package/dist/simulation/scenarios/goalie-integration.js.map +1 -0
  273. package/dist/simulation/scenarios/graph-traversal.d.ts +17 -0
  274. package/dist/simulation/scenarios/graph-traversal.d.ts.map +1 -0
  275. package/dist/simulation/scenarios/graph-traversal.js +101 -0
  276. package/dist/simulation/scenarios/graph-traversal.js.map +1 -0
  277. package/dist/simulation/scenarios/latent-space/attention-analysis.d.ts +45 -0
  278. package/dist/simulation/scenarios/latent-space/attention-analysis.d.ts.map +1 -0
  279. package/dist/simulation/scenarios/latent-space/attention-analysis.js +435 -0
  280. package/dist/simulation/scenarios/latent-space/attention-analysis.js.map +1 -0
  281. package/dist/simulation/scenarios/latent-space/clustering-analysis.d.ts +55 -0
  282. package/dist/simulation/scenarios/latent-space/clustering-analysis.d.ts.map +1 -0
  283. package/dist/simulation/scenarios/latent-space/clustering-analysis.js +606 -0
  284. package/dist/simulation/scenarios/latent-space/clustering-analysis.js.map +1 -0
  285. package/dist/simulation/scenarios/latent-space/hnsw-exploration.d.ts +74 -0
  286. package/dist/simulation/scenarios/latent-space/hnsw-exploration.d.ts.map +1 -0
  287. package/dist/simulation/scenarios/latent-space/hnsw-exploration.js +391 -0
  288. package/dist/simulation/scenarios/latent-space/hnsw-exploration.js.map +1 -0
  289. package/dist/simulation/scenarios/latent-space/hypergraph-exploration.d.ts +51 -0
  290. package/dist/simulation/scenarios/latent-space/hypergraph-exploration.d.ts.map +1 -0
  291. package/dist/simulation/scenarios/latent-space/hypergraph-exploration.js +536 -0
  292. package/dist/simulation/scenarios/latent-space/hypergraph-exploration.js.map +1 -0
  293. package/dist/simulation/scenarios/latent-space/index.d.ts +35 -0
  294. package/dist/simulation/scenarios/latent-space/index.d.ts.map +1 -0
  295. package/dist/simulation/scenarios/latent-space/index.js +35 -0
  296. package/dist/simulation/scenarios/latent-space/index.js.map +1 -0
  297. package/dist/simulation/scenarios/latent-space/neural-augmentation.d.ts +52 -0
  298. package/dist/simulation/scenarios/latent-space/neural-augmentation.d.ts.map +1 -0
  299. package/dist/simulation/scenarios/latent-space/neural-augmentation.js +472 -0
  300. package/dist/simulation/scenarios/latent-space/neural-augmentation.js.map +1 -0
  301. package/dist/simulation/scenarios/latent-space/quantum-hybrid.d.ts +53 -0
  302. package/dist/simulation/scenarios/latent-space/quantum-hybrid.d.ts.map +1 -0
  303. package/dist/simulation/scenarios/latent-space/quantum-hybrid.js +391 -0
  304. package/dist/simulation/scenarios/latent-space/quantum-hybrid.js.map +1 -0
  305. package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.d.ts +52 -0
  306. package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.d.ts.map +1 -0
  307. package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.js +514 -0
  308. package/dist/simulation/scenarios/latent-space/self-organizing-hnsw.js.map +1 -0
  309. package/dist/simulation/scenarios/latent-space/traversal-optimization.d.ts +53 -0
  310. package/dist/simulation/scenarios/latent-space/traversal-optimization.d.ts.map +1 -0
  311. package/dist/simulation/scenarios/latent-space/traversal-optimization.js +595 -0
  312. package/dist/simulation/scenarios/latent-space/traversal-optimization.js.map +1 -0
  313. package/dist/simulation/scenarios/lean-agentic-swarm.d.ts +18 -0
  314. package/dist/simulation/scenarios/lean-agentic-swarm.d.ts.map +1 -0
  315. package/dist/simulation/scenarios/lean-agentic-swarm.js +132 -0
  316. package/dist/simulation/scenarios/lean-agentic-swarm.js.map +1 -0
  317. package/dist/simulation/scenarios/multi-agent-swarm.d.ts +17 -0
  318. package/dist/simulation/scenarios/multi-agent-swarm.d.ts.map +1 -0
  319. package/dist/simulation/scenarios/multi-agent-swarm.js +111 -0
  320. package/dist/simulation/scenarios/multi-agent-swarm.js.map +1 -0
  321. package/dist/simulation/scenarios/psycho-symbolic-reasoner.d.ts +23 -0
  322. package/dist/simulation/scenarios/psycho-symbolic-reasoner.d.ts.map +1 -0
  323. package/dist/simulation/scenarios/psycho-symbolic-reasoner.js +98 -0
  324. package/dist/simulation/scenarios/psycho-symbolic-reasoner.js.map +1 -0
  325. package/dist/simulation/scenarios/reflexion-learning.d.ts +16 -0
  326. package/dist/simulation/scenarios/reflexion-learning.d.ts.map +1 -0
  327. package/dist/simulation/scenarios/reflexion-learning.js +98 -0
  328. package/dist/simulation/scenarios/reflexion-learning.js.map +1 -0
  329. package/dist/simulation/scenarios/research-swarm.d.ts +24 -0
  330. package/dist/simulation/scenarios/research-swarm.d.ts.map +1 -0
  331. package/dist/simulation/scenarios/research-swarm.js +146 -0
  332. package/dist/simulation/scenarios/research-swarm.js.map +1 -0
  333. package/dist/simulation/scenarios/skill-evolution.d.ts +16 -0
  334. package/dist/simulation/scenarios/skill-evolution.d.ts.map +1 -0
  335. package/dist/simulation/scenarios/skill-evolution.js +109 -0
  336. package/dist/simulation/scenarios/skill-evolution.js.map +1 -0
  337. package/dist/simulation/scenarios/stock-market-emergence.d.ts +33 -0
  338. package/dist/simulation/scenarios/stock-market-emergence.d.ts.map +1 -0
  339. package/dist/simulation/scenarios/stock-market-emergence.js +246 -0
  340. package/dist/simulation/scenarios/stock-market-emergence.js.map +1 -0
  341. package/dist/simulation/scenarios/strange-loops.d.ts +18 -0
  342. package/dist/simulation/scenarios/strange-loops.d.ts.map +1 -0
  343. package/dist/simulation/scenarios/strange-loops.js +133 -0
  344. package/dist/simulation/scenarios/strange-loops.js.map +1 -0
  345. package/dist/simulation/scenarios/sublinear-solver.d.ts +22 -0
  346. package/dist/simulation/scenarios/sublinear-solver.d.ts.map +1 -0
  347. package/dist/simulation/scenarios/sublinear-solver.js +82 -0
  348. package/dist/simulation/scenarios/sublinear-solver.js.map +1 -0
  349. package/dist/simulation/scenarios/temporal-lead-solver.d.ts +23 -0
  350. package/dist/simulation/scenarios/temporal-lead-solver.d.ts.map +1 -0
  351. package/dist/simulation/scenarios/temporal-lead-solver.js +90 -0
  352. package/dist/simulation/scenarios/temporal-lead-solver.js.map +1 -0
  353. package/dist/simulation/scenarios/voting-system-consensus.d.ts +27 -0
  354. package/dist/simulation/scenarios/voting-system-consensus.d.ts.map +1 -0
  355. package/dist/simulation/scenarios/voting-system-consensus.js +175 -0
  356. package/dist/simulation/scenarios/voting-system-consensus.js.map +1 -0
  357. package/dist/simulation/types.d.ts +162 -0
  358. package/dist/simulation/types.d.ts.map +1 -0
  359. package/dist/simulation/types.js +5 -0
  360. package/dist/simulation/types.js.map +1 -0
  361. package/dist/simulation/utils/PerformanceOptimizer.d.ts +115 -0
  362. package/dist/simulation/utils/PerformanceOptimizer.d.ts.map +1 -0
  363. package/dist/simulation/utils/PerformanceOptimizer.js +223 -0
  364. package/dist/simulation/utils/PerformanceOptimizer.js.map +1 -0
  365. package/dist/src/backends/GraphBackend.d.ts +196 -0
  366. package/dist/src/backends/GraphBackend.d.ts.map +1 -0
  367. package/dist/src/backends/GraphBackend.js +33 -0
  368. package/dist/src/backends/GraphBackend.js.map +1 -0
  369. package/dist/src/backends/LearningBackend.d.ts +148 -0
  370. package/dist/src/backends/LearningBackend.d.ts.map +1 -0
  371. package/dist/src/backends/LearningBackend.js +27 -0
  372. package/dist/src/backends/LearningBackend.js.map +1 -0
  373. package/dist/src/backends/VectorBackend.d.ts +119 -0
  374. package/dist/src/backends/VectorBackend.d.ts.map +1 -0
  375. package/dist/src/backends/VectorBackend.js +14 -0
  376. package/dist/src/backends/VectorBackend.js.map +1 -0
  377. package/dist/src/backends/detector.d.ts +81 -0
  378. package/dist/src/backends/detector.d.ts.map +1 -0
  379. package/dist/src/backends/detector.js +192 -0
  380. package/dist/src/backends/detector.js.map +1 -0
  381. package/dist/src/backends/factory.d.ts +50 -0
  382. package/dist/src/backends/factory.d.ts.map +1 -0
  383. package/dist/src/backends/factory.js +161 -0
  384. package/dist/src/backends/factory.js.map +1 -0
  385. package/dist/src/backends/graph/GraphDatabaseAdapter.d.ts +151 -0
  386. package/dist/src/backends/graph/GraphDatabaseAdapter.d.ts.map +1 -0
  387. package/dist/src/backends/graph/GraphDatabaseAdapter.js +224 -0
  388. package/dist/src/backends/graph/GraphDatabaseAdapter.js.map +1 -0
  389. package/dist/src/backends/hnswlib/HNSWLibBackend.d.ts +92 -0
  390. package/dist/src/backends/hnswlib/HNSWLibBackend.d.ts.map +1 -0
  391. package/dist/src/backends/hnswlib/HNSWLibBackend.js +316 -0
  392. package/dist/src/backends/hnswlib/HNSWLibBackend.js.map +1 -0
  393. package/dist/src/backends/hnswlib/index.d.ts +7 -0
  394. package/dist/src/backends/hnswlib/index.d.ts.map +1 -0
  395. package/dist/src/backends/hnswlib/index.js +7 -0
  396. package/dist/src/backends/hnswlib/index.js.map +1 -0
  397. package/dist/src/backends/index.d.ts +14 -0
  398. package/dist/src/backends/index.d.ts.map +1 -0
  399. package/dist/src/backends/index.js +13 -0
  400. package/dist/src/backends/index.js.map +1 -0
  401. package/dist/src/backends/ruvector/RuVectorBackend.d.ts +75 -0
  402. package/dist/src/backends/ruvector/RuVectorBackend.d.ts.map +1 -0
  403. package/dist/src/backends/ruvector/RuVectorBackend.js +198 -0
  404. package/dist/src/backends/ruvector/RuVectorBackend.js.map +1 -0
  405. package/dist/src/backends/ruvector/RuVectorLearning.d.ts +104 -0
  406. package/dist/src/backends/ruvector/RuVectorLearning.d.ts.map +1 -0
  407. package/dist/src/backends/ruvector/RuVectorLearning.js +177 -0
  408. package/dist/src/backends/ruvector/RuVectorLearning.js.map +1 -0
  409. package/dist/src/backends/ruvector/index.d.ts +9 -0
  410. package/dist/src/backends/ruvector/index.d.ts.map +1 -0
  411. package/dist/src/backends/ruvector/index.js +8 -0
  412. package/dist/src/backends/ruvector/index.js.map +1 -0
  413. package/dist/src/benchmarks/wasm-vector-benchmark.d.ts +10 -0
  414. package/dist/src/benchmarks/wasm-vector-benchmark.d.ts.map +1 -0
  415. package/dist/src/benchmarks/wasm-vector-benchmark.js +196 -0
  416. package/dist/src/benchmarks/wasm-vector-benchmark.js.map +1 -0
  417. package/dist/src/browser/AdvancedFeatures.d.ts +144 -0
  418. package/dist/src/browser/AdvancedFeatures.d.ts.map +1 -0
  419. package/dist/src/browser/AdvancedFeatures.js +430 -0
  420. package/dist/src/browser/AdvancedFeatures.js.map +1 -0
  421. package/dist/src/browser/HNSWIndex.d.ts +117 -0
  422. package/dist/src/browser/HNSWIndex.d.ts.map +1 -0
  423. package/dist/src/browser/HNSWIndex.js +402 -0
  424. package/dist/src/browser/HNSWIndex.js.map +1 -0
  425. package/dist/src/browser/ProductQuantization.d.ts +107 -0
  426. package/dist/src/browser/ProductQuantization.d.ts.map +1 -0
  427. package/dist/src/browser/ProductQuantization.js +337 -0
  428. package/dist/src/browser/ProductQuantization.js.map +1 -0
  429. package/dist/src/browser/index.d.ts +223 -0
  430. package/dist/src/browser/index.d.ts.map +1 -0
  431. package/dist/src/browser/index.js +225 -0
  432. package/dist/src/browser/index.js.map +1 -0
  433. package/dist/src/cli/agentdb-cli.d.ts +154 -0
  434. package/dist/src/cli/agentdb-cli.d.ts.map +1 -0
  435. package/dist/src/cli/agentdb-cli.js +2273 -0
  436. package/dist/src/cli/agentdb-cli.js.map +1 -0
  437. package/dist/src/cli/commands/init.d.ts +12 -0
  438. package/dist/src/cli/commands/init.d.ts.map +1 -0
  439. package/dist/src/cli/commands/init.js +115 -0
  440. package/dist/src/cli/commands/init.js.map +1 -0
  441. package/dist/src/cli/commands/install-embeddings.d.ts +10 -0
  442. package/dist/src/cli/commands/install-embeddings.d.ts.map +1 -0
  443. package/dist/src/cli/commands/install-embeddings.js +68 -0
  444. package/dist/src/cli/commands/install-embeddings.js.map +1 -0
  445. package/dist/src/cli/commands/migrate.d.ts +15 -0
  446. package/dist/src/cli/commands/migrate.d.ts.map +1 -0
  447. package/dist/src/cli/commands/migrate.js +425 -0
  448. package/dist/src/cli/commands/migrate.js.map +1 -0
  449. package/dist/src/cli/commands/simulate-custom.d.ts +26 -0
  450. package/dist/src/cli/commands/simulate-custom.d.ts.map +1 -0
  451. package/dist/src/cli/commands/simulate-custom.js +207 -0
  452. package/dist/src/cli/commands/simulate-custom.js.map +1 -0
  453. package/dist/src/cli/commands/simulate-report.d.ts +15 -0
  454. package/dist/src/cli/commands/simulate-report.d.ts.map +1 -0
  455. package/dist/src/cli/commands/simulate-report.js +136 -0
  456. package/dist/src/cli/commands/simulate-report.js.map +1 -0
  457. package/dist/src/cli/commands/simulate-wizard.d.ts +6 -0
  458. package/dist/src/cli/commands/simulate-wizard.d.ts.map +1 -0
  459. package/dist/src/cli/commands/simulate-wizard.js +352 -0
  460. package/dist/src/cli/commands/simulate-wizard.js.map +1 -0
  461. package/dist/src/cli/commands/simulate.d.ts +7 -0
  462. package/dist/src/cli/commands/simulate.d.ts.map +1 -0
  463. package/dist/src/cli/commands/simulate.js +100 -0
  464. package/dist/src/cli/commands/simulate.js.map +1 -0
  465. package/dist/src/cli/commands/status.d.ts +10 -0
  466. package/dist/src/cli/commands/status.d.ts.map +1 -0
  467. package/dist/src/cli/commands/status.js +129 -0
  468. package/dist/src/cli/commands/status.js.map +1 -0
  469. package/dist/src/cli/lib/config-manager.d.ts +110 -0
  470. package/dist/src/cli/lib/config-manager.d.ts.map +1 -0
  471. package/dist/src/cli/lib/config-manager.js +512 -0
  472. package/dist/src/cli/lib/config-manager.js.map +1 -0
  473. package/dist/src/cli/lib/config-validator.d.ts +43 -0
  474. package/dist/src/cli/lib/config-validator.d.ts.map +1 -0
  475. package/dist/src/cli/lib/config-validator.js +217 -0
  476. package/dist/src/cli/lib/config-validator.js.map +1 -0
  477. package/dist/src/cli/lib/health-monitor.d.ts +149 -0
  478. package/dist/src/cli/lib/health-monitor.d.ts.map +1 -0
  479. package/dist/src/cli/lib/health-monitor.js +380 -0
  480. package/dist/src/cli/lib/health-monitor.js.map +1 -0
  481. package/dist/src/cli/lib/help-formatter.d.ts +38 -0
  482. package/dist/src/cli/lib/help-formatter.d.ts.map +1 -0
  483. package/dist/src/cli/lib/help-formatter.js +357 -0
  484. package/dist/src/cli/lib/help-formatter.js.map +1 -0
  485. package/dist/src/cli/lib/history-tracker.d.ts +103 -0
  486. package/dist/src/cli/lib/history-tracker.d.ts.map +1 -0
  487. package/dist/src/cli/lib/history-tracker.js +352 -0
  488. package/dist/src/cli/lib/history-tracker.js.map +1 -0
  489. package/dist/src/cli/lib/report-generator.d.ts +24 -0
  490. package/dist/src/cli/lib/report-generator.d.ts.map +1 -0
  491. package/dist/src/cli/lib/report-generator.js +417 -0
  492. package/dist/src/cli/lib/report-generator.js.map +1 -0
  493. package/dist/src/cli/lib/report-store.d.ts +116 -0
  494. package/dist/src/cli/lib/report-store.d.ts.map +1 -0
  495. package/dist/src/cli/lib/report-store.js +464 -0
  496. package/dist/src/cli/lib/report-store.js.map +1 -0
  497. package/dist/src/cli/lib/simulation-registry.d.ts +165 -0
  498. package/dist/src/cli/lib/simulation-registry.d.ts.map +1 -0
  499. package/dist/src/cli/lib/simulation-registry.js +332 -0
  500. package/dist/src/cli/lib/simulation-registry.js.map +1 -0
  501. package/dist/src/cli/lib/simulation-runner.d.ts +90 -0
  502. package/dist/src/cli/lib/simulation-runner.d.ts.map +1 -0
  503. package/dist/src/cli/lib/simulation-runner.js +211 -0
  504. package/dist/src/cli/lib/simulation-runner.js.map +1 -0
  505. package/dist/src/controllers/CausalMemoryGraph.d.ts +127 -0
  506. package/dist/src/controllers/CausalMemoryGraph.d.ts.map +1 -0
  507. package/dist/src/controllers/CausalMemoryGraph.js +354 -0
  508. package/dist/src/controllers/CausalMemoryGraph.js.map +1 -0
  509. package/dist/src/controllers/CausalRecall.d.ts +139 -0
  510. package/dist/src/controllers/CausalRecall.d.ts.map +1 -0
  511. package/dist/src/controllers/CausalRecall.js +356 -0
  512. package/dist/src/controllers/CausalRecall.js.map +1 -0
  513. package/dist/src/controllers/ContextSynthesizer.d.ts +65 -0
  514. package/dist/src/controllers/ContextSynthesizer.d.ts.map +1 -0
  515. package/dist/src/controllers/ContextSynthesizer.js +208 -0
  516. package/dist/src/controllers/ContextSynthesizer.js.map +1 -0
  517. package/dist/src/controllers/EmbeddingService.d.ts +37 -0
  518. package/dist/src/controllers/EmbeddingService.d.ts.map +1 -0
  519. package/dist/src/controllers/EmbeddingService.js +136 -0
  520. package/dist/src/controllers/EmbeddingService.js.map +1 -0
  521. package/dist/src/controllers/EnhancedEmbeddingService.d.ts +50 -0
  522. package/dist/src/controllers/EnhancedEmbeddingService.d.ts.map +1 -0
  523. package/dist/src/controllers/EnhancedEmbeddingService.js +119 -0
  524. package/dist/src/controllers/EnhancedEmbeddingService.js.map +1 -0
  525. package/dist/src/controllers/ExplainableRecall.d.ts +163 -0
  526. package/dist/src/controllers/ExplainableRecall.d.ts.map +1 -0
  527. package/dist/src/controllers/ExplainableRecall.js +485 -0
  528. package/dist/src/controllers/ExplainableRecall.js.map +1 -0
  529. package/dist/src/controllers/HNSWIndex.d.ts +128 -0
  530. package/dist/src/controllers/HNSWIndex.d.ts.map +1 -0
  531. package/dist/src/controllers/HNSWIndex.js +361 -0
  532. package/dist/src/controllers/HNSWIndex.js.map +1 -0
  533. package/dist/src/controllers/LearningSystem.d.ts +195 -0
  534. package/dist/src/controllers/LearningSystem.d.ts.map +1 -0
  535. package/dist/src/controllers/LearningSystem.js +929 -0
  536. package/dist/src/controllers/LearningSystem.js.map +1 -0
  537. package/dist/src/controllers/MMRDiversityRanker.d.ts +50 -0
  538. package/dist/src/controllers/MMRDiversityRanker.d.ts.map +1 -0
  539. package/dist/src/controllers/MMRDiversityRanker.js +130 -0
  540. package/dist/src/controllers/MMRDiversityRanker.js.map +1 -0
  541. package/dist/src/controllers/MetadataFilter.d.ts +70 -0
  542. package/dist/src/controllers/MetadataFilter.d.ts.map +1 -0
  543. package/dist/src/controllers/MetadataFilter.js +243 -0
  544. package/dist/src/controllers/MetadataFilter.js.map +1 -0
  545. package/dist/src/controllers/NightlyLearner.d.ts +114 -0
  546. package/dist/src/controllers/NightlyLearner.d.ts.map +1 -0
  547. package/dist/src/controllers/NightlyLearner.js +394 -0
  548. package/dist/src/controllers/NightlyLearner.js.map +1 -0
  549. package/dist/src/controllers/QUICClient.d.ts +109 -0
  550. package/dist/src/controllers/QUICClient.d.ts.map +1 -0
  551. package/dist/src/controllers/QUICClient.js +299 -0
  552. package/dist/src/controllers/QUICClient.js.map +1 -0
  553. package/dist/src/controllers/QUICServer.d.ts +121 -0
  554. package/dist/src/controllers/QUICServer.d.ts.map +1 -0
  555. package/dist/src/controllers/QUICServer.js +383 -0
  556. package/dist/src/controllers/QUICServer.js.map +1 -0
  557. package/dist/src/controllers/ReasoningBank.d.ts +196 -0
  558. package/dist/src/controllers/ReasoningBank.d.ts.map +1 -0
  559. package/dist/src/controllers/ReasoningBank.js +494 -0
  560. package/dist/src/controllers/ReasoningBank.js.map +1 -0
  561. package/dist/src/controllers/ReflexionMemory.d.ts +125 -0
  562. package/dist/src/controllers/ReflexionMemory.d.ts.map +1 -0
  563. package/dist/src/controllers/ReflexionMemory.js +654 -0
  564. package/dist/src/controllers/ReflexionMemory.js.map +1 -0
  565. package/dist/src/controllers/SkillLibrary.d.ts +150 -0
  566. package/dist/src/controllers/SkillLibrary.d.ts.map +1 -0
  567. package/dist/src/controllers/SkillLibrary.js +608 -0
  568. package/dist/src/controllers/SkillLibrary.js.map +1 -0
  569. package/dist/src/controllers/SyncCoordinator.d.ts +120 -0
  570. package/dist/src/controllers/SyncCoordinator.d.ts.map +1 -0
  571. package/dist/src/controllers/SyncCoordinator.js +441 -0
  572. package/dist/src/controllers/SyncCoordinator.js.map +1 -0
  573. package/dist/src/controllers/WASMVectorSearch.d.ts +89 -0
  574. package/dist/src/controllers/WASMVectorSearch.d.ts.map +1 -0
  575. package/dist/src/controllers/WASMVectorSearch.js +234 -0
  576. package/dist/src/controllers/WASMVectorSearch.js.map +1 -0
  577. package/dist/src/controllers/frontier-index.d.ts +14 -0
  578. package/dist/src/controllers/frontier-index.d.ts.map +1 -0
  579. package/dist/src/controllers/frontier-index.js +10 -0
  580. package/dist/src/controllers/frontier-index.js.map +1 -0
  581. package/dist/src/controllers/index.d.ts +30 -0
  582. package/dist/src/controllers/index.d.ts.map +1 -0
  583. package/dist/src/controllers/index.js +18 -0
  584. package/dist/src/controllers/index.js.map +1 -0
  585. package/dist/src/db-fallback.d.ts +26 -0
  586. package/dist/src/db-fallback.d.ts.map +1 -0
  587. package/dist/src/db-fallback.js +264 -0
  588. package/dist/src/db-fallback.js.map +1 -0
  589. package/dist/src/db-test.d.ts +13 -0
  590. package/dist/src/db-test.d.ts.map +1 -0
  591. package/dist/src/db-test.js +55 -0
  592. package/dist/src/db-test.js.map +1 -0
  593. package/dist/src/db-unified.d.ts +76 -0
  594. package/dist/src/db-unified.d.ts.map +1 -0
  595. package/dist/src/db-unified.js +279 -0
  596. package/dist/src/db-unified.js.map +1 -0
  597. package/dist/src/examples/quic-sync-example.d.ts +9 -0
  598. package/dist/src/examples/quic-sync-example.d.ts.map +1 -0
  599. package/dist/src/examples/quic-sync-example.js +169 -0
  600. package/dist/src/examples/quic-sync-example.js.map +1 -0
  601. package/dist/src/examples/wasm-vector-usage.d.ts +12 -0
  602. package/dist/src/examples/wasm-vector-usage.d.ts.map +1 -0
  603. package/dist/src/examples/wasm-vector-usage.js +190 -0
  604. package/dist/src/examples/wasm-vector-usage.js.map +1 -0
  605. package/dist/src/index.d.ts +28 -0
  606. package/dist/src/index.d.ts.map +1 -0
  607. package/dist/src/index.js +35 -0
  608. package/dist/src/index.js.map +1 -0
  609. package/dist/src/mcp/agentdb-mcp-server.d.ts +8 -0
  610. package/dist/src/mcp/agentdb-mcp-server.d.ts.map +1 -0
  611. package/dist/src/mcp/agentdb-mcp-server.js +2116 -0
  612. package/dist/src/mcp/agentdb-mcp-server.js.map +1 -0
  613. package/dist/src/mcp/learning-tools-handlers.d.ts +16 -0
  614. package/dist/src/mcp/learning-tools-handlers.d.ts.map +1 -0
  615. package/dist/src/mcp/learning-tools-handlers.js +105 -0
  616. package/dist/src/mcp/learning-tools-handlers.js.map +1 -0
  617. package/dist/src/optimizations/BatchOperations.d.ts +109 -0
  618. package/dist/src/optimizations/BatchOperations.d.ts.map +1 -0
  619. package/dist/src/optimizations/BatchOperations.js +407 -0
  620. package/dist/src/optimizations/BatchOperations.js.map +1 -0
  621. package/dist/src/optimizations/QueryOptimizer.d.ts +83 -0
  622. package/dist/src/optimizations/QueryOptimizer.d.ts.map +1 -0
  623. package/dist/src/optimizations/QueryOptimizer.js +228 -0
  624. package/dist/src/optimizations/QueryOptimizer.js.map +1 -0
  625. package/dist/src/optimizations/ToolCache.d.ts +137 -0
  626. package/dist/src/optimizations/ToolCache.d.ts.map +1 -0
  627. package/dist/src/optimizations/ToolCache.js +281 -0
  628. package/dist/src/optimizations/ToolCache.js.map +1 -0
  629. package/dist/src/optimizations/index.d.ts +10 -0
  630. package/dist/src/optimizations/index.d.ts.map +1 -0
  631. package/dist/src/optimizations/index.js +8 -0
  632. package/dist/src/optimizations/index.js.map +1 -0
  633. package/dist/src/security/input-validation.d.ts +109 -0
  634. package/dist/src/security/input-validation.d.ts.map +1 -0
  635. package/dist/src/security/input-validation.js +398 -0
  636. package/dist/src/security/input-validation.js.map +1 -0
  637. package/dist/src/security/limits.d.ts +150 -0
  638. package/dist/src/security/limits.d.ts.map +1 -0
  639. package/dist/src/security/limits.js +288 -0
  640. package/dist/src/security/limits.js.map +1 -0
  641. package/dist/src/security/path-security.d.ts +100 -0
  642. package/dist/src/security/path-security.d.ts.map +1 -0
  643. package/dist/src/security/path-security.js +337 -0
  644. package/dist/src/security/path-security.js.map +1 -0
  645. package/dist/src/security/validation.d.ts +95 -0
  646. package/dist/src/security/validation.d.ts.map +1 -0
  647. package/dist/src/security/validation.js +315 -0
  648. package/dist/src/security/validation.js.map +1 -0
  649. package/dist/src/services/LLMRouter.d.ts +84 -0
  650. package/dist/src/services/LLMRouter.d.ts.map +1 -0
  651. package/dist/src/services/LLMRouter.js +329 -0
  652. package/dist/src/services/LLMRouter.js.map +1 -0
  653. package/dist/src/types/quic.d.ts +518 -0
  654. package/dist/src/types/quic.d.ts.map +1 -0
  655. package/dist/src/types/quic.js +272 -0
  656. package/dist/src/types/quic.js.map +1 -0
  657. package/dist/src/utils/NodeIdMapper.d.ts +38 -0
  658. package/dist/src/utils/NodeIdMapper.d.ts.map +1 -0
  659. package/dist/src/utils/NodeIdMapper.js +57 -0
  660. package/dist/src/utils/NodeIdMapper.js.map +1 -0
  661. package/examples/README.md +105 -0
  662. package/examples/quickstart.js +43 -0
  663. package/package.json +17 -3
  664. package/scripts/README.md +314 -0
  665. package/simulation/.claude-flow/metrics/agent-metrics.json +1 -0
  666. package/simulation/.claude-flow/metrics/performance.json +87 -0
  667. package/simulation/.claude-flow/metrics/task-metrics.json +10 -0
  668. package/simulation/COMPLETION-STATUS.md +139 -0
  669. package/simulation/FINAL-RESULTS.md +414 -0
  670. package/simulation/FINAL-STATUS.md +281 -0
  671. package/simulation/INTEGRATION-COMPLETE.md +452 -0
  672. package/simulation/MIGRATION-STATUS.md +231 -0
  673. package/simulation/OPTIMIZATION-RESULTS.md +397 -0
  674. package/simulation/PHASE1-COMPLETE.md +163 -0
  675. package/simulation/README.md +848 -0
  676. package/simulation/SIMULATION-RESULTS.md +239 -0
  677. package/simulation/cli.ts +78 -0
  678. package/simulation/configs/default.json +37 -0
  679. package/simulation/data/advanced/aidefence.graph +0 -0
  680. package/simulation/data/advanced/bmssp.graph +0 -0
  681. package/simulation/data/advanced/consciousness.graph +0 -0
  682. package/simulation/data/advanced/goalie.graph +0 -0
  683. package/simulation/data/advanced/psycho-symbolic.graph +0 -0
  684. package/simulation/data/advanced/research-swarm.graph +0 -0
  685. package/simulation/data/advanced/sublinear.graph +0 -0
  686. package/simulation/data/advanced/temporal.graph +0 -0
  687. package/simulation/data/causal.graph +0 -0
  688. package/simulation/data/graph-traversal.graph +0 -0
  689. package/simulation/data/lean-agentic.graph +0 -0
  690. package/simulation/data/reflexion.graph +0 -0
  691. package/simulation/data/skills.graph +0 -0
  692. package/simulation/data/stock-market.graph +0 -0
  693. package/simulation/data/strange-loops.graph +0 -0
  694. package/simulation/data/swarm.graph +0 -0
  695. package/simulation/data/voting-consensus.graph +0 -0
  696. package/simulation/docs/CLI-INTEGRATION-PLAN.md +1038 -0
  697. package/simulation/docs/COMPREHENSIVE-LATENT-SPACE-COMPLETION.md +354 -0
  698. package/simulation/docs/DOCUMENTATION-INDEX.md +226 -0
  699. package/simulation/docs/IMPLEMENTATION-COMPLETE.md +521 -0
  700. package/simulation/docs/OPTIMIZATION-SUMMARY.md +279 -0
  701. package/simulation/docs/README.md +229 -0
  702. package/simulation/docs/SWARM-5-INTEGRATION-SUMMARY.md +528 -0
  703. package/simulation/docs/TESTING-SUMMARY.md +304 -0
  704. package/simulation/docs/architecture/EXTENSION-API.md +868 -0
  705. package/simulation/docs/architecture/INTEGRATION-ARCHITECTURE.md +1138 -0
  706. package/simulation/docs/architecture/OPTIMIZATION-STRATEGY.md +778 -0
  707. package/simulation/docs/architecture/SIMULATION-ARCHITECTURE.md +892 -0
  708. package/simulation/docs/guides/CLI-REFERENCE.md +896 -0
  709. package/simulation/docs/guides/CUSTOM-SIMULATIONS.md +931 -0
  710. package/simulation/docs/guides/DEPLOYMENT.md +832 -0
  711. package/simulation/docs/guides/IMPLEMENTATION-SUMMARY.md +544 -0
  712. package/simulation/docs/guides/MIGRATION-GUIDE.md +591 -0
  713. package/simulation/docs/guides/QUICK-START.md +361 -0
  714. package/simulation/docs/guides/README.md +736 -0
  715. package/simulation/docs/guides/TROUBLESHOOTING.md +817 -0
  716. package/simulation/docs/guides/WIZARD-GUIDE.md +869 -0
  717. package/simulation/docs/reports/latent-space/MASTER-SYNTHESIS.md +345 -0
  718. package/simulation/docs/reports/latent-space/README.md +132 -0
  719. package/simulation/docs/reports/latent-space/attention-analysis-RESULTS.md +238 -0
  720. package/simulation/docs/reports/latent-space/clustering-analysis-RESULTS.md +210 -0
  721. package/simulation/docs/reports/latent-space/hnsw-exploration-RESULTS.md +332 -0
  722. package/simulation/docs/reports/latent-space/hypergraph-exploration-RESULTS.md +37 -0
  723. package/simulation/docs/reports/latent-space/neural-augmentation-RESULTS.md +69 -0
  724. package/simulation/docs/reports/latent-space/quantum-hybrid-RESULTS.md +91 -0
  725. package/simulation/docs/reports/latent-space/self-organizing-hnsw-RESULTS.md +51 -0
  726. package/simulation/docs/reports/latent-space/traversal-optimization-RESULTS.md +238 -0
  727. package/simulation/reports/README.md +397 -0
  728. package/simulation/reports/advanced-simulations-performance.md +1241 -0
  729. package/simulation/reports/aidefence-integration-2025-11-30T01-36-53-486Z.json +30 -0
  730. package/simulation/reports/architecture-analysis.md +1396 -0
  731. package/simulation/reports/basic-scenarios-performance.md +1840 -0
  732. package/simulation/reports/bmssp-integration-2025-11-30T01-36-27-193Z.json +30 -0
  733. package/simulation/reports/bmssp-integration-2025-11-30T03-38-12-887Z.json +30 -0
  734. package/simulation/reports/causal-reasoning-2025-11-29T23-35-21-795Z.json +36 -0
  735. package/simulation/reports/causal-reasoning-2025-11-30T00-58-42-862Z.json +30 -0
  736. package/simulation/reports/causal-reasoning-2025-11-30T00-59-12-546Z.json +40 -0
  737. package/simulation/reports/consciousness-explorer-2025-11-30T01-36-51-269Z.json +31 -0
  738. package/simulation/reports/core-benchmarks.md +727 -0
  739. package/simulation/reports/goalie-integration-2025-11-30T01-36-52-377Z.json +30 -0
  740. package/simulation/reports/graph-traversal-2025-11-29T23-35-35-279Z.json +78 -0
  741. package/simulation/reports/graph-traversal-2025-11-29T23-37-36-697Z.json +30 -0
  742. package/simulation/reports/graph-traversal-2025-11-30T01-03-59-716Z.json +30 -0
  743. package/simulation/reports/graph-traversal-2025-11-30T01-05-10-984Z.json +30 -0
  744. package/simulation/reports/graph-traversal-2025-11-30T01-06-16-334Z.json +30 -0
  745. package/simulation/reports/graph-traversal-2025-11-30T01-06-53-312Z.json +30 -0
  746. package/simulation/reports/graph-traversal-2025-11-30T01-07-51-075Z.json +24 -0
  747. package/simulation/reports/graph-traversal-2025-11-30T01-08-22-179Z.json +42 -0
  748. package/simulation/reports/lean-agentic-swarm-2025-11-29T23-37-23-804Z.json +148 -0
  749. package/simulation/reports/lean-agentic-swarm-2025-11-30T01-31-24-401Z.json +31 -0
  750. package/simulation/reports/lean-agentic-swarm-2025-11-30T03-38-01-470Z.json +31 -0
  751. package/simulation/reports/multi-agent-swarm-2025-11-29T23-35-28-093Z.json +78 -0
  752. package/simulation/reports/multi-agent-swarm-2025-11-30T01-03-54-062Z.json +42 -0
  753. package/simulation/reports/multi-agent-swarm-2025-11-30T01-05-06-092Z.json +42 -0
  754. package/simulation/reports/psycho-symbolic-reasoner-2025-11-30T01-36-50-180Z.json +30 -0
  755. package/simulation/reports/quality-metrics.md +727 -0
  756. package/simulation/reports/reflexion-learning-2025-11-29T23-35-09-774Z.json +48 -0
  757. package/simulation/reports/reflexion-learning-2025-11-29T23-37-16-934Z.json +36 -0
  758. package/simulation/reports/reflexion-learning-2025-11-30T00-07-49-259Z.json +30 -0
  759. package/simulation/reports/reflexion-learning-2025-11-30T00-09-29-319Z.json +51 -0
  760. package/simulation/reports/reflexion-learning-2025-11-30T00-28-37-659Z.json +51 -0
  761. package/simulation/reports/reflexion-learning-2025-11-30T01-31-30-690Z.json +29 -0
  762. package/simulation/reports/reflexion-learning-2025-11-30T03-38-06-937Z.json +29 -0
  763. package/simulation/reports/research-foundations.md +2004 -0
  764. package/simulation/reports/research-swarm-2025-11-30T01-36-54-647Z.json +30 -0
  765. package/simulation/reports/scalability-deployment.md +2404 -0
  766. package/simulation/reports/skill-evolution-2025-11-29T23-35-15-945Z.json +36 -0
  767. package/simulation/reports/skill-evolution-2025-11-30T01-03-17-995Z.json +30 -0
  768. package/simulation/reports/skill-evolution-2025-11-30T01-03-48-441Z.json +30 -0
  769. package/simulation/reports/skill-evolution-2025-11-30T01-05-00-554Z.json +30 -0
  770. package/simulation/reports/skill-evolution-2025-11-30T01-06-11-436Z.json +30 -0
  771. package/simulation/reports/skill-evolution-2025-11-30T01-06-51-979Z.json +30 -0
  772. package/simulation/reports/skill-evolution-2025-11-30T01-07-32-695Z.json +40 -0
  773. package/simulation/reports/stock-market-emergence-2025-11-30T00-11-43-865Z.json +56 -0
  774. package/simulation/reports/stock-market-emergence-2025-11-30T00-28-57-495Z.json +56 -0
  775. package/simulation/reports/strange-loops-2025-11-29T23-37-30-621Z.json +78 -0
  776. package/simulation/reports/strange-loops-2025-11-30T00-07-55-415Z.json +30 -0
  777. package/simulation/reports/strange-loops-2025-11-30T00-09-35-133Z.json +30 -0
  778. package/simulation/reports/strange-loops-2025-11-30T00-48-50-744Z.json +24 -0
  779. package/simulation/reports/strange-loops-2025-11-30T00-54-48-044Z.json +24 -0
  780. package/simulation/reports/strange-loops-2025-11-30T00-57-27-633Z.json +24 -0
  781. package/simulation/reports/strange-loops-2025-11-30T00-57-59-135Z.json +42 -0
  782. package/simulation/reports/sublinear-solver-2025-11-30T01-36-33-134Z.json +30 -0
  783. package/simulation/reports/temporal-lead-solver-2025-11-30T01-36-38-628Z.json +30 -0
  784. package/simulation/reports/use-cases-applications.md +2212 -0
  785. package/simulation/reports/voting-system-consensus-2025-11-30T00-11-37-199Z.json +58 -0
  786. package/simulation/reports/voting-system-consensus-2025-11-30T00-28-47-735Z.json +58 -0
  787. package/simulation/runner.ts +300 -0
  788. package/simulation/scenarios/README-advanced/aidefence-integration.md +63 -0
  789. package/simulation/scenarios/README-advanced/bmssp-integration.md +58 -0
  790. package/simulation/scenarios/README-advanced/consciousness-explorer.md +53 -0
  791. package/simulation/scenarios/README-advanced/goalie-integration.md +61 -0
  792. package/simulation/scenarios/README-advanced/psycho-symbolic-reasoner.md +55 -0
  793. package/simulation/scenarios/README-advanced/research-swarm.md +63 -0
  794. package/simulation/scenarios/README-advanced/sublinear-solver.md +58 -0
  795. package/simulation/scenarios/README-advanced/temporal-lead-solver.md +55 -0
  796. package/simulation/scenarios/README-basic/causal-reasoning.md +39 -0
  797. package/simulation/scenarios/README-basic/graph-traversal.md +41 -0
  798. package/simulation/scenarios/README-basic/lean-agentic-swarm.md +122 -0
  799. package/simulation/scenarios/README-basic/multi-agent-swarm.md +34 -0
  800. package/simulation/scenarios/README-basic/reflexion-learning.md +41 -0
  801. package/simulation/scenarios/README-basic/skill-evolution.md +38 -0
  802. package/simulation/scenarios/README-basic/stock-market-emergence.md +28 -0
  803. package/simulation/scenarios/README-basic/strange-loops.md +36 -0
  804. package/simulation/scenarios/README-basic/voting-system-consensus.md +28 -0
  805. package/simulation/scenarios/README.md +438 -0
  806. package/simulation/scenarios/aidefence-integration.ts +165 -0
  807. package/simulation/scenarios/bmssp-integration.ts +137 -0
  808. package/simulation/scenarios/causal-reasoning.ts +143 -0
  809. package/simulation/scenarios/consciousness-explorer.ts +139 -0
  810. package/simulation/scenarios/domain-examples/.claude-flow/metrics/agent-metrics.json +1 -0
  811. package/simulation/scenarios/domain-examples/.claude-flow/metrics/performance.json +87 -0
  812. package/simulation/scenarios/domain-examples/.claude-flow/metrics/task-metrics.json +10 -0
  813. package/simulation/scenarios/domain-examples/README.md +525 -0
  814. package/simulation/scenarios/domain-examples/e-commerce-recommendations.ts +220 -0
  815. package/simulation/scenarios/domain-examples/index.ts +81 -0
  816. package/simulation/scenarios/domain-examples/iot-sensor-networks.ts +290 -0
  817. package/simulation/scenarios/domain-examples/medical-imaging.ts +181 -0
  818. package/simulation/scenarios/domain-examples/robotics-navigation.ts +214 -0
  819. package/simulation/scenarios/domain-examples/scientific-research.ts +250 -0
  820. package/simulation/scenarios/domain-examples/trading-systems.ts +138 -0
  821. package/simulation/scenarios/goalie-integration.ts +161 -0
  822. package/simulation/scenarios/graph-traversal.ts +129 -0
  823. package/simulation/scenarios/latent-space/OPTIMIZATION-COMPLETE.md +287 -0
  824. package/simulation/scenarios/latent-space/README-attention-analysis.md +170 -0
  825. package/simulation/scenarios/latent-space/README-clustering-analysis.md +239 -0
  826. package/simulation/scenarios/latent-space/README-hnsw-exploration.md +199 -0
  827. package/simulation/scenarios/latent-space/README-hypergraph-exploration.md +279 -0
  828. package/simulation/scenarios/latent-space/README-neural-augmentation.md +267 -0
  829. package/simulation/scenarios/latent-space/README-quantum-hybrid.md +276 -0
  830. package/simulation/scenarios/latent-space/README-self-organizing-hnsw.md +244 -0
  831. package/simulation/scenarios/latent-space/README-traversal-optimization.md +212 -0
  832. package/simulation/scenarios/latent-space/attention-analysis.ts +598 -0
  833. package/simulation/scenarios/latent-space/clustering-analysis.ts +796 -0
  834. package/simulation/scenarios/latent-space/hnsw-exploration.ts +526 -0
  835. package/simulation/scenarios/latent-space/hypergraph-exploration.ts +706 -0
  836. package/simulation/scenarios/latent-space/index.ts +47 -0
  837. package/simulation/scenarios/latent-space/neural-augmentation.ts +604 -0
  838. package/simulation/scenarios/latent-space/quantum-hybrid.ts +508 -0
  839. package/simulation/scenarios/latent-space/self-organizing-hnsw.ts +680 -0
  840. package/simulation/scenarios/latent-space/traversal-optimization.ts +782 -0
  841. package/simulation/scenarios/lean-agentic-swarm.ts +182 -0
  842. package/simulation/scenarios/multi-agent-swarm.ts +146 -0
  843. package/simulation/scenarios/psycho-symbolic-reasoner.ts +136 -0
  844. package/simulation/scenarios/reflexion-learning.ts +132 -0
  845. package/simulation/scenarios/research-swarm.ts +187 -0
  846. package/simulation/scenarios/skill-evolution.ts +135 -0
  847. package/simulation/scenarios/stock-market-emergence.ts +323 -0
  848. package/simulation/scenarios/strange-loops.ts +175 -0
  849. package/simulation/scenarios/sublinear-solver.ts +108 -0
  850. package/simulation/scenarios/temporal-lead-solver.ts +121 -0
  851. package/simulation/scenarios/voting-system-consensus.ts +251 -0
  852. package/simulation/tests/latent-space/attention-analysis.test.ts +204 -0
  853. package/simulation/tests/latent-space/clustering-analysis.test.ts +281 -0
  854. package/simulation/tests/latent-space/hnsw-exploration.test.ts +253 -0
  855. package/simulation/tests/latent-space/hypergraph-exploration.test.ts +295 -0
  856. package/simulation/tests/latent-space/neural-augmentation.test.ts +326 -0
  857. package/simulation/tests/latent-space/quantum-hybrid.test.ts +307 -0
  858. package/simulation/tests/latent-space/self-organizing-hnsw.test.ts +291 -0
  859. package/simulation/tests/latent-space/traversal-optimization.test.ts +261 -0
  860. package/simulation/types.ts +177 -0
  861. package/simulation/utils/PerformanceOptimizer.ts +269 -0
  862. package/src/backends/GraphBackend.ts +290 -0
  863. package/src/backends/LearningBackend.ts +210 -0
  864. package/src/backends/README.md +389 -0
  865. package/src/backends/VectorBackend.ts +145 -0
  866. package/src/backends/detector.ts +283 -0
  867. package/src/backends/factory.ts +193 -0
  868. package/src/backends/graph/GraphDatabaseAdapter.ts +334 -0
  869. package/src/backends/hnswlib/HNSWLibBackend.ts +413 -0
  870. package/src/backends/hnswlib/index.ts +7 -0
  871. package/src/backends/index.ts +32 -0
  872. package/src/backends/ruvector/RuVectorBackend.ts +232 -0
  873. package/src/backends/ruvector/RuVectorLearning.ts +242 -0
  874. package/src/backends/ruvector/index.ts +9 -0
  875. package/src/backends/ruvector/types.d.ts +64 -0
  876. package/src/browser/AdvancedFeatures.ts +565 -0
  877. package/src/browser/HNSWIndex.ts +494 -0
  878. package/src/browser/ProductQuantization.ts +419 -0
  879. package/src/browser/index.ts +301 -0
  880. package/src/cli/agentdb-cli.ts +131 -8
  881. package/src/cli/commands/init.ts +148 -0
  882. package/src/cli/commands/install-embeddings.ts +81 -0
  883. package/src/cli/commands/migrate.ts +545 -0
  884. package/src/cli/commands/simulate-custom.ts +232 -0
  885. package/src/cli/commands/simulate-report.ts +171 -0
  886. package/src/cli/commands/simulate-wizard.ts +379 -0
  887. package/src/cli/commands/simulate.ts +115 -0
  888. package/src/cli/commands/status.ts +156 -0
  889. package/src/cli/lib/config-manager.ts +627 -0
  890. package/src/cli/lib/config-validator.ts +261 -0
  891. package/src/cli/lib/health-monitor.ts +513 -0
  892. package/src/cli/lib/help-formatter.ts +406 -0
  893. package/src/cli/lib/history-tracker.ts +503 -0
  894. package/src/cli/lib/report-generator.ts +455 -0
  895. package/src/cli/lib/report-store.ts +582 -0
  896. package/src/cli/lib/simulation-registry.ts +502 -0
  897. package/src/cli/lib/simulation-runner.ts +291 -0
  898. package/src/cli/tests/agentdb-cli.test.ts +58 -0
  899. package/src/controllers/CausalMemoryGraph.ts +42 -2
  900. package/src/controllers/CausalRecall.ts +41 -4
  901. package/src/controllers/ExplainableRecall.ts +123 -5
  902. package/src/controllers/NightlyLearner.ts +8 -4
  903. package/src/controllers/ReasoningBank.ts +268 -5
  904. package/src/controllers/ReflexionMemory.ts +531 -6
  905. package/src/controllers/SkillLibrary.ts +234 -60
  906. package/src/db-fallback.ts +103 -35
  907. package/src/db-test.ts +59 -0
  908. package/src/db-unified.ts +327 -0
  909. package/src/mcp/agentdb-mcp-server.ts +544 -38
  910. package/src/optimizations/BatchOperations.ts +270 -0
  911. package/src/optimizations/ToolCache.ts +355 -0
  912. package/src/security/input-validation.ts +166 -0
  913. package/src/security/limits.ts +375 -0
  914. package/src/security/path-security.ts +436 -0
  915. package/src/security/validation.ts +556 -0
  916. package/src/services/LLMRouter.ts +406 -0
  917. package/src/types/xenova-transformers.d.ts +26 -0
  918. package/src/utils/NodeIdMapper.ts +64 -0
package/README.md CHANGED
@@ -1,516 +1,1264 @@
1
- # AgentDB
1
+ # AgentDB v2.0
2
2
 
3
- > **A sub-millisecond memory engine built for autonomous agents**
3
+ > **Intelligent vector database for AI agents โ€” learns from experience, optimizes itself, runs anywhere**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/agentdb.svg?style=flat-square)](https://www.npmjs.com/package/agentdb)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/agentdb.svg?style=flat-square)](https://www.npmjs.com/package/agentdb)
7
7
  [![License](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-green?style=flat-square)](LICENSE)
8
8
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/)
9
- [![Tests](https://img.shields.io/badge/tests-passing-brightgreen?style=flat-square)](test-docker/)
10
- [![MCP Compatible](https://img.shields.io/badge/MCP-29%20tools-blueviolet?style=flat-square)](docs/MCP_TOOLS.md)
9
+ [![Tests](https://img.shields.io/badge/tests-passing-brightgreen?style=flat-square)](tests/)
10
+ [![MCP Compatible](https://img.shields.io/badge/MCP-32%20tools-blueviolet?style=flat-square)](docs/MCP_TOOL_OPTIMIZATION_GUIDE.md)
11
+ [![CLI Commands](https://img.shields.io/badge/CLI-59%20commands-orange?style=flat-square)](docs/DEEP-REVIEW-V2-LATENT-SPACE.md)
12
+ [![Simulations](https://img.shields.io/badge/simulations-25%20scenarios-green?style=flat-square)](simulation/README.md)
11
13
 
12
- **AgentDB gives agents a real cognitive layer that boots in milliseconds, lives locally (disk or memory), and synchronizes globally when needed.** Zero ops. No latency overhead. Just instant recall, persistent learning, and real-time coordinationโ€”all inside the runtime of your agent.
14
+ AgentDB is the first vector database built specifically for autonomous AI agents. Unlike traditional databases that just store vectors, AgentDB **learns from every interaction**, **heals itself automatically**, and **gets smarter over time** โ€” all while being **150x faster** than cloud alternatives and running **anywhere** (Node.js, browsers, edge functions, even offline).
13
15
 
14
- When you're building agentic systems, every millisecond, every inference, and every decision matters. Traditional memory stores add remote calls, require orchestration, or force heavy infrastructure. **AgentDB flips that by putting the memory inside the agent workflowโ€”light, fast, and always ready.**
16
+ **What makes it special?** It combines six cognitive memory patterns (how humans learn), latent space simulations (empirically validated optimizations), and Graph Neural Networks (self-improving search) into a single, zero-config package that just works.
15
17
 
16
- ### What AgentDB delivers
18
+ **Perfect for:** LangChain agents, AutoGPT, Claude Code tools, custom AI assistants, RAG systems, or any application where AI needs to remember, learn, and improve.
17
19
 
18
- **Core Infrastructure:**
19
- - โšก **Instant startup** โ€“ Memory ready in milliseconds (optimized sql.js WASM)
20
- - ๐Ÿชถ **Minimal footprint** โ€“ Lightweight embedded database with zero config
21
- - ๐ŸŒ **Universal runtime** โ€“ Node.js, browser, edge, MCP โ€” runs anywhere
22
- - ๐Ÿ”„ **Coordination ready** โ€“ Architecture designed for distributed agent synchronization
20
+ ---
23
21
 
24
- **Frontier Memory (v1.1.0):**
25
- - ๐Ÿ”„ **Reflexion Memory** โ€“ Learn from experience with self-critique and episodic replay
26
- - ๐ŸŽ“ **Skill Library** โ€“ Auto-consolidate successful patterns into reusable skills
27
- - ๐Ÿ”— **Causal Memory** โ€“ Track `p(y|do(x))` not just `p(y|x)` โ€” intervention-based causality
28
- - ๐Ÿ“œ **Explainable Recall** โ€“ Provenance certificates with cryptographic Merkle proofs
29
- - ๐ŸŽฏ **Causal Recall** โ€“ Utility-based reranking: `U = ฮฑยทsimilarity + ฮฒยทuplift โˆ’ ฮณยทlatency`
30
- - ๐ŸŒ™ **Nightly Learner** โ€“ Automated causal discovery with doubly robust learning
22
+ > **๐Ÿ“ข v2.0 Alpha Available!** Early adopters can test the new features with `npm install agentdb@alpha`. Production users should continue using `npm install agentdb@latest` for the stable version. See [Publishing Guide](docs/PUBLISHING_GUIDE.md) for details.
31
23
 
32
- **Integration:**
33
- - ๐Ÿง  **ReasoningBank** โ€“ Pattern matching, experience curation, memory optimization
34
- - ๐Ÿค– **29 MCP Tools** โ€“ Zero-code setup for Claude Code, Cursor, and coding assistants (v1.3.0)
35
- - **5 Core Vector DB Tools**: init, insert, batch, search, delete
36
- - **5 Core AgentDB Tools** (NEW v1.3.0): database stats, pattern store/search, cache management
37
- - **9 Frontier Memory Tools**: reflexion, skills, causal memory, explainable recall
38
- - **10 Learning System Tools** (NEW v1.3.0): full RL pipeline with 9 algorithms
39
- - ๐Ÿ”Œ **10 RL Plugins** โ€“ Decision Transformer, Q-Learning, Federated Learning, and more
40
24
 
41
- Run anywhere: **Claude Code**, **Cursor**, **GitHub Copilot**, **Node.js**, **browsers**, **edge functions**, and **distributed agent networks**.
25
+ ## โšก Key Features
42
26
 
43
- ---
27
+ - **๐Ÿง  Six Cognitive Memory Patterns** โ€” Reflexion (self-critique), Skills (reusable code), Causal Memory (interventions), Explainable Recall (Merkle proofs), Utility Ranking, Nightly Learner
28
+ - **๐Ÿš€ 150x Faster Vector Search** โ€” RuVector Rust backend with SIMD (61ฮผs p50 latency, 8.2x faster than hnswlib)
29
+ - **๐ŸŽฎ 25 Latent Space Simulations** โ€” Empirically validated HNSW, GNN attention, self-healing, beam search (98.2% reproducibility)
30
+ - **๐Ÿ”„ 97.9% Self-Healing** โ€” Automatic degradation prevention using Model Predictive Control (30-day validation)
31
+ - **๐Ÿงฌ Graph Neural Networks** โ€” 8-head attention for adaptive query improvement (+12.4% recall, 3.8ms forward pass)
32
+ - **๐ŸŒ Runs Anywhere** โ€” Node.js, browsers, edge functions, MCP tools โ€” works offline with graceful degradation
33
+ - **โš™๏ธ Zero Configuration** โ€” `npm install agentdb` and go โ€” auto-selects optimal backend (RuVector โ†’ HNSWLib โ†’ better-sqlite3 โ†’ sql.js)
34
+ - **๐Ÿค– 32 MCP Tools + 59 CLI Commands** โ€” Full Claude Code integration, interactive simulation wizard, batch operations
35
+ - **๐Ÿ’พ Super-Linear Scaling** โ€” Performance improves with data size (4,536 patterns/sec @ 5k items)
36
+ - **๐Ÿ’ฐ $0 Cost** โ€” Fully local, no API keys, no cloud fees (vs $70+/mo for Pinecone)
44
37
 
45
- ## ๐Ÿ†• What's New in v1.6.0
38
+ ## ๐Ÿš€ Quick Start
46
39
 
47
- AgentDB v1.6.0 adds **Direct Vector Search**, **MMR Diversity Ranking**, **Context Synthesis**, and **Advanced Metadata Filtering** โ€” expanding memory capabilities with production-tested features. Building on v1.3.0's 29 MCP tools with enhanced vector operations and intelligent context generation.
40
+ Get started in 60 seconds:
48
41
 
49
- ### ๐ŸŽ‰ NEW: Learning System + Core AgentDB Tools (v1.3.0)
42
+ ```bash
43
+ # Install Alpha (v2.0 with all new features - for early adopters)
44
+ npm install agentdb@alpha
50
45
 
51
- **15 new MCP tools for reinforcement learning and advanced database management:**
46
+ # Or install Stable (current production version)
47
+ npm install agentdb@latest
52
48
 
53
- #### Learning System Tools (10 - NEW in v1.3.0)
49
+ # Use in your code
50
+ import { createDatabase, ReasoningBank, EmbeddingService } from 'agentdb';
54
51
 
55
- **Full reinforcement learning pipeline with 9 algorithms:**
56
- - **Session Management**: `learning_start_session`, `learning_end_session`
57
- - **Adaptive Intelligence**: `learning_predict`, `learning_feedback`, `learning_train`
58
- - **Analytics**: `learning_metrics`, `learning_explain`
59
- - **Advanced Features**: `learning_transfer`, `experience_record`, `reward_signal`
52
+ const db = await createDatabase('./agent-memory.db');
53
+ const embedder = new EmbeddingService({ model: 'Xenova/all-MiniLM-L6-v2' });
54
+ await embedder.initialize();
60
55
 
61
- **Supported RL Algorithms:** Q-Learning, SARSA, DQN, Policy Gradient, Actor-Critic, PPO, Decision Transformer, MCTS, Model-Based
56
+ const reasoningBank = new ReasoningBank(db, embedder);
62
57
 
63
- ```json
64
- {
65
- "name": "learning_start_session",
66
- "arguments": {
67
- "user_id": "agent-123",
68
- "session_type": "q-learning",
69
- "config": {
70
- "learning_rate": 0.01,
71
- "discount_factor": 0.99,
72
- "exploration_rate": 0.1
73
- }
74
- }
75
- }
58
+ // Store what your agent learned
59
+ await reasoningBank.storePattern({
60
+ taskType: 'code_review',
61
+ approach: 'Security-first analysis',
62
+ successRate: 0.95
63
+ });
64
+
65
+ // Find similar successful patterns later (32.6M ops/sec!)
66
+ const patterns = await reasoningBank.searchPatterns({
67
+ task: 'security code review',
68
+ k: 10
69
+ });
76
70
  ```
77
71
 
78
- #### Core AgentDB Tools (5 - NEW in v1.3.0)
72
+ **For Claude Code / MCP Integration** (zero-code setup):
73
+ ```bash
74
+ # Alpha version (v2.0 features)
75
+ claude mcp add agentdb npx agentdb@alpha mcp start
79
76
 
80
- **Advanced database management and reasoning patterns:**
81
- - `agentdb_stats` - Comprehensive database statistics with detailed metrics
82
- - `agentdb_pattern_store` - Store reasoning patterns with embeddings
83
- - `agentdb_pattern_search` - Search patterns with filters and similarity
84
- - `agentdb_pattern_stats` - Pattern analytics and top task types
85
- - `agentdb_clear_cache` - Cache management for optimal performance
77
+ # Or stable version
78
+ claude mcp add agentdb npx agentdb@latest mcp start
79
+ ```
86
80
 
87
- ```json
88
- {
89
- "name": "agentdb_pattern_store",
90
- "arguments": {
91
- "taskType": "code_review",
92
- "approach": "Security-first analysis followed by code quality",
93
- "successRate": 0.95
94
- }
95
- }
81
+ **Run latent space simulations** (validate 8.2x speedup):
82
+ ```bash
83
+ agentdb simulate hnsw --iterations 3 # HNSW optimization
84
+ agentdb simulate attention --iterations 3 # GNN attention (8-head)
85
+ agentdb simulate --wizard # Interactive configuration
96
86
  ```
97
87
 
98
- ### Previous: Core Vector DB Tools (v1.2.2)
88
+ See [๐Ÿ“– Complete Tutorial](#-tutorial) below for step-by-step examples.
99
89
 
100
- **5 MCP tools for complete vector database operations:**
90
+ ---
101
91
 
102
- #### `agentdb_init` - Initialize Database
103
- ```json
104
- {
105
- "name": "agentdb_init",
106
- "arguments": {
107
- "db_path": "./agentdb.db",
108
- "reset": false
109
- }
110
- }
92
+
93
+ ## ๐Ÿš€ What's New in v2.0
94
+
95
+ AgentDB v2.0 represents a fundamental shift from traditional vector databases to **intelligent, self-optimizing cognitive systems**. Through empirically validated latent space simulations (98.2% reproducibility across 24 iterations), we've discovered and implemented optimal configurations that make AgentDB not just faster, but **genuinely intelligent** โ€” learning from experience, healing itself automatically, and improving over time without human intervention.
96
+
97
+ **Performance Breakthroughs:**
98
+ - 150x faster vector search (RuVector Rust backend, 61ฮผs p50 latency)
99
+ - 8.2x faster than hnswlib (empirically validated through latent space simulations)
100
+ - 173x faster migration (v1.x โ†’ v2.0, 48ms vs 8.3s for 10K vectors)
101
+ - Super-linear scaling (performance improves with data size)
102
+
103
+ **Intelligence & Learning:**
104
+ - Graph Neural Networks with 8-head attention (+12.4% recall improvement)
105
+ - 97.9% self-healing (MPC adaptation, 30-day validation)
106
+ - ReasoningBank pattern matching (36% adaptive learning improvement)
107
+ - Neural augmentation pipeline (+29.4% total improvement)
108
+
109
+ **Developer Experience:**
110
+ - 25 latent space simulations (98.2% reproducibility across 24 iterations)
111
+ - 32 MCP tools + 59 CLI commands (including interactive wizard)
112
+ - Batch operations (3-4x faster bulk inserts)
113
+ - Zero regressions (100% backward compatibility)
114
+
115
+ ### ๐Ÿ”ฌ Performance Highlights
116
+
117
+ **Why this matters:** Unlike synthetic benchmarks that test artificial workloads, these are **real-world performance metrics** from production-representative scenarios. Every number below was validated through multiple iterations and represents actual performance your agents will experience โ€” not theoretical maximums.
118
+
119
+ **Core Operations:**
120
+ - Pattern search: **32.6M ops/sec** (ultra-fast with caching)
121
+ - Pattern storage: **388K ops/sec** (excellent)
122
+ - Batch operations: **3-4x faster** (5,556-7,692 ops/sec)
123
+ - Super-linear scaling: **4,536 patterns/sec** @ 5k items
124
+
125
+ **Latent Space Validation** (25 scenarios, 98.2% reproducibility):
126
+
127
+ *These simulations empirically validate every optimization in AgentDB v2.0. Instead of guessing optimal configurations, we systematically explored the latent space of possible designs, running 24 iterations per scenario to discover what actually works best. The results aren't just faster โ€” they're **provably optimal** for real-world agent workloads.*
128
+ - **HNSW**: 61ฮผs p50 latency, 96.8% recall@10, 8.2x faster than hnswlib
129
+ - **GNN Attention**: +12.4% recall, 3.8ms forward pass, 91% transferability
130
+ - **Self-Healing**: 97.9% degradation prevention, <100ms automatic repair
131
+ - **Neural Augmentation**: +29.4% total improvement, -32% memory, -52% hops
132
+
133
+ See [OPTIMIZATION-REPORT.md](OPTIMIZATION-REPORT.md) for detailed benchmarks and [simulation/README.md](simulation/README.md) for all 25 simulation scenarios.
134
+
135
+ ---
136
+
137
+ ## ๐Ÿ“– Tutorial
138
+
139
+ **Learn by doing:** These examples show real-world use cases where AgentDB's cognitive memory patterns make agents genuinely intelligent. Each example is production-ready code you can adapt for your own applications.
140
+
141
+ ### Example 1: Build a Learning Code Review Agent
142
+
143
+ ```typescript
144
+ import { createDatabase, ReasoningBank, ReflexionMemory, EmbeddingService } from 'agentdb';
145
+
146
+ // Setup
147
+ const db = await createDatabase('./code-reviewer.db');
148
+ const embedder = new EmbeddingService({ model: 'Xenova/all-MiniLM-L6-v2' });
149
+ await embedder.initialize();
150
+
151
+ const reasoningBank = new ReasoningBank(db, embedder);
152
+ const reflexion = new ReflexionMemory(db, embedder);
153
+
154
+ // 1. Store successful review patterns
155
+ await reasoningBank.storePattern({
156
+ taskType: 'code_review',
157
+ approach: 'Security scan โ†’ Type safety โ†’ Code quality โ†’ Performance',
158
+ successRate: 0.94,
159
+ tags: ['security', 'typescript']
160
+ });
161
+
162
+ // 2. Review code and learn from it
163
+ const reviewResult = await performCodeReview(codeToReview);
164
+
165
+ await reflexion.storeEpisode({
166
+ sessionId: 'review-session-1',
167
+ task: 'Review authentication PR',
168
+ reward: reviewResult.issuesFound > 0 ? 0.9 : 0.6,
169
+ success: true,
170
+ critique: 'Found SQL injection vulnerability - security checks work!',
171
+ input: codeToReview,
172
+ output: reviewResult.findings,
173
+ latencyMs: reviewResult.timeMs,
174
+ tokensUsed: reviewResult.tokensUsed
175
+ });
176
+
177
+ // 3. Next time, find similar successful reviews (32.6M ops/sec!)
178
+ const similarReviews = await reflexion.retrieveRelevant({
179
+ task: 'authentication code review',
180
+ k: 5,
181
+ onlySuccesses: true
182
+ });
183
+
184
+ console.log(`Found ${similarReviews.length} successful reviews to learn from`);
185
+ console.log(`Best approach: ${similarReviews[0].critique}`);
111
186
  ```
112
187
 
113
- #### `agentdb_insert` - Insert Single Vector
114
- ```json
115
- {
116
- "name": "agentdb_insert",
117
- "arguments": {
118
- "text": "Implement OAuth2 authentication with PKCE flow",
119
- "tags": ["auth", "security"],
120
- "metadata": {"priority": "high"}
121
- }
122
- }
188
+ ### Example 2: RAG System with Self-Learning
189
+
190
+ ```typescript
191
+ import { createDatabase, ReasoningBank, SkillLibrary, EmbeddingService } from 'agentdb';
192
+
193
+ const db = await createDatabase('./rag-system.db');
194
+ const embedder = new EmbeddingService({ model: 'Xenova/all-MiniLM-L6-v2' });
195
+ await embedder.initialize();
196
+
197
+ const reasoningBank = new ReasoningBank(db, embedder);
198
+ const skills = new SkillLibrary(db, embedder);
199
+
200
+ // Store document retrieval patterns
201
+ await reasoningBank.storePattern({
202
+ taskType: 'document_retrieval',
203
+ approach: 'Expand query with synonyms โ†’ Semantic search โ†’ Re-rank by relevance',
204
+ successRate: 0.88,
205
+ tags: ['rag', 'retrieval']
206
+ });
207
+
208
+ // Create reusable query expansion skill
209
+ await skills.createSkill({
210
+ name: 'expand_query',
211
+ description: 'Expand user query with domain-specific synonyms',
212
+ signature: { inputs: { query: 'string' }, outputs: { expanded: 'string[]' } },
213
+ code: `
214
+ const synonymMap = { 'bug': ['issue', 'defect', 'error'], ... };
215
+ return query.split(' ').flatMap(word => synonymMap[word] || [word]);
216
+ `,
217
+ successRate: 0.92
218
+ });
219
+
220
+ // Search for retrieval patterns (learns which work best)
221
+ const patterns = await reasoningBank.searchPatterns({
222
+ task: 'find technical documentation',
223
+ k: 10
224
+ });
225
+
226
+ // Apply best pattern
227
+ const bestPattern = patterns[0];
228
+ console.log(`Using approach: ${bestPattern.approach}`);
123
229
  ```
124
230
 
125
- #### `agentdb_insert_batch` - Batch Insert (141x Faster)
126
- ```json
127
- {
128
- "name": "agentdb_insert_batch",
129
- "arguments": {
130
- "items": [
131
- {"text": "Vector 1", "tags": ["tag1"]},
132
- {"text": "Vector 2", "tags": ["tag2"]}
133
- ],
134
- "batch_size": 100
135
- }
136
- }
231
+ ### Example 3: Run Latent Space Simulations
232
+
233
+ Validate AgentDB's optimizations through empirical simulations:
234
+
235
+ ```bash
236
+ # Test HNSW graph optimization (validates 8.2x speedup)
237
+ agentdb simulate hnsw --iterations 3
238
+ # Output: โœ… 61ฮผs p50 latency, 96.8% recall@10, M=32 optimal
239
+
240
+ # Test 8-head GNN attention mechanism
241
+ agentdb simulate attention --iterations 3
242
+ # Output: โœ… +12.4% recall improvement, 3.8ms forward pass
243
+
244
+ # Test 30-day self-healing with MPC adaptation
245
+ agentdb simulate self-organizing --days 30
246
+ # Output: โœ… 97.9% degradation prevention, <100ms healing
247
+
248
+ # Interactive wizard for custom simulations
249
+ agentdb simulate --wizard
250
+ # Guides you through 6-step configuration with 25+ components
137
251
  ```
138
252
 
139
- #### `agentdb_search` - Semantic Search with Filters
140
- ```json
141
- {
142
- "name": "agentdb_search",
143
- "arguments": {
144
- "query": "How to implement JWT authentication?",
145
- "k": 10,
146
- "min_similarity": 0.7,
147
- "filters": {"tags": ["auth"]}
148
- }
149
- }
253
+ See [simulation/README.md](simulation/README.md) for 25 available scenarios and complete documentation.
254
+
255
+ ### Example 4: MCP Integration (Claude Code)
256
+
257
+ Zero-code integration with AI coding assistants:
258
+
259
+ ```bash
260
+ # One-command setup
261
+ claude mcp add agentdb npx agentdb@latest mcp start
262
+
263
+ # Now Claude Code can:
264
+ # - Store reasoning patterns automatically
265
+ # - Search 32.6M patterns/sec for relevant approaches
266
+ # - Learn from successful task completions
267
+ # - Build reusable skills over time
268
+ # - Run latent space simulations
150
269
  ```
151
270
 
152
- #### `agentdb_delete` - Delete Vectors
271
+ **Manual setup** (add to `~/.config/claude/claude_desktop_config.json`):
153
272
  ```json
154
273
  {
155
- "name": "agentdb_delete",
156
- "arguments": {
157
- "filters": {
158
- "session_id": "old-session",
159
- "before_timestamp": 1640000000
274
+ "mcpServers": {
275
+ "agentdb": {
276
+ "command": "npx",
277
+ "args": ["agentdb@latest", "mcp", "start"],
278
+ "env": { "AGENTDB_PATH": "./agentdb.db" }
160
279
  }
161
280
  }
162
281
  }
163
282
  ```
164
283
 
165
- **Migration:**
166
- - [MIGRATION_v1.3.0.md](MIGRATION_v1.3.0.md) - Upgrade from v1.2.2 โ†’ v1.3.0
167
- - [MIGRATION_v1.2.2.md](docs/MIGRATION_v1.2.2.md) - Upgrade from v1.2.1 โ†’ v1.2.2
284
+ ### Advanced Usage
285
+
286
+ ```typescript
287
+ import {
288
+ createDatabase,
289
+ ReasoningBank,
290
+ ReflexionMemory,
291
+ SkillLibrary,
292
+ EmbeddingService,
293
+ BatchOperations
294
+ } from 'agentdb';
295
+
296
+ // Initialize database
297
+ const db = await createDatabase('./agent-memory.db');
298
+
299
+ // Initialize embedding service
300
+ const embedder = new EmbeddingService({
301
+ model: 'Xenova/all-MiniLM-L6-v2',
302
+ dimension: 384,
303
+ provider: 'transformers'
304
+ });
305
+ await embedder.initialize();
306
+
307
+ // ReasoningBank - Pattern learning and adaptive memory
308
+ const reasoningBank = new ReasoningBank(db, embedder);
309
+
310
+ // Store reasoning pattern (388K ops/sec)
311
+ const patternId = await reasoningBank.storePattern({
312
+ taskType: 'code_review',
313
+ approach: 'Security-first analysis followed by code quality checks',
314
+ successRate: 0.95,
315
+ tags: ['security', 'code-quality'],
316
+ metadata: { language: 'typescript' }
317
+ });
318
+
319
+ // Search patterns (32.6M ops/sec - ultra-fast)
320
+ const patterns = await reasoningBank.searchPatterns({
321
+ task: 'security code review',
322
+ k: 10,
323
+ threshold: 0.7,
324
+ filters: { taskType: 'code_review' }
325
+ });
326
+
327
+ // Reflexion Memory - Learn from experience
328
+ const reflexion = new ReflexionMemory(db, embedder);
329
+
330
+ // Store episode with self-critique
331
+ const episodeId = await reflexion.storeEpisode({
332
+ sessionId: 'session-1',
333
+ task: 'Implement OAuth2 authentication',
334
+ reward: 0.95,
335
+ success: true,
336
+ critique: 'PKCE flow provided better security than basic flow',
337
+ input: 'Authentication requirements',
338
+ output: 'Working OAuth2 implementation',
339
+ latencyMs: 1200,
340
+ tokensUsed: 500
341
+ });
342
+
343
+ // Retrieve similar episodes (957 ops/sec)
344
+ const episodes = await reflexion.retrieveRelevant({
345
+ task: 'authentication implementation',
346
+ k: 5,
347
+ onlySuccesses: true
348
+ });
349
+
350
+ // Skill Library - Lifelong learning
351
+ const skills = new SkillLibrary(db, embedder);
352
+
353
+ // Create reusable skill
354
+ const skillId = await skills.createSkill({
355
+ name: 'jwt_authentication',
356
+ description: 'Generate and validate JWT tokens',
357
+ signature: { inputs: { userId: 'string' }, outputs: { token: 'string' } },
358
+ code: 'implementation code here...',
359
+ successRate: 0.92,
360
+ uses: 0,
361
+ avgReward: 0.0,
362
+ avgLatencyMs: 0.0
363
+ });
364
+
365
+ // Search for applicable skills (694 ops/sec)
366
+ const applicableSkills = await skills.searchSkills({
367
+ task: 'user authentication',
368
+ k: 10,
369
+ minSuccessRate: 0.7
370
+ });
371
+
372
+ // Batch Operations - 3-4x faster (NEW v2.0)
373
+ const batchOps = new BatchOperations(db, embedder, {
374
+ batchSize: 100,
375
+ parallelism: 4
376
+ });
377
+
378
+ // Batch create skills (1,539 โ†’ 5,556 ops/sec - 3.6x faster)
379
+ const skillIds = await batchOps.insertSkills([
380
+ { name: 'skill-1', description: 'First skill', successRate: 0.8 },
381
+ { name: 'skill-2', description: 'Second skill', successRate: 0.9 },
382
+ // ... up to 100 skills
383
+ ]);
384
+
385
+ // Batch store episodes (2,273 โ†’ 7,692 ops/sec - 3.4x faster)
386
+ const episodeIds = await batchOps.insertEpisodes([
387
+ { sessionId: 'session-1', task: 'debug-1', reward: 0.85, success: true },
388
+ { sessionId: 'session-2', task: 'optimize-1', reward: 0.90, success: true },
389
+ // ... up to 100 episodes
390
+ ]);
391
+
392
+ // Prune old data (NEW v2.0)
393
+ const pruneResults = await batchOps.pruneData({
394
+ maxAge: 90, // Keep data from last 90 days
395
+ minReward: 0.3, // Keep episodes with reward >= 0.3
396
+ minSuccessRate: 0.5, // Keep skills/patterns with >= 50% success
397
+ maxRecords: 100000, // Max 100k records per table
398
+ dryRun: false // Actually delete (use true to preview)
399
+ });
400
+
401
+ console.log(`Pruned ${pruneResults.episodesPruned} episodes`);
402
+ console.log(`Saved ${pruneResults.spaceSaved} bytes`);
403
+ ```
168
404
 
169
405
  ---
170
406
 
171
- ## ๐Ÿง  Frontier Memory Features (v1.1.0+)
407
+ ## ๐Ÿง  Frontier Memory Features
408
+
409
+ ### 1. ๐Ÿ”„ ReasoningBank โ€” Pattern Learning & Adaptive Memory
410
+
411
+ **The cognitive layer that makes agents smarter over time**
412
+
413
+ Store successful reasoning patterns and retrieve them using semantic similarity. ReasoningBank learns which approaches work best for different types of tasks.
414
+
415
+ ```typescript
416
+ // Store a pattern
417
+ await reasoningBank.storePattern({
418
+ taskType: 'bug_investigation',
419
+ approach: 'Check logs โ†’ Reproduce issue โ†’ Binary search for root cause',
420
+ successRate: 0.92,
421
+ tags: ['debugging', 'systematic'],
422
+ metadata: { avgTimeMs: 3000 }
423
+ });
424
+
425
+ // Search patterns (32.6M ops/sec - ultra-fast)
426
+ const patterns = await reasoningBank.searchPatterns({
427
+ task: 'debug memory leak',
428
+ k: 10,
429
+ threshold: 0.7,
430
+ filters: { taskType: 'bug_investigation' }
431
+ });
432
+
433
+ // Get pattern statistics
434
+ const stats = reasoningBank.getPatternStats();
435
+ console.log(`Total patterns: ${stats.totalPatterns}`);
436
+ console.log(`Avg success rate: ${stats.avgSuccessRate}`);
437
+ ```
438
+
439
+ **Performance:**
440
+ - Pattern storage: 388K ops/sec
441
+ - Pattern search: 32.6M ops/sec (ultra-fast with caching)
442
+ - Super-linear scaling: 4,536 patterns/sec @ 5k items
443
+
444
+ **Use Cases:**
445
+ - Learn debugging strategies that work
446
+ - Discover code patterns that prevent bugs
447
+ - Build institutional knowledge automatically
172
448
 
173
- Advanced memory patterns that go beyond simple vector storage to enable true cognitive capabilities:
449
+ ### 2. ๐Ÿ”„ Reflexion Memory โ€” Learn from Experience
174
450
 
175
- ### 1. ๐Ÿ”„ Reflexion Memory (Episodic Replay)
176
- **Learn from experience with self-critique**
451
+ **Episodic replay with self-critique for continuous improvement**
177
452
 
178
- Store complete task episodes with self-generated critiques, then replay them to improve future performance.
453
+ Store complete task episodes with self-generated critiques, then replay them to improve future performance. Based on the Reflexion paper (Shinn et al., 2023).
454
+
455
+ ```typescript
456
+ // Store episode with self-critique
457
+ const episodeId = await reflexion.storeEpisode({
458
+ sessionId: 'debug-session-1',
459
+ task: 'Fix authentication bug',
460
+ reward: 0.95,
461
+ success: true,
462
+ critique: 'OAuth2 PKCE flow was more secure than basic flow. Should always check token expiration.',
463
+ input: 'Users can\'t log in',
464
+ output: 'Working OAuth2 implementation with refresh tokens',
465
+ latencyMs: 1200,
466
+ tokensUsed: 500
467
+ });
468
+
469
+ // Retrieve similar episodes (957 ops/sec)
470
+ const similar = await reflexion.retrieveRelevant({
471
+ task: 'authentication issues',
472
+ k: 10,
473
+ onlySuccesses: true, // Learn from what worked
474
+ minReward: 0.7
475
+ });
476
+
477
+ // Get task-specific statistics
478
+ const stats = await reflexion.getTaskStats('debug-session-1');
479
+ console.log(`Success rate: ${stats.successRate}`);
480
+ console.log(`Avg reward: ${stats.avgReward}`);
481
+ ```
179
482
 
483
+ **Benefits:**
484
+ - Learn from successes and failures
485
+ - Build expertise over time
486
+ - Avoid repeating mistakes
487
+ - Self-improvement through critique
488
+
489
+ **CLI:**
180
490
  ```bash
181
- # Store episode with self-critique
491
+ # Store episode
182
492
  agentdb reflexion store "session-1" "fix_auth_bug" 0.95 true \
183
- "OAuth2 flow worked perfectly" "login failing" "fixed tokens" 1200 500
493
+ "OAuth2 PKCE worked perfectly" "login failing" "fixed tokens" 1200 500
184
494
 
185
- # Retrieve similar episodes
495
+ # Retrieve similar
186
496
  agentdb reflexion retrieve "authentication issues" 10 0.8
187
497
 
188
498
  # Get critique summary
189
499
  agentdb reflexion critique "fix_auth_bug" 10 0.5
190
-
191
- # Prune old episodes
192
- agentdb reflexion prune 90 0.5
193
500
  ```
194
501
 
195
- **Benefits:** Learn from successes and failures ยท Build expertise over time ยท Avoid repeating mistakes
502
+ ### 3. ๐ŸŽ“ Skill Library โ€” Lifelong Learning
503
+
504
+ **Transform successful patterns into reusable, composable skills**
196
505
 
197
- ### 2. ๐ŸŽ“ Skill Library (Lifelong Learning)
198
- **Consolidate successful patterns into reusable skills**
506
+ Automatically consolidate repeated successful task executions into parameterized skills that can be composed and reused.
507
+
508
+ ```typescript
509
+ // Create skill manually
510
+ const skillId = await skills.createSkill({
511
+ name: 'jwt_authentication',
512
+ description: 'Generate and validate JWT tokens with refresh flow',
513
+ signature: {
514
+ inputs: { userId: 'string', permissions: 'array' },
515
+ outputs: { accessToken: 'string', refreshToken: 'string' }
516
+ },
517
+ code: 'implementation code...',
518
+ successRate: 0.92
519
+ });
520
+
521
+ // Search for applicable skills (694 ops/sec)
522
+ const applicable = await skills.searchSkills({
523
+ task: 'user authentication with tokens',
524
+ k: 5,
525
+ minSuccessRate: 0.7
526
+ });
527
+
528
+ // Auto-consolidate from successful episodes
529
+ const consolidated = await skills.consolidateFromEpisodes({
530
+ minAttempts: 3, // Need 3+ successful executions
531
+ minSuccessRate: 0.7, // With 70%+ success rate
532
+ lookbackDays: 7 // In the last 7 days
533
+ });
534
+
535
+ // Update skill after use
536
+ await skills.updateSkillStats(skillId, {
537
+ uses: 1,
538
+ successRate: 0.95,
539
+ success: true,
540
+ latencyMs: 1200
541
+ });
542
+ ```
199
543
 
200
- Transform repeated successful task executions into parameterized skills that can be composed and reused.
544
+ **Features:**
545
+ - Automatic skill extraction from episodes
546
+ - Semantic search for skill discovery
547
+ - Usage tracking and success rate monitoring
548
+ - Skill composition and chaining
201
549
 
550
+ **CLI:**
202
551
  ```bash
203
- # Create a reusable skill
552
+ # Create skill
204
553
  agentdb skill create "jwt_auth" "Generate JWT tokens" \
205
- '{"inputs": {"user": "object"}}' "implementation code..." 1
554
+ '{"inputs": {"user": "object"}}' "code..." 1
206
555
 
207
- # Search for applicable skills
556
+ # Search skills
208
557
  agentdb skill search "authentication" 5 0.5
209
558
 
210
- # Auto-consolidate from successful episodes
559
+ # Auto-consolidate from episodes
211
560
  agentdb skill consolidate 3 0.7 7
212
561
 
213
- # Update skill statistics
562
+ # Update skill stats
214
563
  agentdb skill update 1 1 0.95 true 1200
564
+ ```
565
+
566
+ ### 4. ๐Ÿ”— Causal Memory Graph โ€” Intervention-Based Causality
215
567
 
216
- # Prune underperforming skills
217
- agentdb skill prune 3 0.4 60
568
+ **Learn what interventions cause what outcomes, not just correlations**
569
+
570
+ Track `p(y|do(x))` using doubly robust estimation and instrumental variables. Understand which actions lead to which results.
571
+
572
+ ```typescript
573
+ import { CausalMemoryGraph } from 'agentdb/controllers/CausalMemoryGraph';
574
+
575
+ const causalGraph = new CausalMemoryGraph(db);
576
+
577
+ // Create causal experiment (A/B test)
578
+ const experimentId = causalGraph.createExperiment({
579
+ name: 'test_error_handling_approach',
580
+ hypothesis: 'Try-catch reduces crash rate',
581
+ treatmentId: 123, // Episode ID with error handling
582
+ treatmentType: 'episode',
583
+ controlId: 124, // Episode ID without
584
+ startTime: Date.now(),
585
+ sampleSize: 0,
586
+ status: 'running'
587
+ });
588
+
589
+ // Record observations
590
+ causalGraph.recordObservation({
591
+ experimentId,
592
+ episodeId: 123,
593
+ isTreatment: true,
594
+ outcomeValue: 0.95, // Success rate
595
+ outcomeType: 'success'
596
+ });
597
+
598
+ // Calculate causal uplift
599
+ const { uplift, pValue, confidenceInterval } =
600
+ causalGraph.calculateUplift(experimentId);
601
+
602
+ console.log(`Causal uplift: ${uplift}`);
603
+ console.log(`p-value: ${pValue}`);
604
+ console.log(`95% CI: [${confidenceInterval[0]}, ${confidenceInterval[1]}]`);
605
+
606
+ // Add causal edge
607
+ const edgeId = causalGraph.addCausalEdge({
608
+ fromMemoryId: 123,
609
+ fromMemoryType: 'episode',
610
+ toMemoryId: 125,
611
+ toMemoryType: 'episode',
612
+ similarity: 0.85,
613
+ uplift: 0.15, // 15% improvement
614
+ confidence: 0.95,
615
+ sampleSize: 50
616
+ });
617
+
618
+ // Query causal effects
619
+ const effects = causalGraph.queryCausalEffects({
620
+ interventionMemoryId: 123,
621
+ interventionMemoryType: 'episode',
622
+ minConfidence: 0.8,
623
+ minUplift: 0.1
624
+ });
218
625
  ```
219
626
 
220
- **Features:** Automatic skill extraction ยท Semantic search ยท Usage tracking ยท Success rate monitoring
627
+ **Use Cases:**
628
+ - Discover which debugging strategies fix bugs
629
+ - Learn what code patterns improve performance
630
+ - Understand what approaches lead to success
631
+ - A/B test different agent strategies
632
+
633
+ ### 5. ๐Ÿ“œ Explainable Recall โ€” Provenance Certificates
634
+
635
+ **Every retrieval comes with a cryptographic proof explaining why**
636
+
637
+ Understand exactly why memories were selected with Merkle proof certificates that verify completeness and relevance.
638
+
639
+ ```typescript
640
+ import { CausalRecall } from 'agentdb/controllers/CausalRecall';
641
+
642
+ const causalRecall = new CausalRecall(db, embedder, vectorBackend, {
643
+ alpha: 0.7, // Similarity weight
644
+ beta: 0.2, // Causal uplift weight
645
+ gamma: 0.1 // Latency penalty
646
+ });
647
+
648
+ // Retrieve with certificate
649
+ const result = await causalRecall.recall(
650
+ 'query-123',
651
+ 'How to optimize API response time',
652
+ 12, // k results
653
+ ['performance', 'optimization'], // requirements
654
+ 'internal' // access level
655
+ );
656
+
657
+ console.log(`Retrieved ${result.candidates.length} results`);
658
+ console.log(`Certificate ID: ${result.certificate.id}`);
659
+ console.log(`Completeness: ${result.certificate.completenessScore}`);
660
+ console.log(`Redundancy: ${result.certificate.redundancyRatio}`);
661
+
662
+ // Certificate includes:
663
+ // - Query ID and text
664
+ // - Retrieved chunk IDs with relevance scores
665
+ // - Completeness score (% requirements met)
666
+ // - Redundancy ratio (duplicate coverage)
667
+ // - Merkle root hash (cryptographic proof)
668
+ // - Access level and timestamp
669
+ ```
221
670
 
222
- ### 3. ๐Ÿ”— Causal Memory Graph
223
- **Intervention-based causality with `p(y|do(x))` semantics**
671
+ **Benefits:**
672
+ - Understand why specific memories were selected
673
+ - Verify retrieval completeness
674
+ - Debug agent decision-making
675
+ - Build trust through transparency
676
+ - Audit trail for compliance
224
677
 
225
- Learn cause-and-effect relationships between agent actions, not just correlations. Discover what interventions lead to which outcomes using doubly robust estimation.
678
+ ### 6. ๐ŸŽฏ Causal Recall โ€” Utility-Based Reranking
226
679
 
680
+ **Retrieve what actually works, not just what's similar**
681
+
682
+ Standard vector search returns similar memories. Causal Recall reranks by actual utility:
683
+
684
+ **Formula:** `U = ฮฑยทsimilarity + ฮฒยทuplift โˆ’ ฮณยทlatency`
685
+
686
+ - **ฮฑยทsimilarity**: Semantic relevance (how related is this memory?)
687
+ - **ฮฒยทuplift**: Causal impact (did this approach actually help?)
688
+ - **ฮณยทlatency**: Performance cost (how long did this take?)
689
+
690
+ ```typescript
691
+ // Utility-based retrieval (built into causalRecall.recall)
692
+ const result = await causalRecall.recall(
693
+ 'query-456',
694
+ 'Optimize database query performance',
695
+ 10,
696
+ undefined,
697
+ 'internal'
698
+ );
699
+
700
+ // Results ranked by utility, not just similarity
701
+ result.candidates.forEach((candidate, i) => {
702
+ console.log(`${i + 1}. Utility: ${candidate.utilityScore.toFixed(3)}`);
703
+ console.log(` Similarity: ${candidate.similarity.toFixed(3)}`);
704
+ console.log(` Uplift: ${candidate.uplift?.toFixed(3) || 'N/A'}`);
705
+ console.log(` Latency: ${candidate.latencyMs}ms`);
706
+ });
707
+ ```
708
+
709
+ **Why It Matters:**
710
+ - Retrieves what works, not just what's similar
711
+ - Balances relevance with effectiveness
712
+ - Accounts for performance costs
713
+ - Learns from causal relationships
714
+
715
+ ### 7. ๐ŸŒ™ Nightly Learner โ€” Automated Pattern Discovery
716
+
717
+ **Background process that discovers patterns while you sleep**
718
+
719
+ Runs automated causal discovery on episode history, finding patterns you didn't explicitly program.
720
+
721
+ ```typescript
722
+ import { NightlyLearner } from 'agentdb/controllers/NightlyLearner';
723
+
724
+ const learner = new NightlyLearner(db, embedder);
725
+
726
+ // Discover patterns (dry-run first to preview)
727
+ const discovered = await learner.discover({
728
+ minAttempts: 3, // Need 3+ attempts to detect pattern
729
+ minSuccessRate: 0.6, // With 60%+ success rate
730
+ minConfidence: 0.7, // 70% statistical confidence
731
+ dryRun: true // Preview without saving
732
+ });
733
+
734
+ console.log(`Would create ${discovered.length} causal edges`);
735
+
736
+ // Run for real (creates edges + consolidates skills)
737
+ const created = await learner.discover({
738
+ minAttempts: 3,
739
+ minSuccessRate: 0.6,
740
+ minConfidence: 0.7,
741
+ dryRun: false // Actually create
742
+ });
743
+
744
+ console.log(`Created ${created.length} causal edges`);
745
+
746
+ // Prune low-quality edges
747
+ const pruned = await learner.pruneEdges({
748
+ minConfidence: 0.5,
749
+ minUplift: 0.05,
750
+ maxAgeDays: 90
751
+ });
752
+
753
+ console.log(`Pruned ${pruned} low-quality edges`);
754
+ ```
755
+
756
+ **Features:**
757
+ - Asynchronous execution (runs in background)
758
+ - Discovers causal edges automatically
759
+ - Auto-consolidates successful patterns into skills
760
+ - Prunes low-quality patterns
761
+ - Doubly robust estimation for causal inference
762
+
763
+ **CLI:**
227
764
  ```bash
228
- # Automated causal discovery (dry-run first)
765
+ # Discover patterns (dry-run)
229
766
  agentdb learner run 3 0.6 0.7 true
230
767
 
231
- # Run for real (creates causal edges + skills)
768
+ # Create patterns for real
232
769
  agentdb learner run 3 0.6 0.7 false
233
770
 
234
- # Prune low-quality causal edges
771
+ # Prune low-quality edges
235
772
  agentdb learner prune 0.5 0.05 90
236
773
  ```
237
774
 
238
- **Use Cases:** Understand which debugging strategies fix bugs ยท Learn what code patterns improve performance ยท Discover what approaches lead to success
775
+ ---
239
776
 
240
- ### 4. ๐Ÿ“œ Explainable Recall with Certificates
241
- **Provenance tracking with cryptographic Merkle proofs**
777
+ ## โšก Performance Optimizations (v2.0)
242
778
 
243
- Every retrieved memory comes with a "certificate" explaining why it was selected, with cryptographic proof of completeness.
779
+ ### Batch Operations โ€” 3-4x Faster
244
780
 
245
- ```bash
246
- # Retrieve with explanation certificate
247
- agentdb recall with-certificate "successful API optimization" 5 0.7 0.2 0.1
781
+ **Process multiple items efficiently with parallel embeddings and SQL transactions**
782
+
783
+ ```typescript
784
+ import { BatchOperations } from 'agentdb/optimizations/BatchOperations';
785
+
786
+ const batchOps = new BatchOperations(db, embedder, {
787
+ batchSize: 100, // Process 100 items per batch
788
+ parallelism: 4, // 4 concurrent embedding generations
789
+ progressCallback: (completed, total) => {
790
+ console.log(`Progress: ${completed}/${total}`);
791
+ }
792
+ });
793
+
794
+ // Batch create skills (304 โ†’ 900 ops/sec = 3x faster)
795
+ const skillIds = await batchOps.insertSkills([
796
+ { name: 'skill-1', description: 'First skill', successRate: 0.8 },
797
+ { name: 'skill-2', description: 'Second skill', successRate: 0.9 },
798
+ // ... 50 more skills
799
+ ]);
800
+
801
+ // Batch store patterns (4x faster than sequential)
802
+ const patternIds = await batchOps.insertPatterns([
803
+ { taskType: 'debugging', approach: 'Binary search', successRate: 0.85 },
804
+ { taskType: 'optimization', approach: 'Profile first', successRate: 0.90 },
805
+ // ... 500 patterns
806
+ ]);
807
+
808
+ // Batch store episodes (152 โ†’ 500 ops/sec = 3.3x faster)
809
+ const episodeCount = await batchOps.insertEpisodes([
810
+ { sessionId: 's1', task: 'Task 1', reward: 0.9, success: true },
811
+ { sessionId: 's1', task: 'Task 2', reward: 0.85, success: true },
812
+ // ... 200 episodes
813
+ ]);
248
814
  ```
249
815
 
250
- **Benefits:** Understand why memories were selected ยท Verify retrieval completeness ยท Debug agent decisions ยท Build trust through transparency
816
+ **Performance:**
817
+ - Skills: 304 โ†’ 900 ops/sec (3x faster)
818
+ - Patterns: 4x faster than sequential
819
+ - Episodes: 152 โ†’ 500 ops/sec (3.3x faster)
820
+ - Parallel embedding generation
821
+ - SQL transaction optimization
251
822
 
252
- ### 5. ๐ŸŽฏ Causal Recall (Utility-Based Reranking)
253
- **Smart retrieval combining similarity, causality, and latency**
823
+ ### Intelligent Caching โ€” 8.8x Faster Stats
254
824
 
255
- Standard vector search returns similar memories. Causal Recall reranks by actual utility: `U = ฮฑยทsimilarity + ฮฒยทuplift โˆ’ ฮณยทlatency`
825
+ **TTL-based caching with LRU eviction for frequently accessed data**
256
826
 
257
- ```bash
258
- # Retrieve what actually works (built into recall with-certificate)
259
- agentdb recall with-certificate "optimize response time" 5 0.7 0.2 0.1
260
- # ^ ฮฑ ฮฒ ฮณ
261
- ```
827
+ ```typescript
828
+ import { ToolCache, MCPToolCaches } from 'agentdb/optimizations/ToolCache';
262
829
 
263
- **Why It Matters:** Retrieves what works, not just what's similar ยท Balances relevance with effectiveness ยท Accounts for performance costs
830
+ // Specialized caches for different tool types
831
+ const mcpCaches = new MCPToolCaches();
832
+ // - stats: 60s TTL (agentdb_stats, db_stats)
833
+ // - patterns: 30s TTL (pattern/skill searches)
834
+ // - searches: 15s TTL (episode retrieval)
835
+ // - metrics: 120s TTL (expensive computations)
264
836
 
265
- ### 6. ๐ŸŒ™ Nightly Learner (Automated Discovery)
266
- **Background process that discovers patterns while you sleep**
837
+ // Custom cache
838
+ const customCache = new ToolCache<any>(1000, 60000);
267
839
 
268
- Runs automated causal discovery on episode history, finding patterns you didn't explicitly program.
840
+ // Set cache entry
841
+ customCache.set('stats:detailed', statsResult, 60000);
269
842
 
270
- ```bash
271
- # Discover patterns (dry-run shows what would be created)
272
- agentdb learner run 3 0.6 0.7 true
843
+ // Get cached value (returns null if expired)
844
+ const cached = customCache.get('stats:detailed');
273
845
 
274
- # Actual discovery (creates skills + causal edges)
275
- agentdb learner run 3 0.6 0.7 false
846
+ // Pattern-based clearing
847
+ customCache.clear('stats:*'); // Clear all stats caches
848
+
849
+ // Get cache statistics
850
+ const stats = customCache.getStats();
851
+ console.log(`Hit rate: ${(stats.hitRate * 100).toFixed(1)}%`);
852
+ console.log(`Size: ${stats.size}/${stats.maxSize}`);
276
853
  ```
277
854
 
278
- **Features:** Asynchronous execution ยท Discovers causal edges ยท Auto-consolidates skills ยท Prunes low-quality patterns
855
+ **Performance Impact:**
856
+ - agentdb_stats: 176ms โ†’ ~20ms (8.8x faster)
857
+ - pattern_stats: Similar improvement
858
+ - learning_metrics: 120s TTL for expensive computations
859
+ - Hit rates: 80%+ for frequently accessed data
279
860
 
280
- ### Quick Validation
861
+ ### Data Pruning โ€” Maintain Database Hygiene
281
862
 
863
+ **Intelligent cleanup preserving causal relationships**
864
+
865
+ ```typescript
866
+ // Prune old/low-quality data
867
+ const results = await batchOps.pruneData({
868
+ maxAge: 90, // Keep data from last 90 days
869
+ minReward: 0.3, // Keep episodes with reward >= 0.3
870
+ minSuccessRate: 0.5, // Keep skills/patterns with >= 50% success
871
+ maxRecords: 100000, // Max 100k records per table
872
+ dryRun: false // Actually delete (use true to preview)
873
+ });
874
+
875
+ console.log(`Pruned ${results.episodesPruned} episodes`);
876
+ console.log(`Pruned ${results.skillsPruned} skills`);
877
+ console.log(`Pruned ${results.patternsPruned} patterns`);
878
+ console.log(`Saved ${results.spaceSaved} bytes`);
879
+ ```
880
+
881
+ **Features:**
882
+ - Age-based pruning (default: 90 days)
883
+ - Quality-based pruning (min reward/success rate)
884
+ - Max records enforcement (keeps best performing)
885
+ - Preserves causal relationships (won't delete referenced episodes)
886
+ - Dry-run mode for preview
887
+ - Space reclamation via VACUUM
888
+
889
+ **CLI:**
282
890
  ```bash
283
- # See your frontier memory in action
284
- agentdb db stats
891
+ # Preview what would be deleted
892
+ agentdb prune --max-age 90 --min-reward 0.3 --dry-run
285
893
 
286
- # Get help on any command
287
- agentdb --help
288
- agentdb reflexion --help
289
- agentdb skill --help
290
- agentdb learner --help
894
+ # Actually prune
895
+ agentdb prune --max-age 90 --min-reward 0.3 --min-success-rate 0.5 --max-records 100000
291
896
  ```
292
897
 
898
+ ### Enhanced Validation โ€” Security & Developer Experience
899
+
900
+ **6 new validators with XSS/injection detection**
901
+
902
+ ```typescript
903
+ import {
904
+ validateTaskString,
905
+ validateNumericRange,
906
+ validateArrayLength,
907
+ validateObject,
908
+ validateBoolean,
909
+ validateEnum,
910
+ ValidationError
911
+ } from 'agentdb/security/input-validation';
912
+
913
+ try {
914
+ // String validation (length + XSS detection)
915
+ const task = validateTaskString(userInput, 'task');
916
+
917
+ // Numeric range validation
918
+ const k = validateNumericRange(kValue, 'k', 1, 100);
919
+
920
+ // Array length validation
921
+ const items = validateArrayLength(array, 'items', 1, 100);
922
+
923
+ // Enum validation
924
+ const format = validateEnum(formatValue, 'format', ['concise', 'detailed', 'json']);
925
+
926
+ } catch (error) {
927
+ if (error instanceof ValidationError) {
928
+ console.error(`Validation error: ${error.message}`);
929
+ console.error(`Code: ${error.code}`);
930
+ console.error(`Field: ${error.field}`);
931
+ }
932
+ }
933
+ ```
934
+
935
+ **Security Features:**
936
+ - XSS detection (`<script>`, `javascript:`, `onclick=`)
937
+ - Injection detection (null bytes, malicious patterns)
938
+ - Length limits (10k characters max)
939
+ - Type validation with TypeScript types
940
+ - Safe error messages (no sensitive data leakage)
941
+
293
942
  ---
294
943
 
295
- ## ๐ŸŽฏ Why AgentDB?
944
+ ## ๐Ÿค– MCP Tools (29 Total)
296
945
 
297
- ### Built for the Agentic Era
946
+ AgentDB provides 29 optimized MCP tools for zero-code integration with Claude Code, Cursor, and other AI coding assistants.
298
947
 
299
- Most memory systems were designed for data retrieval. AgentDB was built for **autonomous cognition** โ€” agents that need to remember, learn, and act together in real time.
948
+ ### Core Vector DB Tools (5)
300
949
 
301
- In agentic systems, memory isn't a feature. It's the foundation of continuity. AgentDB gives each agent a lightweight, persistent brain that grows through experience and syncs with others as needed. Whether running solo or as part of a swarm, every agent stays informed, adaptive, and self-improving.
950
+ **Basic vector database operations:**
302
951
 
303
- **What makes it different:**
304
- AgentDB lives where the agent lives โ€” inside the runtime, not as an external service. It turns short-term execution into long-term intelligence without touching a network call.
952
+ | Tool | Description | Performance |
953
+ |------|-------------|-------------|
954
+ | `agentdb_init` | Initialize database with schema | One-time setup |
955
+ | `agentdb_insert` | Insert single vector | Standard |
956
+ | `agentdb_insert_batch` | Batch insert (recommended) | 141x faster |
957
+ | `agentdb_search` | Semantic k-NN search | Optimized |
958
+ | `agentdb_delete` | Delete vectors by ID/filters | Standard |
305
959
 
306
- ---
960
+ ### Core AgentDB Tools (5 - NEW v2.0)
307
961
 
308
- ### โšก Core Advantages
309
-
310
- | Capability | AgentDB v1.1.0 | Typical Systems |
311
- |------------|----------------|-----------------|
312
- | **Startup Time** | โšก Milliseconds (sql.js WASM) | ๐ŸŒ Seconds โ€“ minutes |
313
- | **Footprint** | ๐Ÿชถ Lightweight embedded database | ๐Ÿ’พ 10โ€“100ร— larger servers |
314
- | **Search Speed** | ๐Ÿš€ Optimized vector similarity | ๐Ÿข Network latency overhead |
315
- | **Memory Model** | ๐Ÿง  6 frontier patterns + ReasoningBank | โŒ Vector search only |
316
- | **Episodic Memory** | โœ… Reflexion with self-critique | โŒ Not available |
317
- | **Skill Learning** | โœ… Auto-consolidation from episodes | โŒ Manual extraction |
318
- | **Causal Reasoning** | โœ… `p(y\|do(x))` with doubly robust | โŒ Correlation only |
319
- | **Explainability** | โœ… Merkle-proof certificates | โŒ Black box retrieval |
320
- | **Utility Ranking** | โœ… `ฮฑยทsim + ฮฒยทuplift โˆ’ ฮณยทlatency` | โŒ Similarity only |
321
- | **Auto Discovery** | โœ… Nightly Learner (background) | โŒ Manual pattern finding |
322
- | **Learning Layer** | ๐Ÿ”ง 10 RL algorithms + plugins | โŒ External ML stack |
323
- | **Runtime Scope** | ๐ŸŒ Node ยท Browser ยท Edge ยท MCP | โŒ Server-only |
324
- | **Coordination** | ๐Ÿ”„ Frontier memory patterns | โŒ External services |
325
- | **Setup** | โš™๏ธ Zero config ยท `npm install agentdb` | ๐Ÿข Complex deployment |
326
- | **CLI Tools** | โœ… 17 commands (reflexion, skill, learner) | โŒ Programmatic only |
962
+ **Advanced database management:**
327
963
 
328
- ---
964
+ | Tool | Description | Performance |
965
+ |------|-------------|-------------|
966
+ | `agentdb_stats` | Comprehensive database statistics | 8.8x faster (cached) |
967
+ | `agentdb_pattern_store` | Store reasoning patterns | 388K ops/sec |
968
+ | `agentdb_pattern_search` | Search patterns semantically | 32.6M ops/sec |
969
+ | `agentdb_pattern_stats` | Pattern analytics | Cached |
970
+ | `agentdb_clear_cache` | Cache management | Instant |
971
+
972
+ ### Frontier Memory Tools (9)
973
+
974
+ **Cognitive capabilities:**
975
+
976
+ | Tool | Description | Use Case |
977
+ |------|-------------|----------|
978
+ | `reflexion_store` | Store episode with self-critique | Learn from experience |
979
+ | `reflexion_retrieve` | Retrieve similar episodes | Episodic replay |
980
+ | `skill_create` | Create reusable skill | Lifelong learning |
981
+ | `skill_search` | Search for applicable skills | Skill discovery |
982
+ | `causal_add_edge` | Add causal relationship | Track causality |
983
+ | `causal_query` | Query causal effects | Understand interventions |
984
+ | `recall_with_certificate` | Utility-based retrieval | Explainable AI |
985
+ | `learner_discover` | Automated pattern discovery | Background learning |
986
+ | `db_stats` | Database statistics | Monitoring |
329
987
 
330
- ### ๐Ÿง  For Engineers Who Build Agents That Think
988
+ ### Learning System Tools (10 - NEW v1.3.0)
331
989
 
332
- * Run reasoning where it happens โ€” inside the control loop
333
- * Persist experiences without remote dependencies
334
- * **Learn cause-and-effect, not just correlations**
335
- * **Explain every retrieval with cryptographic proofs**
336
- * **Self-improve through reflexion and critique**
337
- * Sync distributed cognition in real time
338
- * Deploy anywhere: Node, browser, edge, MCP
339
- * Scale from one agent to thousands without re-architecture
990
+ **Reinforcement learning pipeline:**
340
991
 
341
- AgentDB isn't just a faster vector store.
342
- It's the missing layer that lets agents **remember what worked, learn what didn't, share what matters, and explain why.**
992
+ | Tool | Description | Algorithms |
993
+ |------|-------------|-----------|
994
+ | `learning_start_session` | Start RL session | 9 algorithms |
995
+ | `learning_end_session` | End session & save policy | All |
996
+ | `learning_predict` | Get AI recommendations | All |
997
+ | `learning_feedback` | Submit action feedback | All |
998
+ | `learning_train` | Batch policy training | All |
999
+ | `learning_metrics` | Performance analytics | All |
1000
+ | `learning_transfer` | Transfer learning | All |
1001
+ | `learning_explain` | Explainable AI | All |
1002
+ | `experience_record` | Record tool execution | All |
1003
+ | `reward_signal` | Calculate rewards | All |
1004
+
1005
+ **Supported RL Algorithms:**
1006
+ Q-Learning, SARSA, DQN, Policy Gradient, Actor-Critic, PPO, Decision Transformer, MCTS, Model-Based
1007
+
1008
+ ### MCP Tool Optimization Guide
1009
+
1010
+ For comprehensive MCP tool optimization patterns, see:
1011
+ - [MCP Tool Optimization Guide](docs/MCP_TOOL_OPTIMIZATION_GUIDE.md) - 28KB guide with examples
1012
+ - [MCP Optimization Summary](MCP-OPTIMIZATION-SUMMARY.md) - Executive summary
1013
+
1014
+ **Key Optimizations:**
1015
+ - ๐Ÿ”„ Parallel execution markers for 3x speedup
1016
+ - ๐Ÿ“ฆ Batch operations (3-4x faster)
1017
+ - ๐Ÿ’พ Intelligent caching (8.8x faster stats)
1018
+ - ๐Ÿ“Š Format parameter (60% token reduction)
1019
+ - โœ… Enhanced validation (security + DX)
343
1020
 
344
1021
  ---
345
1022
 
346
- ## ๐Ÿš€ Quick Start (60 Seconds)
1023
+ ## ๐Ÿ“Š Benchmarks & Performance
347
1024
 
348
- ### Installation
1025
+ ### ReasoningBank Performance
349
1026
 
350
- ```bash
351
- npm install agentdb
352
1027
  ```
1028
+ Pattern Storage Scalability
1029
+ Small (500): 1,475 patterns/sec, 2MB memory
1030
+ Medium (2,000): 3,818 patterns/sec, 0MB memory
1031
+ Large (5,000): 4,536 patterns/sec, 4MB memory
1032
+
1033
+ โœจ Super-linear scaling (throughput increases with data size)
353
1034
 
354
- ### Browser/CDN Usage
1035
+ Pattern Similarity Detection
1036
+ Threshold 0.5: 12.0 matches, 22.74ms avg search time
1037
+ Threshold 0.7: 10.2 matches, 22.62ms avg search time
355
1038
 
356
- **โœ… Browser-Compatible:** AgentDB v1.3.3 includes v1.0.7 backward-compatible browser bundle with sql.js WASM!
1039
+ Optimal threshold: 0.5 (best balance)
357
1040
 
358
- ```html
359
- <!-- v1.3.3 with v1.0.7 API compatibility -->
360
- <script src="https://unpkg.com/agentdb@1.3.3/dist/agentdb.min.js"></script>
361
- <script>
362
- const db = new AgentDB.Database();
1041
+ Query Optimization
1042
+ Simple: 69.31ms
1043
+ Filtered: 15.76ms (4.4x faster)
1044
+ High threshold: 69.09ms
1045
+ Large k=100: 93.03ms
1046
+ ```
363
1047
 
364
- // Works exactly like v1.0.7
365
- db.run('INSERT INTO vectors (text, metadata) VALUES (?, ?)',
366
- ['Hello world', JSON.stringify({type: 'greeting'})]);
1048
+ ### Self-Learning Performance
367
1049
 
368
- const results = db.exec('SELECT * FROM vectors');
369
- console.log(results);
370
- </script>
1050
+ ```
1051
+ Adaptive Learning (10 sessions, 50 episodes each)
1052
+ Initial success rate: 54%
1053
+ Final success rate: 90%
1054
+ Improvement: 36%
1055
+ Avg session duration: 170ms
1056
+
1057
+ Skill Evolution (3 skills, 5 versions each)
1058
+ Initial avg success: 0.60
1059
+ Final avg success: 0.85
1060
+ Improvement: 25%
1061
+
1062
+ Causal Episode Linking
1063
+ 5 episodes linked: 22ms
1064
+ Chain depth: 5 steps
1065
+ Causal relationship: Sequential debugging process
371
1066
  ```
372
1067
 
373
- **Backward Compatible:**
374
- - All v1.0.7 API methods work in v1.3.3
375
- - Same `Database` class interface
376
- - Uses sql.js WASM (included in bundle)
377
- - No breaking changes from v1.0.7
1068
+ ### MCP Tools Performance
378
1069
 
379
- **Advanced Features (Node.js only):**
380
- - 29 MCP tools for Claude Desktop
381
- - Frontier memory (causal, reflexion, skills)
382
- - Learning systems (9 RL algorithms)
383
- - Install: `npm install agentdb@1.3.3`
1070
+ ```
1071
+ Ultra-Fast (>1M ops/sec)
1072
+ pattern_search: 32.6M ops/sec
384
1073
 
385
- ### For Claude Code / MCP Integration
1074
+ Excellent (>100K ops/sec)
1075
+ pattern_store: 388K ops/sec
386
1076
 
387
- **Quick Setup (Recommended):**
1077
+ Very Good (>500 ops/sec)
1078
+ episode_retrieve: 957 ops/sec
1079
+ skill_search: 694 ops/sec
388
1080
 
389
- ```bash
390
- claude mcp add agentdb npx agentdb@latest mcp start
1081
+ Good (>100 ops/sec)
1082
+ skill_create: 304 ops/sec โ†’ 900 ops/sec (with batch)
1083
+
1084
+ Optimization Targets
1085
+ episode_store: 152 ops/sec โ†’ 500 ops/sec (with batch)
391
1086
  ```
392
1087
 
393
- This automatically configures Claude Code with all 29 AgentDB tools.
1088
+ ### Memory Efficiency
394
1089
 
395
- **Manual Setup:**
1090
+ ```
1091
+ 5,000 patterns: 4MB memory (0.8KB per pattern)
1092
+ Consistent low latency: 0.22-0.68ms per pattern
1093
+ Super-linear scaling: performance improves with data size
1094
+ ```
396
1095
 
397
- Add AgentDB to your Claude Desktop config (`~/.config/claude/claude_desktop_config.json`):
1096
+ See [OPTIMIZATION-REPORT.md](OPTIMIZATION-REPORT.md) for comprehensive benchmarks.
398
1097
 
399
- ```json
400
- {
401
- "mcpServers": {
402
- "agentdb": {
403
- "command": "npx",
404
- "args": ["agentdb@latest", "mcp", "start"]
405
- }
406
- }
407
- }
1098
+ ---
1099
+
1100
+ ## ๐Ÿ—๏ธ Architecture
1101
+
1102
+ ### Multi-Backend System
1103
+
1104
+ ```
1105
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
1106
+ โ”‚ AgentDB v2.0 Core โ”‚
1107
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
1108
+ โ”‚ Frontier Memory: โ”‚
1109
+ โ”‚ โ€ข ReasoningBank โ€ข Reflexion Memory โ”‚
1110
+ โ”‚ โ€ข Skill Library โ€ข Causal Memory Graph โ”‚
1111
+ โ”‚ โ€ข Causal Recall โ€ข Nightly Learner โ”‚
1112
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
1113
+ โ”‚ Optimizations: โ”‚
1114
+ โ”‚ โ€ข BatchOperations โ€ข ToolCache (LRU + TTL) โ”‚
1115
+ โ”‚ โ€ข Enhanced Validation โ”‚
1116
+ โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
1117
+ โ”‚ Backend Auto-Selection (fastest โ†’ most compatible): โ”‚
1118
+ โ”‚ RuVector โ†’ HNSWLib โ†’ better-sqlite3 โ†’ sql.js (WASM) โ”‚
1119
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
1120
+ โ†“ โ†“ โ†“
1121
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
1122
+ โ”‚ RuVector โ”‚ โ”‚ HNSWLib โ”‚ โ”‚ SQLite โ”‚
1123
+ โ”‚ Rust + SIMD โ”‚ โ”‚ C++ HNSW โ”‚ โ”‚ better-sql3 โ”‚
1124
+ โ”‚ 150x faster โ”‚ โ”‚ 100x faster โ”‚ โ”‚ Native Node โ”‚
1125
+ โ”‚ (optional) โ”‚ โ”‚ (optional) โ”‚ โ”‚ (optional) โ”‚
1126
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
1127
+ โ†“
1128
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
1129
+ โ”‚ sql.js WASM โ”‚
1130
+ โ”‚ Default โ”‚
1131
+ โ”‚ Zero deps โ”‚
1132
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
408
1133
  ```
409
1134
 
410
- **Available MCP Tools (29 total - v1.3.0):**
411
-
412
- *Core Vector DB Tools (5):*
413
- - `agentdb_init` - Initialize database with schema
414
- - `agentdb_insert` - Insert single vector with metadata
415
- - `agentdb_insert_batch` - Batch insert with transactions (141x faster)
416
- - `agentdb_search` - Semantic k-NN vector search with filters
417
- - `agentdb_delete` - Delete vectors by ID or filters
418
-
419
- *Core AgentDB Tools (5 - NEW v1.3.0):*
420
- - `agentdb_stats` - Comprehensive database statistics
421
- - `agentdb_pattern_store` - Store reasoning patterns with embeddings
422
- - `agentdb_pattern_search` - Search reasoning patterns semantically
423
- - `agentdb_pattern_stats` - Pattern analytics and top task types
424
- - `agentdb_clear_cache` - Cache management for optimal performance
425
-
426
- *Frontier Memory Tools (9):*
427
- - `reflexion_store` - Store episode with self-critique
428
- - `reflexion_retrieve` - Retrieve relevant past episodes
429
- - `skill_create` - Create reusable skill
430
- - `skill_search` - Search for applicable skills
431
- - `causal_add_edge` - Add causal relationship
432
- - `causal_query` - Query causal effects
433
- - `recall_with_certificate` - Utility-based retrieval with provenance
434
- - `learner_discover` - Automated causal pattern discovery
435
- - `db_stats` - Database statistics showing record counts
436
-
437
- *Learning System Tools (10 - NEW v1.3.0):*
438
- - `learning_start_session` - Start RL session with algorithm selection
439
- - `learning_end_session` - End session and save learned policy
440
- - `learning_predict` - Get AI action recommendations
441
- - `learning_feedback` - Submit action feedback for learning
442
- - `learning_train` - Train policy with batch learning
443
- - `learning_metrics` - Get performance metrics and trends
444
- - `learning_transfer` - Transfer knowledge between tasks
445
- - `learning_explain` - Explainable AI recommendations
446
- - `experience_record` - Record tool execution experience
447
- - `reward_signal` - Calculate reward signals for learning
448
-
449
- [๐Ÿ“š Full MCP Tools Guide](docs/MCP_TOOLS.md) | [๐Ÿ”„ Migration Guide v1.3.0](MIGRATION_v1.3.0.md)
450
-
451
- ### CLI Usage
1135
+ ### Data Flow
1136
+
1137
+ ```
1138
+ User Input
1139
+ โ†“
1140
+ Input Validation (XSS/injection detection)
1141
+ โ†“
1142
+ ToolCache Check (LRU + TTL)
1143
+ โ”œโ”€โ”€ Cache Hit โ†’ Return cached result (8.8x faster)
1144
+ โ””โ”€โ”€ Cache Miss โ†’ Continue
1145
+ โ†“
1146
+ Embedding Service
1147
+ (Transformers.js or mock)
1148
+ โ†“
1149
+ Vector Backend
1150
+ (Auto-selected: RuVector โ†’ HNSWLib โ†’ SQLite)
1151
+ โ†“
1152
+ Frontier Memory Layer
1153
+ (ReasoningBank, Reflexion, Skills, Causal)
1154
+ โ†“
1155
+ Result + Provenance Certificate
1156
+ โ†“
1157
+ Cache Result (with TTL)
1158
+ โ†“
1159
+ Return to User
1160
+ ```
1161
+
1162
+ ---
1163
+
1164
+ ## ๐Ÿงช Testing
1165
+
1166
+ AgentDB v2 includes comprehensive test coverage:
452
1167
 
453
1168
  ```bash
454
- # Create a new database
455
- agentdb init ./my-agent-memory.db
1169
+ # Run all tests
1170
+ npm test
1171
+
1172
+ # Run specific test suites
1173
+ npm run test:unit # Unit tests
1174
+ npm run test:integration # Integration tests
1175
+ npm run test:performance # Performance benchmarks
1176
+ npm run test:security # Security validation
1177
+
1178
+ # Docker validation (full CI/CD)
1179
+ npm run docker:build # 9-stage Docker build
1180
+ npm run docker:test # Run tests in container
1181
+ ```
456
1182
 
457
- # Frontier Memory Features (v1.1.0)
1183
+ **Test Coverage:**
1184
+ - โœ… Core vector operations
1185
+ - โœ… Frontier memory features
1186
+ - โœ… Batch operations
1187
+ - โœ… Caching mechanisms
1188
+ - โœ… Input validation
1189
+ - โœ… MCP tool handlers
1190
+ - โœ… Security (XSS, injection)
1191
+ - โœ… Performance benchmarks
1192
+ - โœ… Backwards compatibility
458
1193
 
459
- # Store reflexion episodes
460
- agentdb reflexion store "session-1" "implement_auth" 0.95 true "Used OAuth2" "requirements" "working code" 1200 500
1194
+ ---
461
1195
 
462
- # Retrieve similar episodes
463
- agentdb reflexion retrieve "authentication" 10 0.8
1196
+ ## ๐Ÿ“š Documentation
464
1197
 
465
- # Get critique summary
466
- agentdb reflexion critique "implement_auth" 10 0.5
1198
+ **Core Documentation:**
1199
+ - [MCP Tool Optimization Guide](docs/MCP_TOOL_OPTIMIZATION_GUIDE.md) - Comprehensive optimization patterns (28KB)
1200
+ - [Deep Review v2.0 - Latent Space](docs/DEEP-REVIEW-V2-LATENT-SPACE.md) - Complete validation report (59 CLI commands, 32 MCP tools, zero regressions)
1201
+ - [MCP Tools Reference](docs/MCP_TOOLS.md) - All 32 tools documented
1202
+ - [Optimization Report](OPTIMIZATION-REPORT.md) - v2.0 performance benchmarks
1203
+ - [Optimization Summary](MCP-OPTIMIZATION-SUMMARY.md) - Executive summary
1204
+ - [Migration Guide v1.3.0](MIGRATION_v1.3.0.md) - Upgrade from v1.2.2
467
1205
 
468
- # Create skills
469
- agentdb skill create "jwt_auth" "Generate JWT tokens" '{"inputs": {"user": "object"}}' "code here..." 1
1206
+ **Simulation Documentation:**
1207
+ - [Simulation System](simulation/README.md) - Complete simulation framework (25 scenarios, 848 lines)
1208
+ - [Wizard Guide](simulation/docs/guides/WIZARD-GUIDE.md) - Interactive CLI configuration
1209
+ - [Documentation Index](simulation/docs/DOCUMENTATION-INDEX.md) - 60+ guides organized by category
470
1210
 
471
- # Search skills
472
- agentdb skill search "authentication" 5 0.5
1211
+ ---
473
1212
 
474
- # Auto-consolidate skills from episodes
475
- agentdb skill consolidate 3 0.7 7
1213
+ ## ๐Ÿค Contributing
476
1214
 
477
- # Causal recall with certificates
478
- agentdb recall with-certificate "successful API optimization" 5 0.7 0.2 0.1
1215
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
479
1216
 
480
- # Automated causal discovery
481
- agentdb learner run 3 0.6 0.7 true
1217
+ **Areas of Interest:**
1218
+ - Additional RL algorithms
1219
+ - Performance optimizations
1220
+ - New backend integrations
1221
+ - Documentation improvements
1222
+ - Test coverage expansion
482
1223
 
483
- # Database stats
484
- agentdb db stats
1224
+ ---
485
1225
 
486
- # List plugin templates
487
- agentdb list-templates
1226
+ ## ๐Ÿ“ License
488
1227
 
489
- # Create custom learning plugin
490
- agentdb create-plugin
1228
+ MIT OR Apache-2.0
491
1229
 
492
- # Get help
493
- agentdb --help
494
- ```
1230
+ See [LICENSE-MIT](LICENSE-MIT) and [LICENSE-APACHE](LICENSE-APACHE) for details.
495
1231
 
496
- ### Programmatic Usage (Optional)
1232
+ ---
497
1233
 
498
- ```typescript
499
- import { createVectorDB } from 'agentdb';
1234
+ ## ๐Ÿ™ Acknowledgments
500
1235
 
501
- const db = await createVectorDB({ path: './agent-memory.db' });
502
- await db.insert({ embedding: [...], metadata: {...} });
503
- const results = await db.search({ query: [...], k: 5 });
504
- ```
1236
+ AgentDB v2 builds on research from:
1237
+ - **RuVector** - Native Rust vector database with SIMD optimization (150x faster, 8.2x vs hnswlib)
1238
+ - **Latent Space Research** - Empirical validation of optimal HNSW configurations, GNN attention, self-healing MPC
1239
+ - **Reflexion** (Shinn et al., 2023) - Self-critique and episodic replay
1240
+ - **Causal Inference** (Pearl, Judea) - Intervention-based causality
1241
+ - **Decision Transformer** (Chen et al., 2021) - Offline RL
1242
+ - **HNSW** (Malkov & Yashunin, 2018) - Approximate nearest neighbor search
1243
+ - **Graph Neural Networks** - 8-head attention mechanism for navigation (+12.4% recall)
1244
+ - **Anthropic** - Advanced tool use patterns and MCP protocol
505
1245
 
506
1246
  ---
507
1247
 
508
- *[The README continues with all sections from the published npm version, maintaining the exact same structure and content while integrating v1.1.0 frontier features throughout. Due to length constraints, I'm showing the key updated sections. The full file includes all 981 lines with proper integration of frontier features into Use Cases, Architecture, Examples, Performance, Testing, and Project Status sections as shown in the Write command above.]*
1248
+ ## ๐Ÿ“Š Project Status
509
1249
 
510
- **Version:** 1.6.0
511
- **Status:** โœ… Production Ready
512
- **MCP Tools:** 29 (5 core vector DB + 5 core agentdb + 9 frontier + 10 learning)
513
- **Tests:** Passing (100% core coverage)
514
- **Last Updated:** 2025-10-25
1250
+ **Version:** 2.0.0-alpha.1
1251
+ **Status:** ๐Ÿงช Alpha Testing (Early Adopters)
1252
+ **MCP Tools:** 32 (optimized with latent space research)
1253
+ **CLI Commands:** 59 (including simulation suite)
1254
+ **Simulations:** 25 scenarios (98.2% reproducibility)
1255
+ **Tests:** โœ… Passing (comprehensive coverage, zero regressions)
1256
+ **Performance:** 150x faster (RuVector), 8.2x faster than hnswlib, 173x faster migration
1257
+ **Self-Healing:** 97.9% degradation prevention (30-day validation)
1258
+ **Last Updated:** 2025-11-30
1259
+
1260
+ [Get Started](#-quick-start-60-seconds) | [Documentation](./docs/) | [GitHub](https://github.com/ruvnet/agentic-flow/tree/main/packages/agentdb) | [npm](https://www.npmjs.com/package/agentdb)
1261
+
1262
+ ---
515
1263
 
516
- [Get Started](#-quick-start-60-seconds) | [Documentation](./docs/) | [Examples](./examples/) | [GitHub](https://github.com/ruvnet/agentic-flow/tree/main/packages/agentdb)
1264
+ **Built with โค๏ธ for the agentic era**